Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.Tile

Complete native compact box-value table #

The native e-major loop writes one signed value per computed catalogue record. Its children have smaller actual compact ranks, so no value-table clearing or assumed table construction is used. Original encoding-array bounds cover all signed partials.

Registers that may change while constructing one tile's compact values.

Instances For
    theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.exec_tileValue {w L H D V AA BB A B s : ℕ} (x : WordRAM.Data registers) (a b : MatrixMultiplication.Schonhage.Leaf L → ℤ) (hv : Eligible L H s) (ha : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (a τ).natAbs ≤ A) (hb : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (b τ).natAbs ≤ B) (hD : x.regs Reg.directory = D) (hV : x.regs Reg.values = V) (hAA : x.regs Reg.arrayA = AA) (hBB : x.regs Reg.arrayB = BB) (hc : x.regs Reg.completion = recordCode L s) (he : x.regs Reg.stars = recordStars L s) (hT : x.regs Reg.span = 10 ^ L) (hp : x.regs Reg.starPower = recordStride L s) (h0 : x.regs Reg.nil = 0) (h9 : x.regs Reg.nine = 9) (h1 : x.regs Reg.one = 1) (h10 : x.regs Reg.ten = 10) (hleft : x.mem (AA + recordCode L s) = WordRAM.Signed.encode (a (completionAt L s))) (hright : x.mem (BB + recordCode L s) = WordRAM.Signed.encode (b (completionAt L s))) (hrank : 0 < recordStars L s → ∀ (d : Fin 10), x.mem (D + childSlot L s d) = Nat.count (Eligible L H) (childSlot L s d) + 1) (hvalue : 0 < recordStars L s → ∀ (d : Fin 10), x.mem (V + Nat.count (Eligible L H) (childSlot L s d)) = WordRAM.Signed.encode (slotValue a b (childSlot L s d))) (hfit : WordRAM.Fits (w + 2) (D + V + AA + BB + 20 * ((H + 1) * 10 ^ L) + 20 * 10 ^ L + 30)) (hsigned : GenericRAM.Signed.Fits w ↑(A + B + 10 ^ L * (A * B))) :

    Evaluate one actual descriptor using the stored earlier children or two actual leaf words.

    theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.exec_tileStep {w L H D R V AA BB A B s : ℕ} (x : WordRAM.Data registers) (a b : MatrixMultiplication.Schonhage.Leaf L → ℤ) (hv : Eligible L H s) (hs : s < (H + 1) * 10 ^ L) (ha : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (a τ).natAbs ≤ A) (hb : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (b τ).natAbs ≤ B) (hx : CatalogueParameters L H D R x) (hV : x.regs Reg.values = V) (hAA : x.regs Reg.arrayA = AA) (hBB : x.regs Reg.arrayB = BB) (hj : x.regs Reg.current = Nat.count (Eligible L H) s) (hcode : x.mem (R + 3 * Nat.count (Eligible L H) s) = recordCode L s) (hstars : x.mem (R + 3 * Nat.count (Eligible L H) s + 1) = recordStars L s) (hstride : x.mem (R + 3 * Nat.count (Eligible L H) s + 2) = recordStride L s) (hleft : x.mem (AA + recordCode L s) = WordRAM.Signed.encode (a (completionAt L s))) (hright : x.mem (BB + recordCode L s) = WordRAM.Signed.encode (b (completionAt L s))) (hrank : 0 < recordStars L s → ∀ (d : Fin 10), x.mem (D + childSlot L s d) = Nat.count (Eligible L H) (childSlot L s d) + 1) (hvalue : 0 < recordStars L s → ∀ (d : Fin 10), x.mem (V + Nat.count (Eligible L H) (childSlot L s d)) = WordRAM.Signed.encode (slotValue a b (childSlot L s d))) (hfit : WordRAM.Fits (w + 2) (D + R + V + AA + BB + 20 * ((H + 1) * 10 ^ L) + 20 * 10 ^ L + 30)) (hsigned : GenericRAM.Signed.Fits w ↑(A + B + 10 ^ L * (A * B))) :

    Load, evaluate and store one compact record with all native control and address work.

    theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.exec_tileLoop {w L H D R V 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) (hx : CatalogueParameters L H D R x) (hV : x.regs Reg.values = V) (hAA : x.regs Reg.arrayA = AA) (hBB : x.regs Reg.arrayB = BB) (hcount : x.regs Reg.count = Nat.count (Eligible L H) ((H + 1) * 10 ^ L)) (hcurrent : x.regs Reg.current = 0) (hcat : CataloguePrefix L H D R ((H + 1) * 10 ^ L) μ x.mem) (hDR : D + (H + 1) * 10 ^ L ≤ R) (hRV : R + 3 * Nat.count (Eligible L H) ((H + 1) * 10 ^ L) ≤ V) (hAV : AA + 10 ^ L ≤ V) (hBV : BB + 10 ^ L ≤ V) (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))) (hfit : WordRAM.Fits (w + 2) (D + R + V + AA + BB + 20 * ((H + 1) * 10 ^ L) + 20 * 10 ^ L + 30)) (hsigned : GenericRAM.Signed.Fits w ↑(A + B + 10 ^ L * (A * B))) :
    ∃ (y : WordRAM.Data registers), WordRAM.ExecWithin (w + 2) (WordRAM.Code.loop (WordRAM.Cond.lt Reg.current Reg.count) tileStep) x y (328 * Nat.count (Eligible L H) ((H + 1) * 10 ^ L) + 2) ∧ (∀ s < (H + 1) * 10 ^ L, Eligible L H s → y.mem (V + Nat.count (Eligible L H) s) = WordRAM.Signed.encode (slotValue a b s)) ∧ ∀ (q : ℕ), ¬(V ≤ q ∧ q < V + Nat.count (Eligible L H) ((H + 1) * 10 ^ L)) → y.mem q = x.mem q

    The native compact loop computes every eligible slot, preserving the catalogue and inputs.

    theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxTable.exec_tile {w L H D R V 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) (hx : CatalogueParameters L H D R x) (hV : x.regs Reg.values = V) (hAA : x.regs Reg.arrayA = AA) (hBB : x.regs Reg.arrayB = BB) (hcount : x.regs Reg.count = Nat.count (Eligible L H) ((H + 1) * 10 ^ L)) (hcat : CataloguePrefix L H D R ((H + 1) * 10 ^ L) μ x.mem) (hDR : D + (H + 1) * 10 ^ L ≤ R) (hRV : R + 3 * Nat.count (Eligible L H) ((H + 1) * 10 ^ L) ≤ V) (hAV : AA + 10 ^ L ≤ V) (hBV : BB + 10 ^ L ≤ V) (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))) (hfit : WordRAM.Fits (w + 2) (D + R + V + AA + BB + 20 * ((H + 1) * 10 ^ L) + 20 * 10 ^ L + 30)) (hsigned : GenericRAM.Signed.Fits w ↑(A + B + 10 ^ L * (A * B))) :
    ∃ (y : WordRAM.Data registers), WordRAM.ExecWithin (w + 2) tile x y (328 * Nat.count (Eligible L H) ((H + 1) * 10 ^ L) + 8) ∧ (∀ s < (H + 1) * 10 ^ L, Eligible L H s → y.mem (V + Nat.count (Eligible L H) s) = WordRAM.Signed.encode (slotValue a b s)) ∧ (∀ (q : ℕ), ¬(V ≤ q ∧ q < V + Nat.count (Eligible L H) ((H + 1) * 10 ^ L)) → y.mem q = x.mem q) ∧ ∀ (i : Fin registers), ¬TileLocal i → y.regs i = x.regs i

    Complete one-tile execution, including actual constant/counter setup, with no dirty-memory restriction. The catalogue and both input arrays lie below the value-table base.