The branch of one command, on the state after the two pops (`branch_runs`)
ProvedJ6Seg.Slab.branch_runsThe branch of one command, on the state after the two pops.
The following holds (Lean statement, in the scope of module Solutions.J6SegILSlab3):
theorem J6Seg.Slab.branch_runs (H : UnitsOK (I := I) (iprog := iprog) lin OkU OkA KG g dr rd it bk cdr crd cit cbk)
(s : IState HS) (G : Fin HS → List ℤ) (hK : ∀ C CU OP ARG ACC, KG (skS G C CU OP ARG ACC)) (hA : G lA = []) (hC : G lC = []) (hD : G lD = [])
{m : ℕ} {LM : List ℤ} (hM : G rM = (m : ℤ) :: LM) (op a : ℤ) (C CU OP ARG ACC : List ℤ)
(inp tmp : List U) (hlen : op ≠ 0 → m ≤ inp.length) (hok : ∀ u ∈ inp, OkU u)
(ha : 0 < op → OkA a) :
IRuns I iprog
(.ite rOP (fun c => c == .neg) (rptX rM lA lC lD dr)
(.ite rOP (fun c => c == .zero) (rptX rM lA lC lD (.op (.const rACC 0))) (emitP rd it bk)))
(encK s (lin inp tmp (skS G C CU (op :: OP) (a :: ARG) ACC)))
(encK s (lin (if op < 0 then inp.drop m else inp) tmp
(skS G C CU (op :: OP) (a :: ARG) ((runC m g [(op, a)] inp).reverse ++ ACC))))
(50 + (m + 1) * (cdr + crd + cit + cbk + 12002))
Context. B-line IL, B1 (streaming slab pass) §3: one command, the command loop, one block
The skeleton contents are kept in the form skS G C CU OP ARG ACC (control rC, used
commands rCU, current op rOP, current argument rARG, output rACC, over G).
cmdP: pop(op, arg)fromrCtorOP,rARG; branch on the sign ofop: drop a slab (op < 0), emitmzeros (op = 0), emit the slab mapped byg arg, reading the units to the temps and moving them back (op > 0); pushop,argtorCU.cmd_runs.cmdLoop:rptX rNC cmdP— the whole command list;cmdLoop_runs: the output isrunC m g cs inp(reversed ontorACC), the input losesnDrop csslabs.restLoop:rptX rNC (mv rCU rC; mv rCU rC)restores the control list.restLoop_runs.blockP = cmdLoop; restLoop:block_runs.
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}
variable {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.branch_runs (H : UnitsOK (I := I) (iprog := iprog) lin OkU OkA KG g dr rd it bk cdr crd cit cbk)
(s : IState HS) (G : Fin HS → List ℤ) (hK : ∀ C CU OP ARG ACC, KG (skS G C CU OP ARG ACC)) (hA : G lA = []) (hC : G lC = []) (hD : G lD = [])
{m : ℕ} {LM : List ℤ} (hM : G rM = (m : ℤ) :: LM) (op a : ℤ) (C CU OP ARG ACC : List ℤ)
(inp tmp : List U) (hlen : op ≠ 0 → m ≤ inp.length) (hok : ∀ u ∈ inp, OkU u)
(ha : 0 < op → OkA a) :
IRuns I iprog
(.ite rOP (fun c => c == .neg) (rptX rM lA lC lD dr)
(.ite rOP (fun c => c == .zero) (rptX rM lA lC lD (.op (.const rACC 0))) (emitP rd it bk)))
(encK s (lin inp tmp (skS G C CU (op :: OP) (a :: ARG) ACC)))
(encK s (lin (if op < 0 then inp.drop m else inp) tmp
(skS G C CU (op :: OP) (a :: ARG) ((runC m g [(op, a)] inp).reverse ++ ACC))))
(50 + (m + 1) * (cdr + crd + cit + cbk + 12002)) := by sorry