Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.Push

Native computation of query-prefix children #

The real scalar programs calculate each child descriptor from the popped prefix. All arithmetic fits follow from the original prefix, power and small alphabet bound; there is no child-layout or execution certificate in these interfaces.

Registers changed while computing one child descriptor.

Instances For

    Compute one indexed child's fields within five native instructions.

    P0 extends the initial star count precisely before any indexed inner term was chosen.

    The private term at an outer coordinate leaves both inner counters unchanged.

    Registers modified by actual output-digit decoding and child-depth/power setup.

    Instances For

      Decode the real next output digit with native division/remainder, then prepare the child.

      Registers changed by descriptor computation and actual indexed-child stores.

      Instances For

        The actual consecutive stores of a fixed indexed-child dispatch.

        theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.exec_indexedChildren {w F n k c u e p cp : ℕ} (ds : List (Fin 9)) (x : WordRAM.Data registers) (hF : x.regs Reg.stack = F) (hn : x.regs Reg.top = n) (hk : x.regs Reg.depth = k) (hc : x.regs Reg.code = c) (hu : x.regs Reg.used = u) (he : x.regs Reg.stars = e) (hp : x.regs Reg.power = p) (hcp : x.regs Reg.childPower = cp) (h5 : x.regs Reg.five = 5) (h1 : x.regs BoxTable.Reg.one = 1) (hfit : WordRAM.Fits w (F + 5 * (n + ds.length + 1) + c + 9 * p + u + e + 32)) :
        ∃ (y : WordRAM.Data registers), WordRAM.ExecWithin w (indexedChildren ds) x y (17 * ds.length + 1) ∧ y.regs Reg.top = n + ds.length ∧ y.mem = writeIndexedChildren F k c u e p cp n ds x.mem ∧ ∀ (i : Fin registers), ¬IndexedPushLocal i → y.regs i = x.regs i

        The fixed finite dispatch charges seventeen instructions per indexed child and one exit copy.

        theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.exec_nineChildren {w F n k c u e p cp : ℕ} (x : WordRAM.Data registers) (hF : x.regs Reg.stack = F) (hn : x.regs Reg.top = n) (hk : x.regs Reg.depth = k) (hc : x.regs Reg.code = c) (hu : x.regs Reg.used = u) (he : x.regs Reg.stars = e) (hp : x.regs Reg.power = p) (hcp : x.regs Reg.childPower = cp) (h5 : x.regs Reg.five = 5) (h1 : x.regs BoxTable.Reg.one = 1) (hfit : WordRAM.Fits w (F + 5 * (n + 10) + c + 9 * p + u + e + 32)) :
        ∃ (y : WordRAM.Data registers), WordRAM.ExecWithin w nineChildren x y 154 ∧ y.regs Reg.top = n + 9 ∧ y.mem = writeIndexedChildren F k c u e p cp n (List.ofFn fun (i : Fin 9) => ⟨8 - ↑i, ⋯⟩) x.mem ∧ ∀ (i : Fin registers), ¬IndexedPushLocal i → y.regs i = x.regs i

        The actual nine indexed children require at most 154 native instructions.

        theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.writeIndexedChildren_frame (F k c u e p cp n : ℕ) (ds : List (Fin 9)) (μ : ℕ → ℕ) (q : ℕ) (hq : ¬(F + n * 5 ≤ q ∧ q < F + (n + ds.length) * 5)) :
        writeIndexedChildren F k c u e p cp n ds μ q = μ q

        Consecutive child stores preserve every word outside their actual written interval.

        theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.writeIndexedChildren_read (F k c u e p cp n : ℕ) (ds : List (Fin 9)) (μ : ℕ → ℕ) {j : ℕ} (hj : j < ds.length) :
        have ν := writeIndexedChildren F k c u e p cp n ds μ; have a := F + (n + j) * 5; ν a = k ∧ ν (a + 1) = c + ↑ds[j] * p ∧ ν (a + 2) = u + 1 ∧ ν (a + 3) = e ∧ ν (a + 4) = cp

        Each indexed task is read back at its actual consecutive stack position, in push order.

        theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.exec_p0Child {w F n k c u e p cp : ℕ} (x : WordRAM.Data registers) (hF : x.regs Reg.stack = F) (hn : x.regs Reg.top = n) (hk : x.regs Reg.depth = k) (hc : x.regs Reg.code = c) (hu : x.regs Reg.used = u) (he : x.regs Reg.stars = e) (hp : x.regs Reg.power = p) (hcp : x.regs Reg.childPower = cp) (h5 : x.regs Reg.five = 5) (h1 : x.regs BoxTable.Reg.one = 1) (h9 : x.regs BoxTable.Reg.nine = 9) (h0 : x.regs BoxTable.Reg.nil = 0) (hfit : WordRAM.Fits w (F + 5 * (n + 1) + c + 9 * p + u + e + 32)) :
        ∃ (y : WordRAM.Data registers), WordRAM.ExecWithin w p0Child x y 18 ∧ y.regs Reg.top = n + 1 ∧ y.mem = writeTask F n k (c + 9 * p) u (if u = 0 then e + 1 else e) cp x.mem ∧ ∀ (i : Fin registers), ¬IndexedPushLocal i → y.regs i = x.regs i

        The complete P0 child stores its computed descriptor, with no old-memory premise.

        theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.exec_privateChild {w F n k c u e p cp d : ℕ} (x : WordRAM.Data registers) (hd : d ≤ 9) (hF : x.regs Reg.stack = F) (hn : x.regs Reg.top = n) (hk : x.regs Reg.depth = k) (hc : x.regs Reg.code = c) (hu : x.regs Reg.used = u) (he : x.regs Reg.stars = e) (hp : x.regs Reg.power = p) (hcp : x.regs Reg.childPower = cp) (hdigit : x.regs Reg.digit = d) (h5 : x.regs Reg.five = 5) (h1 : x.regs BoxTable.Reg.one = 1) (hfit : WordRAM.Fits w (F + 5 * (n + 1) + c + 9 * p + u + e + 32)) :
        ∃ (y : WordRAM.Data registers), WordRAM.ExecWithin w privateChild x y 16 ∧ y.regs Reg.top = n + 1 ∧ y.mem = writeTask F n k (c + d * p) u e cp x.mem ∧ ∀ (i : Fin registers), ¬IndexedPushLocal i → y.regs i = x.regs i

        The sole private child at an outer coordinate is computed and stored in sixteen steps.