NLA-lib Explorer

NLAlib.Ops.exec_original_count

Library · theorem

Canonical execution exposes the actual source counted run with exactly its original operation/query counts. Format validation and query-workspace reservation preserve that memory and projection; structural instruction counts remain in the canonical result.

NLAlib.Ops.exec_original_count {Op Tst K : Type} {r b : ℕ} {p : Ops.Program Op Tst r b}
  {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) :
  ∃ raw,
    Ops.evalCounted I R.workspace τ p.body (Ops.Program.environment d) (Ops.St.init m) = some raw ∧
      raw.mem = st.mem ∧ raw.cost = Ops.Count.original st.cost

Full source on GitHub

Import NLAlib.Ops.Certification.