Native van Emde Boas strict-successor certification #
This module certifies the native strict-successor operation (successorDescent followed by
successorUnwind) in Complexity.Algorithms.WordRAM.VanEmdeBoas.Program.
During descent, each recursive cluster or summary call pushes a four-word continuation frame
(kind, payload, q, t) into the scratch stack [stackBase₀, stackBase₀ + 4 * d).
Because Tree.successor checks the cached maximum before recursing, every recursive descent is
guaranteed to find a key (found = 1), and successorUnwind pops the pushed frames to
reconstruct the universe key in out while restoring sp = stackBase₀.
Main definitions #
SuccessorEntry: register invariant at entry tosuccessorDescent.successorDescentNext: mathematical description of onesuccessorDescentBodyiteration.UnwindState: register and memory invariant duringsuccessorUnwind.successorUnwindNext: mathematical description of onesuccessorUnwindBodyiteration.
Main results #
successorDescentBody_exec: one descent iteration executes in at most 42 instructions.successorUnwindBody_cluster_exec,successorUnwindBody_summary_exec: one unwind iteration executes in at most 19 instructions.successor_loop_spec:successorDescent; successorUnwindexecutes in at most65 * (d + 1) + 4instructions, computestree.successor query, restoressp = stackBase₀, preservesRep tree base z.mem, and leaves all memory outside[stackBase₀, stackBase₀ + 4 * d)unchanged.
References #
The constant, stack, and traversal registers at entry to successorDescent.
Instances For
Effect of pushing a four-word continuation frame (k, pay, qv, tv) at sp₀.
Instances For
Mathematical description of one successorDescentBody iteration.
Instances For
Constant and stackBase registers are preserved by successorDescentNext.
Pushing a four-word frame modifies memory only in [sp₀, sp₀ + 4).
One native successor-descent iteration executes in at most 42 instructions.
Register and memory invariant at the start of an unwind stage at stack pointer sp₀.
Instances For
Mathematical description of one successorUnwindBody iteration popping at sp₀.
Instances For
Invariant registers and memory preserved across successorUnwindNext.
One cluster-return unwind step (kind = 0) executes in at most 19 instructions.
One summary-return unwind step (kind = 1) executes in at most 19 instructions.
Combined inductive certification of successorDescent and CPS successorUnwind whenever
tree.successor query = some ans.
When tree.successor query = none, successorDescent terminates in one iteration (46
instructions) with found = 0, out = 0, sp = sp₀, and unchanged memory.
Complete certification of successorDescent; successorUnwind from sp = stackBase₀:
executes in at most 65 * (d + 1) + 4 instructions, computes tree.successor query,
restores sp = stackBase₀, preserves Rep tree base z.mem, and frames memory outside
[stackBase₀, stackBase₀ + 4 * d).