Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.Setup

Computed modulus and normalized source bank #

The native setup executes MemoryWindow.dynamicSetupBank on the actual copied-word sum. It normalizes only the fixed source register bank. Every memory word, original argument and selector register is preserved; no clean window or precomputed modulus is supplied.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.setup_fits {W b n D g p total : ℕ} (hfit : WordRAM.Fits W (b + 4 * windowSize n D g p total + 1024)) :
sourceWidth n D g p total ≤ W ∧ n + D + g + p + total + 4 ≤ windowSize n D g p total ∧ sourceWidth n D g p total < windowSize n D g p total ∧ 6166 ≤ windowSize n D g p total

The explicit physical margin covers the source width, scalar-size sum and power setup.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.exec_setup {W : ℕ} (x : WordRAM.Data 640) (hfit : WordRAM.Fits W (x.regs Reg.base + 4 * windowSize (x.regs Reg.n) (x.regs Reg.dimension) (x.regs Reg.groups) (x.regs Reg.prime) (x.regs Reg.total) + 1024)) :
have n := x.regs Reg.n; have D := x.regs Reg.dimension; have g := x.regs Reg.groups; have p := x.regs Reg.prime; have total := x.regs Reg.total; ∃ (y : WordRAM.Data 640), WordRAM.ExecWithin W setup x y (24669 * Nat.clog 2 (n + D + g + p + total + 4) + 439) ∧ y.mem = x.mem ∧ y.regs (sourceBank WordRAM.MemoryWindow.Reg.base) = x.regs Reg.base ∧ y.regs (sourceBank WordRAM.MemoryWindow.Reg.modulus) = windowSize n D g p total ∧ (∀ (i : Fin 416), WordRAM.Fits (sourceWidth n D g p total) (y.regs (sourceReg i))) ∧ ∀ (j : Fin 640), ↑j < 160 ∨ 600 ≤ ↑j ∧ ↑j < 608 → y.regs j = x.regs j

Actual computed setup at every admitted physical width. Register normalization is charged and source fits are postconditions of that code, not final caller assumptions.