NLA-lib Explorer

NLAlib.Ops.Routine.Domain.certify

Library · def

The counted certificate of a routine on its problem: NLAlib.Ops.Routine.certify with the obligations about the initial memory and the payload proved from the slots. The author gives the judgment, the precondition at the admitted inputs, and a bound work of the instruction polynomial of the tree; every weight of the model is at most one.

NLAlib.Ops.Routine.Domain.certify {K Op Tst : Type} {r b : ℕ} {R : Ops.Routine Op Tst}
  (D : R.Domain K r b) {M : Ops.AccessModel Op Tst D.problem}
  (Sp : (d : Fin r → ℕ) → D.In d → Ops.Routine.Spec K) (work : (Fin r → ℕ) → ℕ)
  (hmeets :
    ∀ (d : Fin r → ℕ),
      D.valid d →
        ∀ (X : D.problem.Input d) (I : Ops.Interp Op Tst K),
          M.contracts d X I → R.Meets I (Sp d (↑X).1))
  (hpre :
    ∀ (d : Fin r → ℕ),
      D.valid d →
        ∀ (x : D.In d),
          D.accepts d x → ∀ (τ : Ops.Tape K), (Sp d x).pre (List.ofFn d) τ (D.blocks d x))
  (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 → ℕ),
      D.valid d → Ops.CountPoly.eval (List.ofFn d) (R.close r b).countPoly ≤ work d)
  (ht : (R.close r b).wellTyped M.resources D.problem.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 (fun d X ↦ Sp d (↑X).1) M.resources (fun d X ↦ D.blocks d (↑X).1) D.bytes work)

Full source on GitHub

Import NLAlib.Ops.RoutineProblem.