NLAlib.Ops.RunsFromWL.bindIdx
Library · theorem
Index binder: one use of the query, then the body at every value within the bound that the query may return; the body receives the value read and is charged for that value only.
NLAlib.Ops.RunsFromWL.bindIdx {Op Tst K : Type} {I : Ops.Interp Op Tst K} {W : Op → List ℕ → ℕ}
{τ : Ops.Tape K} {ρ : Ops.Env} {st : Ops.St Op Tst K} {p : ℕ}
{Q : Ops.Count Op Tst → Ops.Mem K → Prop} {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)
(h :
∀ v ≤ B,
I.index q a st.mem = some v →
Ops.RunsFromWL I W τ body (ρ.pushIdx v) (st.tick q []) p fun c m ↦
Q (Ops.Count.test q [] + c) m) :
Ops.RunsFromWL I W τ (Ops.Stmt.bindIdx q ins bound body) ρ st p QImport NLAlib.Ops.Counted.