NLA-lib Explorer

NLAlib.Ops.Examples.halveInv_test

Library · theorem

The test under the invariant: its Boolean, and it holds only below the bit length.

NLAlib.Ops.Examples.halveInv_test {K : Type} {dec : K → ℕ} {h : K → K}
  {I : Ops.Interp Ops.Examples.HOp Ops.Examples.HTst K} (hI : Ops.Examples.IsHalving dec h I)
  {m : Ops.Mem K} {x : ℕ × ℕ} {v : ℕ} (hx : x.2 < m.store.len x.1) (i : ℕ) (m' : Ops.Mem K)
  (hinv : Ops.Examples.HalveInv dec m x v i m') :
  ∃ b,
    I.test Ops.Examples.HTst.nz [] [x] m' = some b ∧
      (b = true → i < v.size) ∧ (b = false → ∃ a', m' = m.upd x a' ∧ dec a' = 0)

Full source on GitHub

Import NLAlib.Ops.Examples.Loops.