Go to the first, previous, next, last section, table of contents.


Comparing terms

Author(s): Daniel Cabeza, Manuel Hermenegildo.

Version: 1.10#6 (2004/8/7, 21:46:39 CEST)

Version of last change: 1.9#199 (2003/12/19, 18:18:33 CET)

These built-in predicates are extra-logical. They treat uninstantiated variables as objects with values which may be compared, and they never instantiate those variables. They should not be used when what you really want is arithmetic comparison or unification.

The predicates make reference to a standard total ordering of terms, which is as follows:

For example, here is a list of terms in standard order:

[ X, -1.0, -9, 1, bar, foo, [1], X = Y, foo(0,2), bar(1,1,1) ]

Usage and interface (term_compare)

Documentation on exports (term_compare)

PROPERTY: ==/2:

Usage: Term1 == Term2

PROPERTY: \==/2:

Usage: Term1 \== Term2

PROPERTY: @</2:

Usage: @<(Term1, Term2)

PROPERTY: @=</2:

Usage: @=<(Term1, Term2)

PROPERTY: @>/2:

Usage: @>(Term1, Term2)

PROPERTY: @>=/2:

Usage: @>=(Term1, Term2)

PREDICATE: compare/3:

compare(Op, Term1, Term2)

Op is the result of comparing the terms Term1 and Term2.

Usage: compare(?atm, @term, @term)


Go to the first, previous, next, last section, table of contents.