Sorting Terms

Two predicates, sort/2 and keysort/2 sort lists into the standard order. keysort/2 takes a list consisting of key-value pairs and sorts according to the key.

Further sorting routines are available in library(samsort).