Standard Order of Terms

These predicates use a standard total order when comparing terms. The standard total order is:

     
     variables @< database references @< numbers @< atoms @< compound terms
     

(Interpret @< as "comes before".)

Within these categories, ordering is as follows.

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

     [ X, '$ref'(123456,12), -9, 1, 1.0, fie, foe, fum, [1],
          X = Y, fie(0,2), fie(1,1) ]
     

The predicates for comparison of terms are described below.


T1 == T2
T1 and T2 are literally identical (in particular, variables in equivalent positions in the two terms must be identical).
T1 \== T2
T1 and T2 are not literally identical.
T1 @< T2
T1 is before term T2 in the standard order.
T1 @> T2
T1 is after term T2
T1 @=< T2
T1 is not after term T2
T1 @>= T2
T1 is not before term T2
compare(Op, T1, T2)
the result of comparing terms T1 and T2 is Op, where the possible values for Op are:

=
if T1 is identical to T2,
<
if T1 is before T2 in the standard order,
>
if T1 is after T2 in the standard order.