documentation needs help
We read:
"Equivalent to write_term/2 using the options ignore_ops
, quoted
and numbervars
after numbervars/4 using the singletons
option."
This should be reformulated to:
"Equivalent to transforming Term with numbervars/4 using the singletons
option, followed by write_term/2 using the options ignore_ops
, quoted
and numbervars
.
As in:
?- Term = f(X,Y,X), write_canonical(Term). f(A,_,A) Term = f($VAR(X),$VAR(Y),$VAR(X)).
Same as (note that variables in Term are unified with $VAR/N terms):
?- Term = f(X,Y,X), numbervars(Term, 0, End, [singletons(true)]), write_term(Term, [ignore_ops(true),quoted(true),numbervars(true)]). f(A,_,A) Term = f($VAR(0),$VAR(_),$VAR(0)), X = $VAR(0), Y = $VAR(_), End = 1.
See also numbervars/3 for more comment.
Slight error:
"This used to be the case anyhow, as garbage collection between multiple calls to one of the write predicates can change the _G<NNN> identity of the variables."
But variables are now just printed as `_$INTEGER`.