NLA-lib Explorer

NLAlib.Ops.PWrites.bindIdx

Library · theorem

The index binder (PL3f-bindIdx): if from every memory of the precondition the index query returns a number \mathbf{v} \le B, and the body at every such \mathbf{v} fails with probability at most \varphi from the memories where the query returns \mathbf{v}, the binder fails with probability at most \varphi.

NLAlib.Ops.PWrites.bindIdx {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 : ℕ} (ha : Ops.Operand.evalList ρ ins = some a)
  (hB : Ops.IExp.eval ρ.idx bound = some B)
  (hidx : ∀ (m : Ops.Mem K), Pre m → ∃ v ≤ B, I.index q a m = some v)
  (h :
    ∀ v ≤ B,
      Ops.PWrites law I body (ρ.pushIdx v) F (fun m ↦ Pre m ∧ I.index q a m = some v) Post φ) :
  Ops.PWrites law I (Ops.Stmt.bindIdx q ins bound body) ρ F Pre Post φ

Full source on GitHub

Import NLAlib.Ops.Logic.Probabilistic.