Native van Emde Boas membership descent #
The proof state records only the registers required by membership; all other registers and all memory outside the represented tree may be arbitrary. Queries need not belong to the tree universe. The maximum guard is checked before any cluster address is calculated.
Main definitions #
MemberEntry: the membership-loop register invariant.
Main results #
memberLoop_spec: membership takes at most28 * (d + 1) + 2loop instructions, gives the functional answer and preserves all memory.
References #
structure Cslib.DataStructure.VanEmdeBoas.WordRAM.MemberEntry (base query : ℕ) (s : WordRAM.Data 32) :
The constant, traversal and result registers at entry to an unfinished lookup.
theorem Cslib.DataStructure.VanEmdeBoas.WordRAM.memberLoop_spec {d w base query : ℕ} {tree : Tree d} {s : WordRAM.Data 32} (hs : MemberEntry base query s) (ht : tree.Valid) (hr : Rep tree base s.mem) (ha : WordRAM.Fits w (base + span d)) :
The membership loop is correct for every depth and arbitrary surrounding memory. Its bound charges each body, loop test and jump; setup, dispatch and halt are separate.