Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.CyclicConvolution.Coefficient

A complete native cyclic-convolution coefficient #

The actual inner loop starts its accumulator and counter at zero. Its operand and partial-sum fits follow from a numerical envelope of the original coefficient magnitudes. After all p products it performs one store and advances the coefficient counter. No partial sum, arithmetic answer, execution or running-time certificate is an argument of the program.

A natural envelope for both input coefficients, products and every partial accumulator.

The envelope bounds the first input magnitude.

The envelope bounds the second input magnitude.

theorem Cslib.Algorithms.WordRAM.CyclicConvolution.exec_coefficient {w p r A B : ℕ} (x : WordRAM.Data 32) (u v : ℕ → ℤ) (hlen : x.regs Reg.length = p) (hrow : x.regs Reg.coefficient = r) (hr : r < p) (hone : x.regs Reg.one = 1) (hbound : GenericRAM.Signed.Fits w ↑(magnitudeBound p A B)) (hu : ∀ i < p, (u i).natAbs ≤ A) (hv : ∀ i < p, (v i).natAbs ≤ B) (hA : ∀ i < p, x.mem (x.regs Reg.inputA + i) = WordRAM.Signed.encode (u i)) (hB : ∀ i < p, x.mem (x.regs Reg.inputB + i) = WordRAM.Signed.encode (v i)) (h2p : WordRAM.Fits (w + 2) (2 * p)) (ha : WordRAM.Fits (w + 2) (x.regs Reg.inputA + p)) (hb : WordRAM.Fits (w + 2) (x.regs Reg.inputB + p)) (hout : WordRAM.Fits (w + 2) (x.regs Reg.output + r)) :
∃ (y : WordRAM.Data 32), WordRAM.ExecWithin (w + 2) coefficient x y (42 * p + 7) ∧ y.regs Reg.coefficient = r + 1 ∧ y.mem = Function.update x.mem (x.regs Reg.output + r) (WordRAM.Signed.encode (CyclicIntRing.convolution p u v r)) ∧ ∀ (i : Fin 32), 9 ≤ ↑i ∧ (↑i ≤ 12 ∨ 18 ≤ ↑i) → y.regs i = x.regs i

Compute the entire coefficient from the actual signed arrays. The bound includes the initialization, every indexed product/addition, all loop control and the final store/increment. The output may alias an input for this single coefficient: the store follows every read.