Documentation

CslibFrontier.Algorithms.WordRAM.ThreeSum.Decision.VisitorForest

Complete native frontend forest with in-place node consumption #

Each actual iteration loads the next native frontend descriptor, executes its complete root visitor and increments the real descriptor index. Root-local allocation ceilings preserve space for every later root. Solver work is charged once for each actual mathematical node, including its order and multiplicity; skipped native descriptors carry traversal charges only.

Main results #

theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.execute_next_root {r κ n w U : ℕ} {a : ChanHe.Traversal.Arena} {l : Frontend.Layout} {input : List ℤ} {rs : List (ℕ × ℕ)} {s : ForestCursor} {x : WordRAM.Data (registerCount r)} (c : Host.Callee r) (hw : width κ c.widthCoefficient n ≤ w + 2) (ha : a.Separated) (hresources : a.ceiling ≤ (n + 2) ^ envelopeExponent κ ∧ 4 * a.N < (n + 2) ^ envelopeExponent κ ∧ 60 * a.U + 40 ≤ (n + 2) ^ envelopeExponent κ) (hready : a.Ready w) (h : ForestCursor.Invariant a w κ n l U rs s x) (hc : (WordRAM.Cond.lt (preprocessingRegisters r ChanHe.Preprocessing.current) (preprocessingRegisters r ChanHe.Preprocessing.roots)).Holds x) (hn : a.n = l.n + 1) (hU : a.U = 2 * U) (hfront : l.endpoint ≤ a.stack) (hkeys : ∀ (k : ℕ), k ∈ List.map Prod.fst rs ↔ k ∈ List.map WordRAM.Signed.encode input) (hnd : (List.map Prod.fst rs).Nodup) (hcard : rs.length ≤ l.n) (hvalues : ∀ z ∈ input, |z| ≤ ↑U) :

Execute the next actual frontend descriptor within its own root allocation allowance.

theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.forest_body_exec {r κ n w U : ℕ} {a : ChanHe.Traversal.Arena} {l : Frontend.Layout} {input : List ℤ} {rs : List (ℕ × ℕ)} {s : ForestCursor} {x : WordRAM.Data (registerCount r)} (c : Host.Callee r) (hw : width κ c.widthCoefficient n ≤ w + 2) (ha : a.Separated) (hresources : a.ceiling ≤ (n + 2) ^ envelopeExponent κ ∧ 4 * a.N < (n + 2) ^ envelopeExponent κ ∧ 60 * a.U + 40 ≤ (n + 2) ^ envelopeExponent κ) (hready : a.Ready w) (h : ForestCursor.Invariant a w κ n l U rs s x) (hc : (WordRAM.Cond.lt (preprocessingRegisters r ChanHe.Preprocessing.current) (preprocessingRegisters r ChanHe.Preprocessing.roots)).Holds x) (hn : a.n = l.n + 1) (hU : a.U = 2 * U) (hf : a.fuel = ThreeSum.ChanHe.fuel l.n) (hfront : l.endpoint ≤ a.stack) (hkeys : ∀ (k : ℕ), k ∈ List.map Prod.fst rs ↔ k ∈ List.map WordRAM.Signed.encode input) (hnd : (List.map Prod.fst rs).Nodup) (hcard : rs.length ≤ l.n) (hvalues : ∀ z ∈ input, |z| ≤ ↑U) :

A real descriptor load, complete root visit and index increment preserve every later root's allocation allowance. The remaining exact node count pays only actual solver calls.

theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.forest_exec {r κ n w U : ℕ} {a : ChanHe.Traversal.Arena} {l : Frontend.Layout} {input : List ℤ} {rs : List (ℕ × ℕ)} {s : ForestCursor} {x : WordRAM.Data (registerCount r)} (c : Host.Callee r) (hw : width κ c.widthCoefficient n ≤ w + 2) (ha : a.Separated) (hresources : a.ceiling ≤ (n + 2) ^ envelopeExponent κ ∧ 4 * a.N < (n + 2) ^ envelopeExponent κ ∧ 60 * a.U + 40 ≤ (n + 2) ^ envelopeExponent κ) (hready : a.Ready w) (h : ForestCursor.Invariant a w κ n l U rs s x) (hn : a.n = l.n + 1) (hU : a.U = 2 * U) (hf : a.fuel = ThreeSum.ChanHe.fuel l.n) (hfront : l.endpoint ≤ a.stack) (hkeys : ∀ (k : ℕ), k ∈ List.map Prod.fst rs ↔ k ∈ List.map WordRAM.Signed.encode input) (hnd : (List.map Prod.fst rs).Nodup) (hcard : rs.length ≤ l.n) (hvalues : ∀ z ∈ input, |z| ≤ ↑U) :

Execute the entire actual descriptor loop with exact mathematical output and Boolean fold. The final loop test and every native descriptor increment are included in the charge.