The control builder runs (round six, `ctlB_runs`)
ProvedJ6Seg.Slab.ctlB_runsThe control builder runs.
The following holds (Lean statement, in the scope of module Solutions.J6SegILCtl5):
theorem J6Seg.Slab.ctlB_runs (s : IState HS) (G : Fin HS → List ℤ) {n n' : ℕ} {src : ℕ → Option ℕ}
(argOf : ℕ → ℤ) (hs : J6Seg.MonoSrc n n' src) {LX L1 L2 : List ℤ}
(hX : G bX = srcTab src argOf n' ++ LX) (hN' : G bN' = (n' : ℤ) :: L1)
(hN : G bN = (n : ℤ) :: L2) {Z : ℕ} (hZ : 1 ≤ Z) (hn : zsz (n : ℤ) ≤ Z)
(hn' : zsz (n' : ℤ) ≤ Z) (ha : ∀ l < n', zsz (argOf l) ≤ Z)
(hA : G lA = []) (hC : G lC = []) (hD : G lD = []) :
IRuns I iprog ctlB (encK s G)
(encK s (update (update G rNC (((n + n' : ℕ) : ℤ) :: G rNC)) rC
(flatC (J6Seg.ctlOf n n' src argOf) ++ G rC)))
(ctlCost Z n n')
Context. B-line IL, B1 follow-up: building the control list, §5 the builder
ctlB = const bCur 0; rptX bN' entP; finB; lenB; rptX rNC (mv bT rC; mv bT rC); rptX bN' (mv bSv bX; mv bSv bX).
ctlB_runs: from any managed state G with the source table srcTab src argOf n' on top of
bX = 44, n' on bN' = 20, n on bN = 21 and empty rptX counters, for a monotone source
(MonoSrc n n' src), the builder pushes flatC (ctlOf n n' src argOf) onto rC = 45 and
n + n' (= |ctlOf …|) onto rNC = 38; every other stack is restored (the table included).
Cost ≤ (n + n' + 1) (30 cU Z + 20000) with Z ≥ 1, Z ≥ zsz n, zsz n', Z ≥ zsz (argOf l).
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_Defs65
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 cU)
open NLogN.KFT (cf3 rptX)
variable {P : ℕ} {I : List Sym} {iprog : Fin P → IStmt HS P}
theorem J6Seg.Slab.ctlB_runs (s : IState HS) (G : Fin HS → List ℤ) {n n' : ℕ} {src : ℕ → Option ℕ}
(argOf : ℕ → ℤ) (hs : J6Seg.MonoSrc n n' src) {LX L1 L2 : List ℤ}
(hX : G bX = srcTab src argOf n' ++ LX) (hN' : G bN' = (n' : ℤ) :: L1)
(hN : G bN = (n : ℤ) :: L2) {Z : ℕ} (hZ : 1 ≤ Z) (hn : zsz (n : ℤ) ≤ Z)
(hn' : zsz (n' : ℤ) ≤ Z) (ha : ∀ l < n', zsz (argOf l) ≤ Z)
(hA : G lA = []) (hC : G lC = []) (hD : G lD = []) :
IRuns I iprog ctlB (encK s G)
(encK s (update (update G rNC (((n + n' : ℕ) : ℤ) :: G rNC)) rC
(flatC (J6Seg.ctlOf n n' src argOf) ++ G rC)))
(ctlCost Z n n') := by sorry