NLA-lib Explorer

NLAlib.Ops.writes_bindIdx_of_isIndex

Library · theorem

Index binder from the access model: the number is the conversion f of the cells read (Interp.IsIndex); the body is proved at that number.

NLAlib.Ops.writes_bindIdx_of_isIndex {Op Tst K : Type} {md : Ops.Mode} {I : Ops.Interp Op Tst K}
  {τ : Ops.Tape K} {ρ : Ops.Env} {m : Ops.Mem K} {q : Tst} {f : List K → Option ℕ}
  (hI : I.IsIndex q f) {ins : List Ops.Operand} {bound : Ops.IExp} {body : Ops.Stmt Op Tst}
  {a : List (ℕ × ℕ)} {xs : List (List K)} {B v : ℕ} {F : Ops.Fp} {P : Ops.Mem K → Prop}
  (ha : Ops.Operand.evalList ρ ins = some a) (hB : Ops.IExp.eval ρ.idx bound = some B)
  (hr : m.readBlocks a (List.map (fun x ↦ 1) a) = some xs) (hf : f xs.flatten = some v)
  (hle : v ≤ B) (h : Ops.Writes md I τ body (ρ.pushIdx v) F P m) :
  Ops.Writes md I τ (Ops.Stmt.bindIdx q ins bound body) ρ F P m

Full source on GitHub

Import NLAlib.Ops.Logic.Writes.