Comparison and unification of arbitrary terms. Terms are ordered in the so called ``standard order''. This order is defined as follows:
2.3
2.4
If the prolog_flag (see current_prolog_flag2) iso is defined, all floating point numbers precede all integers.
I.e. the first creates a cyclic-term, which is printed as an infinitly nested f1 term (see the max_depth option of write_term2). The second executes logically sound unification and thus fails. +Term1+Term2 Equivalent to Term1 = Term2. +Term1+Term2 Succeeds if Term1 is `structurally equal' to Term2. Structural equivalence is weaker than equivalence (2), but stronger than unification (2). Two terms are structurally equal if their tree representation is identical and they have the same `pattern' of variables. Examples:
+Term1+Term2 Equivalent to `Term1 =@= Term2'. +Term1+Term2 Succeeds if Term1 is before Term2 in the standard order of terms. +Term1+Term2 Succeeds if both terms are equal (2) or Term1 is before Term2 in the standard order of terms. +Term1+Term2 Succeeds if Term1 is after Term2 in the standard order of terms. +Term1+Term2 Succeeds if both terms are equal (2) or Term1 is after Term2 in the standard order of terms. compare3?Order, +Term1, +Term2 Determine or test the Order between two terms in the standard order of terms. Order is one of , or , with the obvious meaning.
a =@= A false A =@= B true x(A,A) =@= x(B,C) false x(A,A) =@= x(B,B) true x(A,B) =@= x(C,D) true