NLA-lib Explorer

NLAlib.Ops.Program.exec_work_le_coefficient_mul_pow

Library · theorem

Canonical counted execution obeys the context-sensitive majorant for the full instrumented tree. Query reservation preserves counts, so every declared work charge is included.

NLAlib.Ops.Program.exec_work_le_coefficient_mul_pow {Op Tst K : Type} {r buffers : ℕ}
  (p : Ops.Program Op Tst r buffers) (R : Ops.ResourceModel Op Tst) {I : Ops.Interp Op Tst K}
  {τ : Ops.Tape K} {formats : Fin buffers → Ops.StorageFormat} {d : Fin r → ℕ} {m : Ops.Mem K}
  {st : Ops.St (Op ⊕ Ops.Bookkeeping) Tst K} {base weight : ℕ} {degrees : List ℕ} (hb : 2 ≤ base)
  (hi : List.Forall₂ (fun v e ↦ v ≤ base ^ e) (Ops.Program.environment d).idx degrees)
  (hw :
    Ops.WorkEnvelope (R.operationWork ⊕ᵥ R.coreWork) R.queryWork p.body.instrument.callArity
      (base ^ p.body.instrument.callDegreeAt degrees) weight)
  (hr : Ops.exec p I R formats τ d m = some st) :
  R.work st.cost ≤
    p.body.instrument.workCoefficient * base ^ p.body.instrument.workDegreeAt degrees * weight

Full source on GitHub

Import NLAlib.Ops.PolynomialWork.