NLA-lib Explorer

NLAlib.Ops.Inputs.checked

Library · theorem

What a certificate states, for the admitted inputs, with the payload written on the slots. For every admitted size, every tuple of inputs satisfying accepts, every interpretation satisfying the contracts of the model and every tape, the run of the fixed program from the buffers of the slots succeeds (the execution rules derive its outcome), within the scratch, the budget, the work, the span and the memory of the specification (the resident payload of the slots plus the peak scratch of the run), and its final memory satisfies the output condition.

NLAlib.Ops.Inputs.checked {K Op Tst : Type} {r b : ℕ} (D : Ops.Inputs K r b)
  {M : Ops.AccessModel Op Tst D.problem} {S : Ops.Specification Op Tst D.problem}
  (A : Ops.Algorithm M S) (d : Fin r → ℕ) (hd : D.valid d) (x : D.In d) (hx : D.accepts d x)
  (I : Ops.Interp Op Tst K) (hI : M.contracts d (D.input d x hx) I) (τ : Ops.Tape K) :
  ∃ st,
    Ops.Reference.Execution A.program I M.resources D.formats τ d (D.memory d x) 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 ∧
              D.bytes d + st.peak ≤ S.memory d ∧ S.good d (D.input d x hx) τ st.cost st.mem

Full source on GitHub

Import NLAlib.Ops.RoutineProblem.