Finite AVL keys for the word-RAM input convention #
The source input occupies address zero (the length) and addresses one through the input length. This construction supplies a valid AVL tree containing precisely that finite interval.
A valid AVL key tree for the first n addresses, built by the existing insertion algorithm.
The canonical input key tree has correct heights, ordering and balance.
Exactly the first n addresses occur in the canonical input key tree.
Store each AVL node's key, cached height, and memory value in fields zero, one, and two.
Canonical initial dictionary: preorder-labelled input cells, including the length cell.
Encode a word-RAM input as a linked AVL heap, with zeroed scalar registers and the root
in pointer register one. As with WordRAM.Data.init, input encoding is outside execution cost.
The explicitly encoded input satisfies the complete compiler representation invariant.
Every pointer in the encoded input names an allocated node.