|Did you know ...||Search Documentation:|
|library(varnumbers): Utilities for numbered terms|
This library provides the inverse functionality of the built-in
Note that this library suffers from the known issues that’$VAR'(X)
is a normal Prolog term and, -unlike the built-in numbervars-, the
inverse predicates do not process cyclic terms. The following
predicate is true for any acyclic term that contains no’$VAR'(X),
integer(X) terms and no constraint variables:
always_true(X) :- copy_term(X, X2), numbervars(X), varnumbers(X, Copy), Copy =@= X2.
numbervars(Term, 0, _).
varnumbers(Term, 0, Copy).
>=Start consistently replaced by fresh variables. Variables in Term are shared with Copy rather than replaced by fresh variables.
domain_error(acyclic_term, Term)if Term is cyclic.
X = Var, relating the X terms with the variable it is mapped to.