The parameter-computation program computes mkParams K N
ProvedNLogN.CR.parP_specLet and , and let be a machine state whose register rN holds and rNb holds on top. Then the straight-line register program parP K is defined on and its result is parOut s K N: the state with the parameters of pushed on their registers — , , , , , , , , , , , the list of side lengths (as records) and their product .
Formalization Note. RS is straight-line code on the 64 item stacks with run/ok; pushV pushes an integer on a stack. mkParams is from Def_IntMul_HvdH_MachineRef. The machine layer: IState HS is a state with stacks of items (Item = integer or mark), an input position and an output; RM programs (straight-line register code RS, loops rep, conditionals, calls of the multiplication procedure through a MulSpec giving its domain and cost) have a functional semantics p.run s, a definedness predicate p.ok M s and a cost p.cost M s; Spec M p s s' c abbreviates p.ok M s ∧ p.run s = s' ∧ p.cost M s ≤ c. ints L / gints U push an integer list / a list of pairs as items (head = top); zsz z is the bit length of . MulBnd M m Φ says the multiplication procedure accepts all pairs of integers of bit length at cost . Register names (GU, CR, KB, XN, …) are fixed stack indices.
-- Harvey–van der Hoeven multitape-TM development (NLogN), generated by skeleton subtraction. import Definitions.Def_IntMul_HvdH_M_Defs4 set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxHeartbeats 1000000 set_option linter.unusedSimpArgs false set_option linter.unusedVariables false open NLogN open NLogN.CR open IntMul RS IntMul.HvdH IntMul.HvdH.Ref
theorem NLogN.CR.parP_spec (K N nb : ℕ) (hK : 1 ≤ K) (hN : 1 ≤ N) (hnb : N < 2 ^ nb) (s : IState HS)
(LN LNb : List Item) (hsN : s.G rN = .int N :: LN) (hsNb : s.G rNb = .int nb :: LNb) :
(parP K).ok s ∧ (parP K).run s = parOut s K N := by sorry