Next: Finding all Solutions to
Up: Built-in predicates
Previous: Set Manipulation
  Contents
  Index
- sort2+List, -Sorted
Succeeds if Sorted can be unified with a list holding the
elements of List, sorted to the standard order of terms (see
compare). Duplicates are removed. Implemented by translating
the input list into a temporary array, calling the C-library function
qsort3 using PL_compare for comparing the elements,
after which the result is translated into the result list.
msort2+List, -Sorted
Equivalent to sort2, but does not remove duplicates.
keysort2+List, -Sorted
List is a list of Key-Value pairs (e.g. terms
of the functor `' with arity 2). keysort2 sorts List
like msort2, but only compares the keys. Can be used to sort terms not
on standard order, but on any criterion that can be expressed on a
multi-dimensional scale. Sorting on more than one criterion can be done
using terms as keys, putting the first criterion as argument 1, the
second as argument 2, etc. The order of multiple elements that have the
same Key is not changed.
predsort3+Pred, +List, -Sorted
Sorts similar to sort2, but determines the order of two terms by
calling Pred(-Delta, +E1, +E2). This
call must unify Delta with one of , const or
. If built-in predicate compare3 is used, the result is
the same as sort2. See also keysort2.2.11
Next: Finding all Solutions to
Up: Built-in predicates
Previous: Set Manipulation
  Contents
  Index
Dr. Richard Botting
2001-12-12