Standard Order of Terms

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

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

[ X, -1.0, -9, 1, fie, foe, X = Y, foe(0,2), fie(1,1,1) ]

Please note: the standard order is only well-defined for finite (acyclic) terms. There are infinite (cyclic) terms for which no order relation holds. Furthermore, blocking goals (see ref-sem-sec) on variables or modifying their attributes (see lib-atts) does not preserve their order.

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.

Send feedback on this subject.