projog

3.21. compare(X,Y,Z) - compares arguments.

Compares the second and third arguments.

Examples

?- compare(X, a, z).
X = <

yes

?- compare(X, a, a).
X = =

yes

?- compare(X, z, a).
X = >

yes

?- compare(<, z, a).

no

?- compare(>, z, a).

yes

All floating point numbers are less than all integers

?- compare(X, 1.0, 1).
X = <

yes

?- compare(X, a, Y).
X = >
Y = UNINSTANTIATED VARIABLE

yes

?- compare(=, X, Y).

no

?- X=Y, compare(=, X, Y).
X = UNINSTANTIATED VARIABLE
Y = UNINSTANTIATED VARIABLE

yes