Jan Burse, erstellt 15. Sep 2018
* The predicate sys_distinct/1 will remove duplicates from a list
* using a hash set in the current implementation, thus relying only
* on equality among the elements. On the other hand the predicate
* sort/2 will sort a list by using a tree in the current implementation
* and also requires comparison among the elements.
* ?- sys_distinct([2,1,3,1], X).
* X = [2,1,3]
* ?- sort([2,1,3,1], X).
* X = [1,2,3]
* The predicate sys_keygroup/2 will key group a list using a hash
* table in the current implementation, thus relying only on equality
* among the keys. On the other hand the predicate keysort/2 will key
* sort a list by using a tree in the current implementation, thus also
* requiring comparison among the keys.
* ?- hash_code(f, R).
* R = 102
* ?- term_hash(f(X), 1, 1000, R).
* R = 102
* The hash code that is the basis for the removal and grouping predicates
* can be queried by the predicates hash_code/2. The hash code is
* recursively computed along the structure of the given term. The
* hash code that forms the basis of our clause indexing can be
* queried by the predicates term_hash/[2,4].
* Warranty & Liability
* To the extent permitted by applicable law and unless explicitly
* otherwise agreed upon, XLOG Technologies GmbH makes no warranties
* regarding the provided information. XLOG Technologies GmbH assumes
* no liability that any problems might be solved with the information
* provided by XLOG Technologies GmbH.
* Rights & License
* All industrial property rights regarding the information - copyright
* and patent rights in particular - are the sole property of XLOG
* Technologies GmbH. If the company was not the originator of some
* excerpts, XLOG Technologies GmbH has at least obtained the right to
* reproduce, change and translate the information.
* Reproduction is restricted to the whole unaltered document. Reproduction
* of the information is only allowed for non-commercial uses. Selling,
* giving away or letting of the execution of the library is prohibited.
* The library can be distributed as part of your applications and libraries
* for execution provided this comment remains unchanged.
* Only to be distributed with programs that add significant and primary
* functionality to the library. Not to be distributed with additional
* software intended to replace any components of the library.
* Jekejeke is a registered trademark of XLOG Technologies GmbH.
* sort(L, R): [TC2 8.4.3]
* The predicate sorts the list L and unifies the result with R.
% sort(+List, -List)
* sys_distinct(L, R):
* The predicate distincts the list L and unifies the result with R.
% sys_distinct(+List, -List)
sys_distinct/2, 'SpecialSort', 1).
* keysort(L, R): [TC2 8.4.4]
* The predicate key-sorts the pair list L and unifies the result with R.
% keysort(+Pairs, -Pairs)
* sys_keygroup(L, R):
* The predicate key-groups the pair list L and unifies the result with R.
% sys_keygroup(+Pairs, -Pairs)
sys_keygroup/2, 'SpecialSort', 3).
* hash_code(T, H):
* The predicate succeeds when H unifies with the hash code of T.
* The term T need not be ground. The hash will be in the range
* from -2147483648 to 2147483647.
% hash_code(+Term, -Integer)
* sys_ground(T, D):
* The predicate succeeds when T is ground up to depth D.
* sys_hash_code(T, D, H):
* The predicate succeeds in H with hash code of T up to depth D.
* The term T need not be ground up to depth D. The hash will be
* in the range from -2147483648 to 2147483647.
sys_hash_code/3, 'SpecialSort', 6).
* locale_sort(L, R):
* locale_sort(C, L, R):
* The predicate local sorts the list L and unifies the result with R.
* The ternary predicate allows specifying a locale C.
% locale_sort(+List, -List)
% locale_sort(+Atom, +List, -List)
* locale_keysort(L, R):
* locale_keysort(C, L, R):
* The predicate locale key-sorts the pair list L and unifies the result
* with R. The ternary predicate allows specifying a locale C.
% locale_keysort(+Pairs, -Pairs)
% locale_keysort(+Atom, +Pairs, -Pairs)
locale_keysort/3, 'SpecialSort', 8).