Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Constructor

Caller-safe shared geometry and compact value construction #

The actual geometry and tile code compose on arbitrary caller data. Both original leaf arrays lie before the caller's directory pointer; they may otherwise overlap. Scratch contents need not be zero. Directory ranks, catalogue cardinality and every signed table word are computed from the original scalar parameters and input words, with a complete outside-allocation frame. Shared setup and per-tile work remain separately charged.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.exec_constructor {w L m t D AA BB A B : ℕ} (x : WordRAM.Data registers) (a b : MatrixMultiplication.Schonhage.Leaf L → ℤ) (ha : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (a τ).natAbs ≤ A) (hb : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (b τ).natAbs ≤ B) (hL : x.regs Reg.levels = L) (hm : x.regs Reg.inner = m) (ht : x.regs Reg.threshold = t) (hD : x.regs Reg.directory = D) (hAA : x.regs Reg.arrayA = AA) (hBB : x.regs Reg.arrayB = BB) (hAD : AA + 10 ^ L ≤ D) (hBD : BB + 10 ^ L ≤ D) (hleft : ∀ (c : Fin (10 ^ L)), x.mem (AA + ↑c) = WordRAM.Signed.encode (a (leafAt c))) (hright : ∀ (c : Fin (10 ^ L)), x.mem (BB + ↑c) = WordRAM.Signed.encode (b (leafAt c))) (haddr : WordRAM.Fits (w + 2) (100 * (D + AA + BB + L + m + t + (m - t + 1) * 10 ^ L + 10))) (hmag : GenericRAM.Signed.Fits w ↑(A + B + 10 ^ L * (A * B))) :
∃ (y : WordRAM.Data registers), WordRAM.ExecWithin (w + 2) (geometry.seq tile) x y (geometryTime L m t + 328 * (MatrixMultiplication.Schonhage.boxes L m t).card + 8) ∧ y.regs Reg.levels = L ∧ y.regs Reg.inner = m ∧ y.regs Reg.threshold = t ∧ y.regs Reg.height = m - t ∧ y.regs Reg.span = 10 ^ L ∧ y.regs Reg.directory = D ∧ y.regs Reg.records = D + (m - t + 1) * 10 ^ L ∧ y.regs Reg.values = D + (m - t + 1) * 10 ^ L + 3 * (MatrixMultiplication.Schonhage.boxes L m t).card ∧ y.regs Reg.count = (MatrixMultiplication.Schonhage.boxes L m t).card ∧ y.regs Reg.arrayA = AA ∧ y.regs Reg.arrayB = BB ∧ (∀ s < (m - t + 1) * 10 ^ L, y.mem (D + s) = directoryWord L (m - t) s) ∧ (∀ s < (m - t + 1) * 10 ^ L, Eligible L (m - t) s → y.mem (D + (m - t + 1) * 10 ^ L + 3 * (MatrixMultiplication.Schonhage.boxes L m t).card + Nat.count (Eligible L (m - t)) s) = WordRAM.Signed.encode (slotValue a b s)) ∧ ∀ (q : ℕ), ¬(D ≤ q ∧ q < D + (m - t + 1) * 10 ^ L + 4 * (MatrixMultiplication.Schonhage.boxes L m t).card) → y.mem q = x.mem q

Complete actual caller construction, with no assumed catalogue or table geometry.