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 = [].