Documentation

CslibFrontier.DataStructure.FusionTree.WordRAM.Query.Traversal

Checked pointer-chasing fusion-tree descent #

Each iteration reads a tag, compares a leaf or runs an actual node query, and either stops or loads a child pointer. The proof descends through the represented tree; every followed child has smaller height. No execution or correctness assumption is hidden in the invariant.

Main definitions #

Main results #

References #

A stopped traversal returns a conventional option and preserves the original RAM/query.

theorem Cslib.DataStructure.FusionTree.WordRAM.QueryProgram.exec_loop {w q p : ℕ} {t : Tree} {x : WordRAM.Data registers} (hx : Entry q p x) (ht : Tree.Valid (branching w) t) (hs : List.Pairwise (fun (x1 x2 : ℕ) => x1 < x2) t.keys) (hk : ∀ k ∈ t.keys, WordRAM.Fits w k) (hr : Rep (parameterWords w) t p x.mem) (ha : ArenaFits w p t) (hq : WordRAM.Fits w q) :
∃ (y : WordRAM.Data registers), WordRAM.ExecWithin w (loop w) x y (201022 * (t.height + 1) + 2) ∧ Done q (Tree.predecessor q t) x.mem y

Complete loop execution from real preprocessed RAM. Every iteration costs at most 201020 instructions and there are at most t.height + 1 iterations, including the final leaf visit. Loop tests and jumps are charged too. The pointer may change, while all memory and the query are preserved.