Builtin predicates - Term comparison

Predicates in this group take two terms as arguments and succeed without modification if the terms have a specified relationship. Most of the predeciates use the "term-precedes" relationship to order the two terms, which is defined as follows:

(==)/2, (!==)/2, (@<)/2, (@<=)/2, (@>)/2, (@>=)/2


(==)/2 - tests if two terms are identical.

Usage
Term1 == Term2
Description
If Term1 and Term2 are identical, then Term1 == Term2 succeeds with no modification to Term1 or Term2. Fails otherwise.
Examples
 X == X               succeeds
 X == Y               fails
 f(X,Y) == f(X,Y)     succeeds
 f(Y,X) == f(X,Y)     fails
Compatibility
Standard Prolog
See Also
(!==)/2, (@<)/2, (@<=)/2, (@>)/2, (@>=)/2

(!==)/2 - tests if two terms are not identical.

Usage
Term1 !== Term2
Term1 \== Term2
Description
If Term1 and Term2 are not identical, then Term1 !== Term2 succeeds with no modification to Term1 or Term2. Fails otherwise.
Examples
 X !== X              fails
 X !== Y              succeeds
 f(X,Y) !== f(X,Y)    fails
 f(Y,X) !== f(X,Y)    succeeds
Compatibility
The (\==)/2 predicate is from Standard Prolog. The new name (!==)/2 is the recommended spelling.
See Also
(==)/2, (@<)/2, (@<=)/2, (@>)/2, (@>=)/2

(@<)/2 - tests if the first argument term-precedes the second.

Usage
Term1 @< Term2
Description
If Term1 term-precedes Term2, then Term1 @< Term2 succeeds with no modification to Term1 or Term2. Fails otherwise.
Examples
 f(j) @< f(k)         succeeds
 f(k) @< f(j)         fails
 f(j) @< f(j)         fails
 2.0 @< 1             succeeds
Compatibility
Standard Prolog
See Also
(==)/2, (!==)/2, (@<=)/2, (@>)/2, (@>=)/2, term-precedes

(@<=)/2 - tests if the first argument is identical to or term-precedes the second.

Usage
Term1 @<= Term2
Term1 @=< Term2
Description
If Term1 is identical to or term-precedes Term2, then Term1 @<= Term2 succeeds with no modification to Term1 or Term2. Fails otherwise.
Examples
 f(j) @<= f(k)        succeeds
 f(j) @<= f(j)        succeeds
 f(k) @<= f(j)        fails
 2.0 @<= 1            succeeds
Compatibility
The (@=<)/2 predicate is from Standard Prolog. The new name (@<=)/2 is the recommended spelling.
See Also
(==)/2, (!==)/2, (@<)/2, (@>)/2, (@>=)/2, term-precedes

(@>)/2 - tests if the second argument term-precedes the first.

Usage
Term1 @> Term2
Description
If Term2 term-precedes Term1, then Term1 @> Term2 succeeds with no modification to Term1 or Term2. Fails otherwise.
Examples
 f(j) @> f(k)         fails
 f(k) @> f(j)         succeeds
 f(j) @> f(j)         fails
 2.0 @> 1             fails
Compatibility
Standard Prolog
See Also
(==)/2, (!==)/2, (@<)/2, (@<=)/2, (@>=)/2, term-precedes

(@>=)/2 - tests if the second argument is identical to or term-precedes the first.

Usage
Term1 @>= Term2
Description
If Term2 is identical to or term-precedes Term1, then Term1 @>= Term2 succeeds with no modification to Term1 or Term2. Fails otherwise.
Examples
 f(j) @>= f(k)        fails
 f(j) @>= f(j)        succeeds
 f(k) @>= f(j)        succeeds
 2.0 @>= 1            fails
Compatibility
Standard Prolog
See Also
(==)/2, (!==)/2, (@<)/2, (@<=)/2, (@>)/2, term-precedes

Generated on 26 May 2011 for plang by  doxygen 1.6.1