NLA-lib Explorer

NLAlib.Ops.PWrites.ifPos

Library · theorem

The branch on a size: ifPos e body runs the body once (at the index 0) when e > 0 and does nothing otherwise. The failure bound is that of the body, and nonnegative.

NLAlib.Ops.PWrites.ifPos {Op Tst K : Type} [Inhabited K] [MeasurableSpace K] {law : ℕ → Measure K}
  {I : Ops.Interp Op Tst K} {ρ : Ops.Env} {F : Ops.Fp} {Pre Post : Ops.Mem K → Prop} {φ : ℝ}
  {e : Ops.IExp} {body : Ops.Stmt Op Tst} {n : ℕ} (he : Ops.IExp.eval ρ.idx e = some n) (hφ : 0 ≤ φ)
  (h : 0 < n → Ops.PWrites law I body (ρ.pushIdx 0) F Pre Post φ)
  (h0 : n = 0 → ∀ (m : Ops.Mem K), Pre m → Post m) :
  Ops.PWrites law I (Ops.Stmt.ifPos e body) ρ F Pre Post φ

Full source on GitHub

Import NLAlib.Ops.Logic.ProbabilisticFamily.