NLA-lib Explorer

NLAlib.Ops.exec_eq_static_of_straight

Library · theorem

Exact resources of a program without tests: every successful run of the evaluator has exactly the static count of the tree and exactly its static scratch.

NLAlib.Ops.exec_eq_static_of_straight {Op Tst K : Type} {r b : ℕ} {p : Ops.Program Op Tst r b}
  (hs : p.body.Straight) {I : Ops.Interp Op Tst K} {R : Ops.ResourceModel Op Tst}
  {formats : Fin b → Ops.StorageFormat} {τ : Ops.Tape K} {d : Fin r → ℕ} {m : Ops.Mem K}
  {st : Ops.St (Op ⊕ Ops.Bookkeeping) Tst K} (h : Ops.exec p I R formats τ d m = some st) :
  st.cost = Ops.staticCost p d ∧ st.peak = Ops.staticPeak R p d

Full source on GitHub

Import NLAlib.Ops.StraightCount.