Van Emde Boas initializer program and Phase 1–2 lookup-table construction #
This module defines the fixed 32-register structured initializer program initProgram for
recursive van Emde Boas trees and certifies its first two phases:
- Computing
(universeSize d, span d)byditerations of the layout recurrences (sizeLoop). - Populating the
(splitSize k, childSpan k)lookup table of2 * (d + 1)words at[base + span d, base + span d + 2 * (d + 1))(tableLoop).
Main definitions #
initProgram: the fixed 32-register structured initializer program.TableInv: the lookup-table invariant for(splitSize j, childSpan j).
Main results #
sizeLoop_spec: Phase 1 recurrence loop specification.tableLoop_spec: Phase 2 lookup-table loop specification.
References #
Structured initializer program #
Constant and recurrence-seed setup for Phase 1.
Instances For
One step of the (universeSize, span) recurrence loop.
Instances For
Phase 1 loop computing (universeSize d, span d).
Instances For
Setup for the Phase 2 (splitSize, childSpan) table construction.
Instances For
One step of the Phase 2 table-population loop.
Instances For
Phase 2 loop writing (splitSize (k + 1), childSpan (k + 1)) for k < d.
Instances For
Setup for the Phase 3 depth-first header initialization.
Instances For
Downward step of the DFS initializer: write the current node's empty header and either turn around at a leaf or initialize the cluster counter and descend into the summary.
Instances For
Upward/sibling step of the DFS initializer: ascend to the parent level and either finish
when above depth, continue ascending when all clusters are done, or decrement the remaining
cluster counter and descend into the next cluster.
Instances For
Full body of the Phase 3 DFS loop.
Instances For
Phase 3 DFS traversal loop.
Instances For
Fixed 32-register structured program initializing an empty van Emde Boas tree of depth
depth at root and placing stackBase at root + span depth.
Instances For
Phase 1: computing (universeSize d, span d) #
State after initSetup.
Instances For
State after one iteration of sizeBody at depth k.
Instances For
sizeLoop advances (q, t, high) from (universeSize k, span k, k) to
(universeSize d, span d, d) in 8 * (d - k) + 2 instructions without modifying memory.
Phase 2: populating the (splitSize, childSpan) table #
State after tableSetup.
Instances For
State after one iteration of tableBody at depth k and pointer sp₀.
Instances For
tableLoop populates the lookup table from depth k up to d in 12 * (d - k) + 2
instructions, advancing sp to base + span d + 2 * (d + 1) and preserving all memory outside
[base + span d + 2 * (k + 1), base + span d + 2 * (d + 1)).