Availability:built-in
term_singletons(+Term,
-List)Unify List with a list of variables, each sharing with a
variable that appears only once in Term.bugIn
the current implementation Term must be acyclic. If not, a representation_error
is raised. Note that, if a variable appears in a shared
subterm, it is not considered singleton. Thus,
A is not a singleton in the example below. See also
the singleton option of numbervars/4.
?- S = a(A), term_singletons(t(S,S), L).
L = [].
- Fixed in 8.1.13 (👉dbe3c18) Issue#498: crash in term_singletons/2 if second argument is instantiated.