| ||||||||||||||||||||||||||
| check the relation of two terms according to the given operation.
+Term1 == +Term2
| ||||||||||||||||||||||||||
| termtype | order |
|---|---|
| variable | have no special order |
| floating point number | arithmetical order |
| integer | arithmetical order |
| atom | character-order |
| compound term | first they are ordered by their arity. If they have same arity, they are ordered by the name of their functor. If they have same arity and functor, they are ordered by the arguments, starting at the first one. |
| Operator op | Meaning |
|---|---|
| == | Terms are identical |
| \== | Terms are not identical |
| @> | Left term greater than right term |
| @>= | Left term greater than or equal to right term |
| @< | Left term less than right term |
| @=< | Left term less than or equal to right term |
'==', '\==', '@<', '@=<', '@>', '@>=' are predefined infix-operators.
The predefined priority is 700 and they are non-associative (see current_op/3).
Term1 term Term2 term
------- == -------X=5, f(X) == f(5). Succeeds with substitution X <- 5.
X= f(A,B), X= f(g(C,D), g(C,D)), A==B). Succeeds with substitution X <- f(g(C,D), g(C,D), A <- g(C,D), B <- g(C,D).
f(X) == f(Y). Fails.
1 == 1.0 Fails.
------- \== -------
f(X) \== f(Y). Succeeds.
f(X,Y) \== f(X,a). Succeeds.
1.0e+2 \== 100. Fails.
X=a, f(X,Y) \== f(a,Y). Fails.
------- @< -------
f(a) @< f(b). Succeeds.
f(1,X) @< f(2,X). Succeeds.
'@<'(f(a,b), g(a,b)). Succeeds.
f(a,b) @< g(a). Fails.
------- @=< -------
f(a) @=< f(b). Succeeds.
12 @=< 12. Succeeds.
'@=<'(X, Y). Succeeds.
text @=< texas Fails.
------- > --------
text @> texas. Succeeds.
f(a,b) @> f(a). Succeeds.
f(a,b) @> g(a,b). Fails.
'@>'(f(Y,X), f(X,Y). Fails.
------- >= -------
text @>= text. Succeeds.
'@>='(1, 1.0). Succeeds.
f(a) @>= f(b). Fails.
These predicates are part of the ISO-Prolog Standard.
| document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/term_comp/term_comp/print_en.html published 2008/7/14 update 1998/8/7 (c) 1996-2006 IF Computer Japan | ||||||||
|
| Back> |
|