Concrete fusion-tree RAM predecessor endpoint #
At each physical word width, one standard-basis program with 1024 registers traverses any represented preprocessed tree. Its code depends only on width, with a uniform code-size bound. Query, record base, keys and all node parameters are runtime data. The query returns an inclusive predecessor as presence in register 32 and a full key in register 33; key zero is distinct from absence. The flat program halts with register 33, and the proved final state also exposes register 32.
For a sorted distinct list of n fitting full keys, initialization, traversal, all node
calls, pointer loads, loop overhead and halt together take at most
3100000 * (Nat.log w n + 1) instructions for every w ≥ 2. The concrete representation
uses at most 126n + 18 words, including empty roots. The arena's one-past-end frontier
must fit a word separately from the keys and query. No RAM preprocessing-time bound is
claimed; preprocessing is a classical static construction.
Main definitions #
QueryProgram.initial: actual preprocessed memory and query/base input registers.
Main results #
QueryProgram.exec: complete structured query from arbitrary workspace registers.QueryProgram.exec_build: the uniform word-logarithmic bound for constructed trees.QueryProgram.query_spec: concrete bounded memory, linear allocation, final flag/value observation and flat-program halt, with all instructions charged.QueryProgram.answer_some_iff,QueryProgram.answer_none_iff: conventional predecessor semantics, including empty inputs and equality with stored keys.
References #
The compiled family has a uniform finite size bound, including its final halt.
Complete structured query, including installation of every persistent constant. Only the query and initial pointer need to be supplied in registers.
The constructed tree has a uniform word-logarithmic query bound. One instruction is reserved for the flat program's halt. All node and representation premises are discharged from the sorted full keys and actual preprocessing, with no node oracle.
Concrete preprocessed RAM, with only query and record base in the register file. All other registers initially hold zero. This is static construction, not a RAM instruction.
Instances For
The actual initial register and memory words fit under the explicit query/key/arena bounds.
Full concrete endpoint. The final-state observation exposes the presence flag as well
as the halted value. The bound includes the halt; memory and query are preserved exactly.
Allocation is O(n+1) for all inputs and O(n) for nonempty inputs.
Returned full keys are exactly the inclusive predecessors of the stored set.
Absence is exactly the case where every stored key is greater than the query.