YAP 7.1.0
Utilities On Terms

The next routines provide a set of commonly used utilities to manipulate terms. More...

Detailed Description

The next routines provide a set of commonly used utilities to manipulate terms.

Most of these utilities have been implemented in C for efficiency They are available through the use_module(library(terms)) command


Class Documentation

◆ cyclic_term/1

class cyclic_term/1

cyclic_term( + T )

cyclic_term(? Term)

Succeeds if the graph representation of the term has loops Say, The representation of a term X that obeys the equation X=[X] term has a loop from the list to its head

Succeed if the argument Term is a cyclic term

◆ term_subsumer/3

class term_subsumer/3

term_subsumer(? T1, ? T2, ? Subsumer)

Succeed if Subsumer unifies with the least general generalization over T1 and T2

◆ new_variables_in_term/3

class new_variables_in_term/3

new_variables_in_term(+_CurrentVariables_, ? Term, -_Variables_)

new_variables_in_term(+ Variables,? Term, - OutputVariables)

Unify Variables with the list of all variables of term Term that do not occur in CurrentVariables That is:

Variables = vars(Term) - CurrentVariables = The variables occur in the order of their first appearance when traversing the term depth-first, left-to-right

Unify OutputVariables with all variables occurring in Term that are not in the list Variables

◆ subsumes/2

class subsumes/2

subsumes(? Term1, ? Term2)

Succeed if Term1 subsumes Term2 Variables in term Term1 are bound so that the two terms become equal

◆ subsumes_chk/2

class subsumes_chk/2

subsumes_chk(? Term1, ? Term2)

Succeed if Term1 subsumes Term2 but does not bind any variable in Term1

◆ term_hash/4

class term_hash/4

term_hash(+ Term, + Depth, + Range, ? Hash)

Unify Hash with a positive integer calculated from the structure of the term The range of the positive integer is from 0 to, but not including, Range If Depth is -1 the whole term is considered Otherwise, the term is considered only up to depth 1, where the constants and the principal functor have depth 1, and an argument of a term with depth I has depth I+1

◆ term_hash/2

class term_hash/2

term_hash(+ Term, ? Hash)

If Term is ground unify Hash with a positive integer calculated from the structure of the term Otherwise the argument Hash is left unbound The range of the positive integer is from 0 to, but not including, 33554432

◆ unifiable/3

class unifiable/3

unifiable(? Term1, ? Term2, - Bindings)

Succeed if Term1 and Term2 are unifiable with substitution Bindings

◆ variables_within_term/3

class variables_within_term/3

variables_within_term(+ Variables,? Term, - OutputVariables)

Unify OutputVariables with the subset of the variables Variables that occurs in Term

◆ variant/2

class variant/2

variant(? Term1, ? Term2)

Succeed if Term1 and Term2 are variant terms