File "sets"

Variables are ordered according to their serial number, which can be retrieved by the predicate term_hash/2. The built-in compare/3 uses a bisimulaton to find the first discrepancy. Unfortunately among cyclic terms the built-in compare/3 is not a total order and can therefore not directly be used for the sorting of cyclic terms.

The following set predicates are provided:

X @< Y: [ISO 8.4.1]
The predicate succeeds when X is syntactically less than Y, otherwise fails.
X @>= Y: [ISO 8.4.1]
The predicate succeeds when X is syntactically greater or equal to Y, otherwise fails.
X @> Y: [ISO 8.4.1]
The predicate succeeds when X is syntactically greater than Y, otherwise fails.
X @=< Y: [ISO 8.4.1]
The predicate succeeds when X is syntactically less or equal to Y, otherwise fails.
compare(C, X, Y): [TC2 8.4.2]
The built-in succeeds in C with the syntactic comparison of X and Y.
sort(L, R): [TC2 8.4.3]
The predicate succeeds in R with the unstable sorted list L.
keysort(L, R): [TC2 8.4.4]
The predicate succeeds in R with the stable key sorted list L.

Use Privacy (c) 2005-2026 XLOG Technologies AG