Documentation

CslibFrontier.Algorithms.WordRAM.ThreeSum.Decision.VisitorLoop

The complete charged in-place Chan–He worklist loop #

The native loop executes every pending descriptor, including empty and zero-fuel entries. Traversal work is paid on every descriptor; solver work is paid only for an actual node. Exhausting the actual stack gives the complete ordered Boolean fold, without a stored catalogue.

theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.transition {r κ n w : ℕ} {target : List ThreeSum.ChanHe.Node} {a : ChanHe.Traversal.Arena} (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) (h2 : WordRAM.Fits (w + 2) 2) (hcap : WordRAM.Fits (w + 2) (a.stack + a.capacity)) (s : Cursor) (x : WordRAM.Data (registerCount r)) (h : Cursor.Invariant a w κ n target s x) (hc : (WordRAM.Cond.lt (preprocessingRegisters r ChanHe.Traversal.zero) (preprocessingRegisters r (ChanHe.Traversal.registers ChanHe.Traversal.WordStack.len))).Holds x) :
have T := Host.callerTime (4 * a.N) (c.time (Host.sideLength (4 * a.N)) (2 * (n + 2) ^ envelopeExponent κ + 1)) + 8; ∃ (s' : Cursor) (y : WordRAM.Data (registerCount r)) (t : ℕ), WordRAM.ExecWithin (w + 2) (body c.code) x y t ∧ Cursor.Invariant a w κ n target s' y ∧ t + 2 + s'.credit a T ≤ s.credit a T

Every reached loop header admits an actual transition paid by the remaining native work and exact number of mathematical nodes still awaiting a solver call.

theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.loop_exec {r κ n w : ℕ} {target : List ThreeSum.ChanHe.Node} {a : ChanHe.Traversal.Arena} (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) (h2 : WordRAM.Fits (w + 2) 2) (hcap : WordRAM.Fits (w + 2) (a.stack + a.capacity)) (s : Cursor) (x : WordRAM.Data (registerCount r)) (h : Cursor.Invariant a w κ n target s x) :

Execute the complete actual native loop and consume its exact target preorder. The charge includes the final test and every live or skipped iteration's loop control.