4.21 Analysing and Constructing Terms
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Analysing and Constructing Terms
          • functor/3
          • functor/4
          • arg/3
          • =../2
          • compound_name_arity/3
          • compound_name_arguments/3
          • numbervars/3
          • numbervars/4
          • var_number/2
          • term_variables/2
          • nonground/2
          • term_variables/3
          • term_singletons/2
          • is_most_general_term/1
          • copy_term/2
          • copy_term/4
          • copy_term_nat/4
          • Non-logical operations on terms
    • Packages
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 = [].