Native Strassen clearing and stack returns #
These internal execution lemmas reuse the existing zeroFill_exec implementation. The
clearing footprint is one current output matrix, never a whole caller catalogue or window.
theorem Cslib.Algorithms.WordRAM.Strassen.exec_clear {w : ℕ} (x : WordRAM.Data 64) (h0 : x.regs Reg.zero = 0) (h1 : x.regs Reg.one = 1) (hw : WordRAM.Fits w (x.regs Reg.output + x.regs Reg.size)) :
∃ (y : WordRAM.Data 64),
WordRAM.ExecWithin w clear x y (4 * x.regs Reg.size + 4) ∧ y.mem = WordRAM.clear x.mem (x.regs Reg.output) (x.regs Reg.size) ∧ ∀ (i : Fin 64), i ≠ Reg.address → i ≠ Reg.index → y.regs i = x.regs i
Clear the actual current output, deriving its end pointer and charging every store. Only the two cursor registers change.
theorem Cslib.Algorithms.WordRAM.Strassen.exec_pop {w : ℕ} (x : WordRAM.Data 64) (h7 : x.regs Reg.frameWidth = 7) (hw : WordRAM.Fits w (x.regs Reg.frame)) :
∃ (y : WordRAM.Data 64),
WordRAM.ExecWithin w pop x y 3 ∧ y.mem = x.mem ∧ (y.regs Reg.frame = if x.regs Reg.frames < x.regs Reg.frame then x.regs Reg.frame - 7 else x.regs Reg.frame) ∧ (y.regs Reg.active = if x.regs Reg.frames < x.regs Reg.frame then x.regs Reg.active else 0) ∧ ∀ (i : Fin 64), i ≠ Reg.frame → i ≠ Reg.active → y.regs i = x.regs i
Return to the parent or finish the root in three instructions. The subtraction is charged, and its fit follows from the actual frame pointer.