object
two3tree
2-3 tree implementation.
logtalk_load(dictionaries(loader))static, context_switching_callsPublic predicates
union/3
Computes the union of two dictionaries. If a key appears in both, the value from the larger dictionary is kept.
staticunion(Tree1,Tree2,Union)union(+two3tree,+two3tree,-two3tree) - zero_or_oneProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
union_impl/3
Inserts all key-value pairs of the smaller tree into the larger tree to compute the union.
staticunion_impl(+two3tree,+two3tree,-two3tree) - zero_or_oneunion_impl_list/3
Inserts a list of key-value pairs into a dictionary one by one.
staticunion_impl_list(+list(pair),+two3tree,-two3tree) - zero_or_oneclone_impl/3
Recursively clones a tree, leaving all values unbound and collecting the pairs of the clone.
staticclone_impl(+two3tree,-two3tree,-list(pair)) - oneclone_impl2/4
Recursively clones a tree, returning both the original pairs and the clone pairs.
staticclone_impl2(+two3tree,-two3tree,-list(pair),-list(pair)) - onehandle_root_underflow/2
After a deletion, if the root has become a 2-node with a single child, replace it by that child; otherwise keep the root.
statichandle_root_underflow(+term,-term) - onedelete_impl/5
Recursive deletion that returns the resulting tree and a flag indicating whether an underflow has occurred at the current node.
staticdelete_impl(+term,+term,?term,-term,-boolean) - zero_or_onefix_node2_left_underflow/6
Repairs an underflow after a deletion in the left subtree of a node2.
staticfix_node2_left_underflow(+term,+term,+term,+term,-term,-boolean) - onefix_node2_right_underflow/6
Repairs an underflow after a deletion in the right subtree of a node2.
staticfix_node2_right_underflow(+term,+term,+term,+term,-term,-boolean) - onefix_node3_left_underflow/9
Repairs an underflow after a deletion in the left subtree of a node3.
staticfix_node3_left_underflow(+term,+term,+term,+term,+term,+term,+term,-term,-boolean) - onefix_node3_middle_underflow/9
Repairs an underflow after a deletion in the middle subtree of a node3.
staticfix_node3_middle_underflow(+term,+term,+term,+term,+term,+term,+term,-term,-boolean) - onefix_node3_right_underflow/9
Repairs an underflow after a deletion in the right subtree of a node3.
staticfix_node3_right_underflow(+term,+term,+term,+term,+term,+term,+term,-term,-boolean) - oneas_curly_bracketed_impl/2
Builds a curly-bracketed term from a list of key-value pairs.
staticas_curly_bracketed_impl(+list(pairs),-term) - oneas_curly_bracketed_impl/3
Helper that accumulates a comma-separated list inside curly braces.
staticas_curly_bracketed_impl(+list(pairs),+pair,-term) - oneinsert_impl/4
Recursive insertion that may return a node4 on the way up.
staticinsert_impl(+term,+term,+term,-term) - oneinsert_empty/4
Inserts into an empty tree.
staticinsert_empty(+empty,+term,+term,-term) - oneinsert_node2_2/4
Inserts a key-value pair into a leaf 2-node, creating a leaf 3-node.
staticinsert_node2_2(+term,+term,+term,-term) - oneinsert_node2_4/4
Inserts into a non-leaf 2-node, possibly splitting a child 4-node.
staticinsert_node2_4(+term,+term,+term,-term) - oneinsert_node3_4/4
Inserts a key-value pair into a leaf 3-node, creating a leaf 4-node.
staticinsert_node3_4(+term,+term,+term,-term) - oneinsert_node3_7/4
Inserts into a non-leaf 3-node, possibly splitting a child 4-node.
staticinsert_node3_7(+term,+term,+term,-term) - oneintersection_impl/4
Computes the intersection of a list of key-value pairs with a tree, inserting common pairs into an accumulator.
staticintersection_impl(+list(pair),+two3tree,+list(pair),-list(pair)) - zero_or_oneis_node4/1
True if the term is a 4-node (temporary representation).
staticis_node4(+term) - zero_or_onemap_impl/2
Traverses the tree and applies a closure to each key-value pair.
staticmap_impl(*,1)map_impl(+two3tree,@callable) - zero_or_moremap_impl/3
Traverses the tree, applies a closure to each key-value pair, and builds a new tree with the results.
staticmap_impl(*,2,*)map_impl(+two3tree,@callable,-two3tree) - zero_or_morenext_impl/5
Recursively finds the next key-value pair after a given key.
staticnext_impl(+two3tree,+key,-key,-value,+term) - zero_or_oneprevious_impl/5
Recursively finds the previous key-value pair before a given key.
staticprevious_impl(+two3tree,+key,-key,-value,+term) - zero_or_onenode2_from_node4/2
Converts a 4-node (temporary) into a balanced 2-node with two 2-node children.
staticnode2_from_node4(+term,-term) - oneupdate_impl/3
Updates a dictionary with a list of key-value pairs sequentially.
staticupdate_impl(@list(pair),+two3tree,-two3tree) - zero_or_onecollect/4
In-order traversal accumulating selected projections of nodes.
staticcollect(Tree,Selector,Accumulator,ReversedResult)collect(+two3tree,+selector,+list(term),-list(term)) - oneselect/4
Projects a key-value pair according to the selector.
staticselect(Selector,Key,Value,Element)select(+selector,+key,+value,-term) - oneOperators
(none)
See also