NLA-lib Explorer

NLAlib.Ops.Algorithm.ofWp

Library · def

Construct a canonical certificate from total word-level logic and format/resource proofs. The complete instruction budget is independently specified; work/span are evaluated with the same fixed model, and resident bytes include the supplied buffers.

NLAlib.Ops.Algorithm.ofWp {Op Tst K : Type} {r b : ℕ} {P : Ops.Problem K r b}
  {M : Ops.AccessModel Op Tst P} {S : Ops.Specification Op Tst P} (p : Ops.Program Op Tst r b)
  (ht : p.wellTyped M.resources P.formats = true)
  (hwp :
    ∀ (d : Fin r → ℕ),
      P.valid d →
        ∀ (x : P.Input d) (I : Ops.Interp Op Tst K),
          M.contracts d x I →
            ∀ (τ : Ops.Tape K),
              Ops.Wp Ops.Mode.total I τ p.body (Ops.Program.environment d)
                (fun m' ↦ ∀ c ≤ S.budget d, S.good d x τ c m') (P.initial d x))
  (hcost : ∀ (d : Fin r → ℕ), P.valid d → Ops.staticCost p d ≤ S.budget d)
  (hspace : ∀ (d : Fin r → ℕ), P.valid d → Ops.staticPeak M.resources p d ≤ S.scratch d)
  (hwork : ∀ (d : Fin r → ℕ), P.valid d → M.resources.work (S.budget d) ≤ S.work d)
  (hspan : ∀ (d : Fin r → ℕ), P.valid d → M.resources.span (S.budget d) ≤ S.span d)
  (hmemory :
    ∀ (d : Fin r → ℕ),
      P.valid d → ∀ (x : P.Input d), P.initialBytes d x + S.scratch d ≤ S.memory d) :
  Ops.Algorithm M S

Full source on GitHub

Import NLAlib.Ops.Cert.