This module provides predicates for implementing dictionaries. Such dictionaries are currently implemented as ordered binary trees of key-value pairs.
Usage:dictionary(D)
D is a dictionary.
Usage:dictionary(D,K,V,L,R)
The dictionary node D has key K, value V, left child L, and right child R.
Usage:dic_node(D,N)
N is a sub-dictionary of D.
Usage:dic_lookup(D,K,V)
D contains value V at key K. If it was not already in D it is added.
Usage:dic_lookup(D,K,V,O)
Same as dic_lookup(D,K,V). O indicates if it was already in D (old) or not (new).
Usage:dic_get(D,K,V)
D contains value V at key K. Fails if it is not already in D.
Usage:dic_replace(D,K,V,D1)
D and D1 are identical except for the element at key K, which in D1 contains value V, whatever has (or whether it is) in D.
old_or_new(old). old_or_new(new).
Usage:non_empty_dictionary(D)
D is a non-empty dictionary.