NLA-lib Explorer

NLAlib.Ops.PWrites.bindIdx_of_index_eq

Library · theorem

The index binder at a known value: if from every memory of the precondition the index query returns the same number \mathbf{v} \le B, the binder fails with the probability of its body at \mathbf{v}.

NLAlib.Ops.PWrites.bindIdx_of_index_eq {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} {φ : ℝ} (hI : I.IsMeasurable) {q : Tst} {ins : List Ops.Operand}
  {bound : Ops.IExp} {body : Ops.Stmt Op Tst} {a : List (ℕ × ℕ)} {B v : ℕ}
  (ha : Ops.Operand.evalList ρ ins = some a) (hB : Ops.IExp.eval ρ.idx bound = some B) (hvB : v ≤ B)
  (hidx : ∀ (m : Ops.Mem K), Pre m → I.index q a m = some v) (hφ : 0 ≤ φ)
  (h : Ops.PWrites law I body (ρ.pushIdx v) F Pre Post φ) :
  Ops.PWrites law I (Ops.Stmt.bindIdx q ins bound body) ρ F Pre Post φ

Full source on GitHub

Import NLAlib.Ops.Logic.Probabilistic.