Moving the collected output onto stack `0` (`outLoop_runs`)
ProvedJ6Seg.Slab.outLoop_runsMoving the collected output onto stack 0.
The following holds (Lean statement, in the scope of module Solutions.J6SegILSlab4):
theorem J6Seg.Slab.outLoop_runs (s : IState HS) (G : Fin HS → List ℤ) (hA : G lA = []) (hC : G lC = [])
(hD : G lD = []) (C CU OP ARG : List ℤ) (o : List ℤ) {LT : List ℤ}
(hT : G rTOT = (o.length : ℤ) :: LT) {Bo : ℕ} (hBo : ∀ y ∈ o, zsz y ≤ Bo) :
IRuns I iprog (rptX rTOT lA lC lD (.op (.mv rACC 0)))
(encK s (skS G C CU OP ARG o.reverse))
(encK s (skS (update G 0 (o ++ G 0)) C CU OP ARG []))
((o.length + 1) * (2 * moveCost Bo + 19 + 3000))
Context. B-line IL, B1 (streaming slab pass) §4: the whole pass (generic lanes)
passP = rptX rNB blockP; rptX rTOT (mv rACC 0): the blocks, then the output (collected
reversed on rACC) is moved onto stack 0. pass_runs: from the lane state with the input
xs (pre blocks of n slabs of m units) the output passOut … ++ G 0 lands on stack 0; all
skeleton registers are restored (rACC empty again). passOut_eq: for the control list
ctlOf n n' src argOf of a monotone source, passOut is slabPass (block form).
Formalization Note. Part of the Lean formalization of the round-six κ-improvement (integer-multiplication-kappa campaign, target IntMul.Kappa.jain_round6_framework). The statement is copied verbatim from the Lean development; the platform node carries the same declaration name. Definitions it mentions live in the IntMul_Kappa_R6_Defs* bundles (on top of the published κ bundles IntMul_Kappa_K_Defs*).
-- Round-six κ development (integer-multiplication-kappa), generated by skeleton subtraction.
import Definitions.Def_IntMul_Kappa_R6_Defs64
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000
open J6Seg J6Seg.Slab
set_option maxRecDepth 20000
open IntMul NLogN NLogN.KIL Function
open NLogN.KFUU (lA lC lD)
open NLogN.KFT (cf3 rptX)
variable {U : Type*} {P : ℕ} {I : List Sym} {iprog : Fin P → IStmt HS P}
{lin : List U → List U → (Fin HS → List ℤ) → (Fin HS → List ℤ)} {OkU : U → Prop}
{OkA : ℤ → Prop} {KG : (Fin HS → List ℤ) → Prop} {g : ℤ → U → ℤ} {dr rd it bk : IStmt HS P}
{cdr crd cit cbk : ℕ}
theorem J6Seg.Slab.outLoop_runs (s : IState HS) (G : Fin HS → List ℤ) (hA : G lA = []) (hC : G lC = [])
(hD : G lD = []) (C CU OP ARG : List ℤ) (o : List ℤ) {LT : List ℤ}
(hT : G rTOT = (o.length : ℤ) :: LT) {Bo : ℕ} (hBo : ∀ y ∈ o, zsz y ≤ Bo) :
IRuns I iprog (rptX rTOT lA lC lD (.op (.mv rACC 0)))
(encK s (skS G C CU OP ARG o.reverse))
(encK s (skS (update G 0 (o ++ G 0)) C CU OP ARG []))
((o.length + 1) * (2 * moveCost Bo + 19 + 3000)) := by sorry