Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Strassen.Restore

Actual parent-frame restoration after a Strassen child #

The child footprint protects the seven earlier parent words. The real fourteen-instruction load then restores all parent parameters and the saved return phase. In the final induction, the child result is established recursively for the same native controller, and these saved words come from the actual push. Neither is an additional argument to the program.

theorem Cslib.Algorithms.WordRAM.Strassen.NodeResult.parent_frame {p k a b out scratch frames frame : ℕ} {u v : ℕ → ℤ} {x y : WordRAM.Data 64} (hl : NodeLayout p (k + 1) a b out scratch frames frame) (h : NodeResult p k (scratch + 2 * (4 ^ k * p)) (scratch + 3 * (4 ^ k * p)) frames (frame + 7) u v x y) (j : Fin 7) :
y.mem (frame + ↑j) = x.mem (frame + ↑j)

Every earlier parent word is outside the child's actual write footprint.

theorem Cslib.Algorithms.WordRAM.Strassen.exec_restore_parent {w p k a b out scratch frames frame : ℕ} (phase : Fin 7) (parent child returned : WordRAM.Data 64) (u v : ℕ → ℤ) (hp : NodeHeader p (k + 1) a b out scratch frames frame parent) (hl : NodeLayout p (k + 1) a b out scratch frames frame) (hchild : NodeResult p k (scratch + 2 * (4 ^ k * p)) (scratch + 3 * (4 ^ k * p)) frames (frame + 7) u v child returned) (hwords : ∀ (j : Fin 7), child.mem (frame + ↑j) = if ↑j = 6 then ↑phase + 1 else parent.regs (field j)) (haddr : WordRAM.Fits w (addressBound frames frame (k + 1))) :
∃ (y : WordRAM.Data 64), WordRAM.ExecWithin w loadFrame returned y 14 ∧ y.mem = returned.mem ∧ NodeHeader p (k + 1) a b out scratch frames frame y ∧ y.regs Reg.phase = ↑phase + 1 ∧ (∀ (j : Fin 7), y.mem (frame + ↑j) = y.regs (field j)) ∧ ∀ (i : Fin 64), ¬LoadLocal i → y.regs i = returned.regs i

Read the real saved parent frame after the actual child return. Every parent parameter, return phase and frame-readback fact follows from the charged loads and protected words.