NLA-lib Explorer

NLAlib.Ops.evalCounted_weight_le

Library · theorem

Actual weighted instruction counts obey the scalar estimate, including every query. The hypothesis is an auxiliary resource analysis of the existing counted execution; it does not supply termination. Total program logic supplies termination independently.

NLAlib.Ops.evalCounted_weight_le {Op Tst K : Type} (op : Op → List ℕ → ℕ) (query : Tst → List ℕ → ℕ)
  {I : Ops.Interp Op Tst K} {W : Op → List ℕ → ℕ} {τ : Ops.Tape K} {s : Ops.Stmt Op Tst}
  {ρ : Ops.Env} {a b : Ops.St Op Tst K} (h : Ops.evalCounted I W τ s ρ a = some b) :
  (Ops.Count.lift (op ⊕ᵥ query)) b.cost ≤
    (Ops.Count.lift (op ⊕ᵥ query)) a.cost + Ops.stmtWeightedCost op query s ρ.idx

Full source on GitHub

Import NLAlib.Ops.WeightedCost.