Sorts a list.
merge_sort/2 sorts the elements of UnsortList
and unifies that new list with SortList.
The order is given by the order of the terms in MINERVA.
Unlike sort/2 merge_sort/2 does not remove duplicate
elements.
UnsortList list SortList list
| sort([a,d,c,a],X). | Succeeds with substitution X <- [a,a,c,d]. |
This predicate is not part of the ISO-Prolog Standard.
| scroll to top |
|