NLA-lib Explorer

NLAlib.Ops.Examples.wpL_halveStrict

Library · theorem

Partial correctness of the strict halving loop, with no bound: if the run succeeds, whatever the fuel, the word decodes to zero. (For the loop that stops at the cap this is false: it succeeds with a word that is not zero.)

NLAlib.Ops.Examples.wpL_halveStrict {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) :
  Ops.Wp Ops.Mode.liberal I τ Ops.Examples.halveStrict { idx := [k, x.2], buf := [x.1] }
    (fun m' ↦ ∃ a', m' = m.upd x a' ∧ dec a' = 0) m

Full source on GitHub

Import NLAlib.Ops.Examples.Loops.