NLA-lib Explorer

NLAlib.Ops.Algorithm.withCountPoly

Library · def

A certificate with explicit work. The work and span of a certificate are restated by a bound W of the instruction polynomial of its program, when every weight of the model is at most one. The program, the model, the count budget and the postcondition are unchanged.

NLAlib.Ops.Algorithm.withCountPoly {Op Tst K : Type} {r b : ℕ} {P : Ops.Problem K r b}
  {M : Ops.AccessModel Op Tst P} {S : Ops.Specification Op Tst P} (A : Ops.Algorithm M S)
  (hop : ∀ (o : Op) (d : List ℕ), M.resources.operationWork o d ≤ 1)
  (hcore : ∀ (k : Ops.Bookkeeping) (d : List ℕ), M.resources.coreWork k d ≤ 1)
  (hq : ∀ (q : Tst) (d : List ℕ), M.resources.queryWork q d ≤ 1) (W : (Fin r → ℕ) → ℕ)
  (hW : ∀ (d : Fin r → ℕ), P.valid d → Ops.CountPoly.eval (List.ofFn d) A.program.countPoly ≤ W d) :
  Ops.Algorithm M
    { budget := S.budget, scratch := S.scratch, work := W, span := W, memory := S.memory,
      good := S.good }

Full source on GitHub

Import NLAlib.Ops.OperationCount.