NLA-lib Explorer

NLAlib.Ops.Algorithm.correct_exec

Library · theorem

A certificate read with the evaluator: on every admitted input, under every interpretation satisfying the model and every tape, canonical execution succeeds within all five resource bounds, and its count and memory satisfy the output condition. Proofs use this form; the statement of the certificate itself is in terms of the execution rules.

NLAlib.Ops.Algorithm.correct_exec {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)
  (d : Fin r → ℕ) (hd : P.valid d) (x : P.Input d) (I : Ops.Interp Op Tst K)
  (hI : M.contracts d x I) (τ : Ops.Tape K) :
  ∃ st,
    Ops.exec A.program I M.resources P.formats τ d (P.initial d x) = some st ∧
      st.peak ≤ S.scratch d ∧
        st.cost ≤ S.budget d ∧
          M.resources.work st.cost ≤ S.work d ∧
            M.resources.span st.cost ≤ S.span d ∧
              P.initialBytes d x + st.peak ≤ S.memory d ∧ S.good d x τ st.cost st.mem

Full source on GitHub

Import NLAlib.Ops.Cert.