[ Comparing and Sorting | Reference Manual | Alphabetic Index ]
?Term1 == ?Term2
Succeeds if Term1 and Term2 are identical terms.
- Term1
- An arbitrary term.
- Term2
- An arbitrary term.
Description
Used to compare Term1 with Term2. Succeeds if Term1 and Term2 are
identical terms. It does not attempt unification. Two variables are
considered as identical only if one is bound to the other, or if they
are both bound to identical terms. Ground terms are identical only if
they unify.
Modes and Determinism
Fail Conditions
Fails if Term1 and Term2 are not identical.
Examples
Success:
atom == atom.
1 == 1.
X == X. (gives X = _g70)
X = 1, Y = 1, Y == X. (gives X = 1, Y = 1)
X = Y, X == Y, Y == X. (gives Y = _g80, X = _g80)
[ a,b| [ ] ] == [ a,b ].
f(1,2) == f(1,2).
Fail:
atom == neutron.
atom == X.
1 == 1.0.
X == Y.
[a|b] == [a,b].
[a|X] == [a,X].
See Also
\== / 2, = / 2