[ library(m_tree234) | Reference Manual | Alphabetic Index ]

upper_bound_search(+Tree, ++SearchKey, ?Key, ?Value)

Search a tree for the largest key no larger than SearchKey.
Tree
A 2-3-4 tree
SearchKey
A key to search for
Key
The key found
Value
The value corresponding to Key

Description

This predicate searches the tree Tree for the entry with the largest key which is no larger than SearchKey. If such a key is found, then it attempts to unify it with Key and the corresponding value with Value.

This predicate should only be called with trees created by other predicates from the tree234 module.

Fail Conditions

Fails if there are no keys at least as large as SearchKey in Tree or if Key and Value do not unify with the key and value found.

Resatisfiable

no

See Also

lower_bound_search / 4, lower_bound_lookup / 4, upper_bound_lookup / 4