Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.Leaf

Actual native query addends #

Low-order leaves read two canonical signed array words and multiply them. Threshold leaves compute the real directory key and read its stored value. Both paths add that word to the actual signed accumulator using the existing unsigned arithmetic code. Memory is unchanged; the caller supplies readback, not an execution or time contract.

Registers changed while reading and adding one complete query leaf.

Instances For
    theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.exec_boxAddend {w D V T c e r : ℕ} {a : ℤ} (x : WordRAM.Data registers) (hD : x.regs BoxTable.Reg.directory = D) (hV : x.regs BoxTable.Reg.values = V) (hT : x.regs BoxTable.Reg.span = T) (hc : x.regs Reg.code = c) (he : x.regs Reg.stars = e) (h1 : x.regs BoxTable.Reg.one = 1) (hrank : x.mem (D + (e * T + c)) = r + 1) (hvalue : x.mem (V + r) = WordRAM.Signed.encode a) (hfit : WordRAM.Fits w (D + V + e * T + c + r + 10)) :

    The threshold addend is an actual offset-one directory lookup and stored signed load.

    Canonical signed addition and delivery preserve all memory and every nonlocal register.

    theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.exec_leaf {w D V AA BB T c e d t r : ℕ} {a b v z : ℤ} (x : WordRAM.Data registers) (ha : GenericRAM.Signed.Fits w a) (hb : GenericRAM.Signed.Fits w b) (hab : GenericRAM.Signed.Fits w (a * b)) (hv : GenericRAM.Signed.Fits w v) (hz : GenericRAM.Signed.Fits w z) (hD : x.regs BoxTable.Reg.directory = D) (hV : x.regs BoxTable.Reg.values = V) (hAA : x.regs BoxTable.Reg.arrayA = AA) (hBB : x.regs BoxTable.Reg.arrayB = BB) (hT : x.regs BoxTable.Reg.span = T) (hc : x.regs Reg.code = c) (he : x.regs Reg.stars = e) (hd : x.regs Reg.used = d) (ht : x.regs BoxTable.Reg.threshold = t) (h1 : x.regs BoxTable.Reg.one = 1) (hacc : x.regs Reg.answer = WordRAM.Signed.encode z) (hlow : d < t → x.mem (AA + c) = WordRAM.Signed.encode a ∧ x.mem (BB + c) = WordRAM.Signed.encode b) (hhigh : ¬d < t → x.mem (D + (e * T + c)) = r + 1 ∧ x.mem (V + r) = WordRAM.Signed.encode v) (hfit : WordRAM.Fits (w + 2) (D + V + AA + BB + e * T + c + r + 10)) :
    ∃ (y : WordRAM.Data registers), WordRAM.ExecWithin (w + 2) leaf x y 39 ∧ y.regs Reg.answer = WordRAM.Signed.encode (z + if d < t then a * b else v) ∧ y.mem = x.mem ∧ ∀ (i : Fin registers), ¬LeafLocal i → y.regs i = x.regs i

    The complete actual leaf branch charges direct products or stored-box lookup and addition.