| Did you know ... | Search Documentation: |
| terms.pl -- SICStus 3-compatible library(terms). |
term_variables_bag(+Term, -Variables) is detThe following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
term_size(@Term, -Size) is det?- A = a(1,2,3), term_size(A,S). S = 4. ?- A = a(1,2,3), term_size(a(A,A),S). S = 7. ?- term_size(a(a(1,2,3), a(1,2,3)), S). S = 11.
Note that small objects such as atoms and small integers have a size 0. Space is allocated for floats, large integers, strings and compound terms.
variant(@Term1, @Term2) is semidetTerm1 =@= Term2.
subsumes_chk(@Generic, @Specific)
subsumes(+Generic, @Specific)
term_subsumer(+Special1, +Special2, -General) is det
term_factorized(+Term, -Skeleton, -Substiution)?- X = a(X), term_factorized(b(X,X), Y, S). Y = b(_G255, _G255), S = [_G255=a(_G255)].
mapargs(:Goal, ?Term1, ?Term2)call(Goal, A1, A2) is true.
mapsubterms(:Goal, +Term1, -Term2) is det
mapsubterms_var(:Goal, +Term1, -Term2) is detcall(Goal, ST1, ST2) succeeds. Procedurably, the
mapping for each (sub) term pair T1/T2 is defined as:
call(Goal, T1, T2) succeeds we are done. Note that the
mapping does not continue in T2. If this is desired, Goal
must call mapsubterms/3 explicitly as part of its conversion.Both predicates are implemented using foldsubterms/5.
mapsubterms(:Goal, +Term1, -Term2) is det
mapsubterms_var(:Goal, +Term1, -Term2) is detcall(Goal, ST1, ST2) succeeds. Procedurably, the
mapping for each (sub) term pair T1/T2 is defined as:
call(Goal, T1, T2) succeeds we are done. Note that the
mapping does not continue in T2. If this is desired, Goal
must call mapsubterms/3 explicitly as part of its conversion.Both predicates are implemented using foldsubterms/5.
foldsubterms(:Goal3, +Term1, +State0, -State) is semidet
foldsubterms(:Goal4, +Term1, ?Term2, +State0, -State) is semidetcall(Goal4, SubTerm1, SubTerm2,
StateIn, StateOut) for each subterm, including variables, in Term1.
If this call fails, StateIn and StateOut are the same. This
predicate may be used to map subterms in a term while collecting
state about the mapped subterms. The foldsubterms/4 variant does not
map the term.
foldsubterms(:Goal3, +Term1, +State0, -State) is semidet
foldsubterms(:Goal4, +Term1, ?Term2, +State0, -State) is semidetcall(Goal4, SubTerm1, SubTerm2,
StateIn, StateOut) for each subterm, including variables, in Term1.
If this call fails, StateIn and StateOut are the same. This
predicate may be used to map subterms in a term while collecting
state about the mapped subterms. The foldsubterms/4 variant does not
map the term.
same_functor(?Term1, ?Term2) is semidet
same_functor(?Term1, ?Term2, -Arity) is semidet
same_functor(?Term1, ?Term2, ?Name, ?Arity) is semidetIf Arity is 0, Term1 and Term2 are unified with Name for compatibility.
same_functor(?Term1, ?Term2) is semidet
same_functor(?Term1, ?Term2, -Arity) is semidet
same_functor(?Term1, ?Term2, ?Name, ?Arity) is semidetIf Arity is 0, Term1 and Term2 are unified with Name for compatibility.
same_functor(?Term1, ?Term2) is semidet
same_functor(?Term1, ?Term2, -Arity) is semidet
same_functor(?Term1, ?Term2, ?Name, ?Arity) is semidetIf Arity is 0, Term1 and Term2 are unified with Name for compatibility.
The following predicates are exported, but not or incorrectly documented.