Compares the second and third arguments.
- If second is greater than third then attempts to unify first argument with
>
- If second is less than third then attempts to unify first argument with
<
- If second is equal to third then attempts to unify first argument with
=
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