Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Product.Transfer

Protected original-input and coordinate transfers #

Main results #

These internal execution interfaces derive copy separation and arithmetic fits from the original numerical parameters. Their memory conclusions describe the actual executed state.

Original input, its protected copy and the coordinate adaptation all fit the allocation.

Any allocated endpoint fits without assumptions about intermediate machine states.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.QueriedProduct.exec_setupCopy {w L m N Q s d n : ℕ} {setup : WordRAM.Code WordRAM.Basis.standard 160} (x : WordRAM.Data 160) (hp : Parameters L m N Q x) (hfit : WordRAM.Fits w (wordBudget L m N Q)) (hsetup : WordRAM.ExecWithin w setup x (((x.set Reg.source s).set Reg.destination d).set Reg.length n) 3) (hs : s + n ≤ memoryEnd L m N Q + 16) (hd : d + n ≤ memoryEnd L m N Q + 16) (hsep : s + n ≤ d ∨ d + n ≤ s ∨ s = d) :
∃ (y : WordRAM.Data 160), WordRAM.ExecWithin w (setup.seq copyCall) x y (7 * n + 10) ∧ Parameters L m N Q y ∧ y.mem = WordRAM.ArrayCopy.copyPrefix x.mem s d n ∧ ∀ (i : Fin 160), 7 ≤ ↑i → i ≠ Reg.source → i ≠ Reg.destination → i ≠ Reg.length → y.regs i = x.regs i

Three charged argument instructions that leave source s, destination d and length n in the copy registers, followed by the native copy. The caller protocol and every register beyond the copy routine other than the three arguments are preserved; the fits and the separation of the two ranges are numerical layout obligations.

The actual input snapshot uses three argument instructions and the native copy loop.

Real coordinate words are copied from the protected original input to address five. The caller's original prefix remains protected in its snapshot for final restoration.

Restore the entire original prefix through the same actual copy routine. Answers and all memory outside the prefix remain unchanged.