Memory represented by a linked AVL dictionary #
A node stores its key in field zero, height in field one, and memory value in field two. The tree may retain keys with the default value. Keys absent from the tree have that default; this represents a total RAM memory without allocating a node for every possible address.
Field-two payloads represent a total memory; absent keys have the specified default.
- value (p : PosNum) (label : SearchTree.PointerMachine.Label M 2) : BinaryTree.get p tree = some label → label.data 2 = memory (label.data 0)
Every represented node contains its key's memory value.
- support (key : M.Value) : memory key ≠ zero → key ∈ SearchTree.elements (SearchTree.PointerMachine.keys tree)
All nondefault cells are represented; default cells may also have nodes.
The empty tree represents the everywhere-default memory.
An unsuccessful ordered search reads the default memory value.
A payload store retains the key and height match with the same mathematical AVL tree.
Inserting a key preserves the represented memory values at every other key, including when rotations move the new node above old nodes.
Writing a located key establishes its new memory value; values at every other key are inherited. This also covers a newly inserted node whose old payload was arbitrary.
After inserting the query key, writing a value at its node updates the represented memory at that key and leaves every other cell unchanged.