Expand description
List-sorting builtins: msort/2, sort/2.
Ported byte-for-byte from patch-prolog v1 (solver.rs MSort/Sort
arms). Both sort by the standard order of terms (compare_terms):
msort/2is a stable sort that KEEPS duplicates.sort/2sorts and then removes adjacentEqualduplicates.
The first argument must be a proper list; otherwise v1 raises a
type_error(list, Culprit) (oracle-verified). The result is built on
the heap.
Functionsยง
- plg_
rt_ b_ msort_ 2 msort/2: stable sort by standard order, duplicates kept.- plg_
rt_ b_ sort_ 2 sort/2: sort by standard order then drop adjacentEqualdups.