NLAlib.Ops.Routine.certify
Library · def
The counted certificate of a routine: the certificate NLAlib.Ops.Routine.algorithm against the canonical specification, with its work and span replaced by any bound work of the instruction polynomial of the tree (NLAlib.Ops.Algorithm.withCountPoly).
The instruction polynomial is computed by the kernel from the fixed instrumented tree; no statement about the cost of the routine is taken from its author. Every weight of the model must be at most one, because an instruction count bounds the work only then: the count is of the primitives of the model, each counted once.
NLAlib.Ops.Routine.certify {Op Tst K : Type} {r b : ℕ} (R : Ops.Routine Op Tst)
{P : Ops.Problem K r b} (S : (d : Fin r → ℕ) → P.Input d → Ops.Routine.Spec K)
{M : Ops.AccessModel Op Tst P} (input : (d : Fin r → ℕ) → P.Input d → List (List K))
(bytes work : (Fin r → ℕ) → ℕ)
(hmeets :
∀ (d : Fin r → ℕ),
P.valid d →
∀ (x : P.Input d) (I : Ops.Interp Op Tst K), M.contracts d x I → R.Meets I (S d x))
(hinit :
∀ (d : Fin r → ℕ),
P.valid d →
∀ (x : P.Input d),
(P.initial d x).readBlocks (R.readArgs (Ops.slots b)) (R.readLens (List.ofFn d)) =
some (input d x) ∧
(∀ (τ : Ops.Tape K), (S d x).pre (List.ofFn d) τ (input d x)) ∧
(P.initial d x).Room (R.writeArgs (Ops.slots b)) (R.writeLens (List.ofFn d)))
(hbytes : ∀ (d : Fin r → ℕ), P.valid d → ∀ (x : P.Input d), P.initialBytes d x ≤ bytes d)
(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)
(hwork :
∀ (d : Fin r → ℕ),
P.valid d → Ops.CountPoly.eval (List.ofFn d) (R.close r b).countPoly ≤ work d)
(hshape : R.nd = r ∧ R.ports.length = b := by exact ⟨rfl, rfl⟩)
(ht : (R.close r b).wellTyped M.resources P.formats = true := by rfl)
(hfit : R.bindsFit b = true := by rfl) (hflat : R.flat = true := by rfl)
(hcontig : R.contiguous = true := by rfl) :
Ops.Algorithm M (R.specification S M.resources input bytes work)Import NLAlib.Ops.Routine.