Complete native original-weight interval verification #
Every interval vertex is tested by actual charged code. The returned flag characterizes existence of an original zero sum, and a successful run returns an original-coordinate witness. Arguments and all memory are preserved. The magnitude and address bounds here are numerical component premises; the producer/product consumer derives them from its original input.
theorem Cslib.Algorithms.WordRAM.ExactTriangle.WitnessScan.exec {w U : ℕ} (A : Args) (AB BC AC : ℕ → ℕ → ℤ) (x : WordRAM.Data 32) (hx : A.InRegisters x) (ha : A.a < A.n) (hb : A.b < A.n) (hc : A.first + A.length ≤ A.n) (hmem :
∀ i < A.n,
∀ j < A.n,
x.mem (A.ab + (i * A.n + j)) = WordRAM.Signed.encode (AB i j) ∧ x.mem (A.bc + (i * A.n + j)) = WordRAM.Signed.encode (BC i j) ∧ x.mem (A.ac + (i * A.n + j)) = WordRAM.Signed.encode (AC i j)) (hmag : ∀ i < A.n, ∀ j < A.n, (AB i j).natAbs ≤ U ∧ (BC i j).natAbs ≤ U ∧ (AC i j).natAbs ≤ U) (hU : GenericRAM.Signed.Fits w ↑(2 * U)) (hfit : WordRAM.Fits (w + 2) A.addressBound) :
∃ (y : WordRAM.Data 32),
WordRAM.ExecWithin (w + 2) program x y (42 * A.length + 17) ∧ A.InRegisters y ∧ y.mem = x.mem ∧ (y.regs Reg.found = 0 ∨ y.regs Reg.found = 1) ∧ (y.regs Reg.found = 1 ↔ ∃ (c : ℕ), A.first ≤ c ∧ c < A.first + A.length ∧ AB A.a A.b + BC A.b c + AC A.a c = 0) ∧ (y.regs Reg.found = 1 →
A.first ≤ y.regs Reg.witness ∧ y.regs Reg.witness < A.first + A.length ∧ AB A.a A.b + BC A.b (y.regs Reg.witness) + AC A.a (y.regs Reg.witness) = 0)
Read and verify the original signed arrays, preserving the argument bank and all memory. The bound excludes only a final halt. The success flag is raw unsigned 0/1; the witness is an original vertex, not a middle-label or modular candidate.