Contiguous static fusion-tree records #
Every record has an 18-word header. Leaves store tag 0, presence, and key (zero when
absent), followed by fifteen zero words. Internal nodes have tag 1, followed by exactly
n interleaved pairs of full child minima and absolute child pointers, and the recursively
encoded children in order. No capacity-sized arrays are allocated. The header indices are:
tag 0, child count 1, minimum 2, compression
mask C 3, multiplier digits 4--6, D 7, copies 8, packed complements 9, packed normal 10,
guards 11, bits 12, middle 13, radix 14, maximum 15, width-dependent global offset 16,
and reserved 17. Parameters supplies indices 3--17; it asserts no node-search oracle.
This is a static representation, with explicit arena/address and stored-word fit contracts. It asserts neither preprocessing time nor a query running time.
Main definitions #
span,encode: allocation length and concrete list of RAM words.Rep: actual memory realizes that list usingWordRAM.Block.Realizes.ArenaFits,ContentFits: separate address/frontier and stored-content contracts.
Main results #
encode_length: the concrete list has precisely the claimed allocation length.Rep.node_header,Rep.child: literal loads and recursive child representations.child_span_le,access_owned,child_access_owned: allocation safety.decode_encode: the concrete memory round-trips through a load-based decoder.span_build_le: at most126n + 18allocated words, uniformly in branching capacity.encoding_exists: a fitting concrete memory, decoder and linear allocation bound together.
References #
The fifteen preprocessing words in header slots 3 through 17, for each internal node. The final two slots accommodate a width-dependent global offset and one reserved word.
Instances For
Fixed record header length, independent of branching capacity.
Instances For
Stable offsets within internal headers. The fifteen parameter words are named here so node-search implementations can use the layout without duplicating numerical indices.
Record tag: 0 for leaves, 1 for internal nodes.
Instances For
Number of actual children (presence for a leaf).
Instances For
Cached minimum (the key for a leaf).
Instances For
Compression mask C.
Instances For
First multiplier digit.
Instances For
Second multiplier digit.
Instances For
Third multiplier digit.
Instances For
Packed complement sketches.
Instances For
Packed ordinary sketches.
Instances For
Packed field guards.
Instances For
Middle-field constant.
Instances For
Maximum compressed payload.
Instances For
Width-dependent global offset.
Instances For
Reserved preprocessing word.
Instances For
Actual allocated words, without any padding to the maximum branching capacity.
Instances For
Starting address of child i, after the parent's actual tables and earlier children.
Instances For
The concrete internal header.
Instances For
Stride-two child table: a full minimum followed by its absolute pointer.
Instances For
Serialize a tree at its absolute address. Invalid nonsingleton leaves are truncated;
decode_encode requires Tree.Valid, which excludes them.
Instances For
Serialize consecutive child records; the next record starts at the previous one's end.
Instances For
Every serialized tree occupies exactly its claimed span.
The concrete child-record list has the sum of the child spans as its length.
Memory represents the concrete serialized tree, with arbitrary memory outside its block.
Instances For
The existing heap assertion for the serialized arena, including exactly its allocated cells.
Instances For
The heap assertion's contents are exactly the representation predicate.
The heap footprint counts actual allocated words, including each fixed header.
Writes disjoint from the contiguous arena preserve the complete tree representation.
A concrete total memory obtained by placing the serialized words into an otherwise zero RAM.
Instances For
The explicit list encoding has an actual RAM realization.
A represented internal node exposes its header, minima, pointers and child-record interval.
The first three internal header words and all fifteen preprocessing words decode literally.
The three leaf words decode as tag, presence and key.
Following a stored child pointer gives the representation of precisely that child.
Every record is nonempty, including the empty leaf.
A whole child allocation lies inside its parent's allocation.
Every direct header/table read is an owned parent word. Tables use their actual lengths.
Each of the eighteen header loads lies inside the record, including for empty leaves.
Both stride-two table loads are inside the parent's allocation.
Every word read inside a child record is owned by the parent allocation. Repeated use provides the same guarantee at arbitrary descendant depth.
The concrete allocation is at most nine times the structural scalar-slot count.
Uniform linear allocated RAM words, with constants independent of branching capacity and word width. This counts the actual serialized words, including all preprocessing headers.
Recover the functional tree by loads of tags, fields and absolute child pointers. Fuel bounds recursive depth, not the number of machine instructions. The zero-fuel result is a default; correctness requires fuel strictly larger than the tree height.
Instances For
Concrete RAM decoding recovers every valid tree. In particular, empty and singleton leaves remain distinct even when the stored key is zero.
The explicit serializer and total RAM realization round-trip through the load-based decoder.
Every owned address and the one-past-end allocation frontier fit a word. This strict
frontier condition also suffices for the existing WordRAM.alloc execution contract.
Instances For
A numerical sufficient arena contract, using only input length and the allocation base. It bounds the entire one-past-end frontier, rather than only the input key values.
Allocation size, base address and tag one all fit under the arena contract. Together
with the fitting frontier, these are the numerical inputs to WordRAM.alloc_exec.
Explicit key and preprocessing-word assumptions. Child counts and addresses are instead
bounded by ArenaFits; fitting input keys alone does not imply either contract.
Instances For
Cached child minima fit whenever all explicit tree contents fit.
The fit assumption for the arena bounds every owned access address.
The child's whole allocation also fits; in particular following its pointer cannot wrap.
Every serialized data word fits under explicit content and arena assumptions.
The concrete memory consists entirely of fitting words, including its zero exterior.
A fitting contiguous encoding exists for every built tree whose explicit address and content assumptions hold. The decoder uses depth fuel; no preprocessing-time claim is made.