This module implements maps using bounded balanced binary trees. It is adapted from set_bbbtree, which itself is adapted from the Mercury version. The original of that version is available from http://www.cs.mu.oz.au/research/mercury/. That implementation is based on `Functional Pearls: Efficient sets -a balancing act' by Stephen Adams, J. Functional Programming 3 (4): 553-561, Oct 1993.
A map is a set of key/value pairs, such that each key is associated with at most one value. Keys are required to be ground. The typical operations on maps such as lookup the value of a given key are O(log n) where n is the number of pairs in the map. A potentially more efficient implementation of maps is provided by the fsa_hash, fsa_m_hash and fsa_u_hash modules.
This section lists the predicates defined by this module.
Initializes Bbbtree as an empty map.
Bbbtree is an empty map.
Size is the number of pairs in map Bbbtree.
Val is the value associated with Key in the map Bbbtree. This predicate fails if Key is not a key of Bbbtree.
Key is the least key in Bbbtree (using the standard order ordering of terms). Its value is Val.
Key is the largest key in Bbbtree (using the standard order ordering of terms). Its value is Val.
Bbbtree is the same map as Bbbtree0, except that Key is now associated with Val.
Bbbtree is the same map as Bbbtree0, except that each of the key-value pairs in KeyValList are in Bbbtree.
Bbbtree is the result of removing Key and its associated value from Bbbtree0. Succeeds if Key was not a key of Bbbtree0 (cf map_bbbtree__remove).
Bbbtree is the result of deleting all keys Keys with associated values from Bbbtree0. These keys are not required to exist in Bbbtree0 (cf map_bbbtree__remove_list).
Bbbtree is the result of removing Key and its associated value from Bbbtree0. Fails if Key was not a key of Bbbtree0 (cf map_bbbtree__delete).
Bbbtree is the result of removing all keys Keys with associated values from Bbbtree0. These keys are required to exist in Bbbtree0 (cf map_bbbtree__delete_list).
Key is the least key in Bbbtree0 (using standard ordering of terms). Its value is Value. Bbbtree is the same map as Bbbtree0 except that Key is removed.
Key is the largest key in Bbbtree0 (using standard ordering of terms). Its value is Value. Bbbtree is the same map as Bbbtree0 except that Key is removed.
Bbbtree is the map for the key-value pairs given as a list in KeyValList.
SortedKeyValueList is a sorted list of key value pairs; Bbbtree is the corresponding map.
SortedKeyValueList is a sorted list of key value pairs; Bbbtree is the corresponding map. Len is the lenth of the list.
SortedKeyValList is a sorted list of the key-value pairs in the map Bbbtree.