NLAlib.Ops.Examples.halve_wp
Library · theorem
Total correctness of the halving loop, with the bound on the rounds from the mathematics: if the fuel is at least the bit length of the decoded number, the run ends with a word that decodes to zero.
NLAlib.Ops.Examples.halve_wp {K : Type} {dec : K → ℕ} {h : K → K}
{I : Ops.Interp Ops.Examples.HOp Ops.Examples.HTst K} (hI : Ops.Examples.IsHalving dec h I)
{τ : Ops.Tape K} {k : ℕ} {m : Ops.Mem K} {x : ℕ × ℕ} {a : K} (hx : m.store.get x.1 x.2 = some a)
(hk : (dec a).size ≤ k) :
Ops.Wp Ops.Mode.total I τ Ops.Examples.halve { idx := [k, x.2], buf := [x.1] }
(fun m' ↦ ∃ a', m' = m.upd x a' ∧ dec a' = 0) mImport NLAlib.Ops.Examples.Loops.