NLA-lib Explorer

NLAlib.Ops.Reference.instrumented_call

Library · theorem

An admitted call has its original memory effect, address charge and primitive workspace.

NLAlib.Ops.Reference.instrumented_call {Op Tst K : Type} (I : Ops.Interp Op Tst K)
  (R : Ops.ResourceModel Op Tst) (τ : Ops.Tape K) (o : Op) (ds : List Ops.IExp)
  (ins outs : List Ops.Operand) (ρ : Ops.Env) (a : Ops.Reference.State Op Tst K)
  (ha : a.cur ≤ a.peak) {d : List ℕ} {xs ys : List (ℕ × ℕ)}
  (hd : Ops.IExp.evalList ρ.idx ds = some d) (hx : Ops.Operand.evalList ρ ins = some xs)
  (hy : Ops.Operand.evalList ρ outs = some ys) :
  Ops.Reference.instrumented I R τ (Ops.Stmt.call o ds ins outs) ρ a =
    Option.map
      (fun m ↦
        Ops.Reference.called R o d m
          (Ops.Reference.charge (Ops.Reference.dimensions ds + Ops.Reference.operands (ins ++ outs))
            a))
      (I.callS o d xs ys τ a.mem)

Full source on GitHub

Import NLAlib.Ops.Reference.Accounting.