NLAlib.Ops.Routine.Domain.algorithmAt
Library · def
The certificate of a routine on its problem, in its general form: the specification of the routine may depend on the input of the problem and not only on its data. Two kinds of certificate need that: one whose model supplies further data at an input (Lanczos with an operator oracle, whose matrix the model fixes), and one whose specification names a witness of the acceptance predicate (exact shifted QR, whose gap is an existential of accepts). The routine meets Sp at the admitted inputs under every interpretation of the model, the blocks read satisfy the precondition (hpre), and the output of S follows from the postcondition (hgood). That the supplied buffers hold the blocks read and have room for the blocks written is not a hypothesis: it holds by the construction of the problem.
NLAlib.Ops.Routine.Domain.algorithmAt {K Op Tst : Type} {r b : ℕ} {R : Ops.Routine Op Tst}
(D : R.Domain K r b) {M : Ops.AccessModel Op Tst D.problem}
{S : Ops.Specification Op Tst D.problem}
(Sp : (d : Fin r → ℕ) → D.problem.Input d → Ops.Routine.Spec K)
(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))
(hpre :
∀ (d : Fin r → ℕ),
D.valid d →
∀ (X : D.problem.Input d) (τ : Ops.Tape K),
(Sp d X).pre (List.ofFn d) τ (D.blocks d (↑X).1))
(hgood :
∀ (d : Fin r → ℕ),
D.valid d →
∀ (X : D.problem.Input d) (τ : Ops.Tape K) (m' : Ops.Mem K),
Ops.Store.EqOff (Ops.Fp.blocks (R.writeArgs (Ops.slots b)) (R.writeLens (List.ofFn d)))
(D.problem.initial d X).store m'.store →
R.Advances (List.ofFn d) 0 m'.pos →
∀ (ys : List (List K)),
m'.readBlocks (R.outArgs (Ops.slots b)) (R.outLens (List.ofFn d)) = some ys →
(Sp d X).post (List.ofFn d) τ (D.blocks d (↑X).1) ys →
∀ c ≤ S.budget d, S.good d X τ c m')
(hcost : ∀ (d : Fin r → ℕ), D.valid d → Ops.staticCost (R.close r b) d ≤ S.budget d := by
intro _ _; exact le_rfl)
(hspace :
∀ (d : Fin r → ℕ), D.valid d → Ops.staticPeak M.resources (R.close r b) d ≤ S.scratch d := by
intro _ _; exact le_rfl)
(hwork : ∀ (d : Fin r → ℕ), D.valid d → M.resources.work (S.budget d) ≤ S.work d := by intro _ _;
exact le_rfl)
(hspan : ∀ (d : Fin r → ℕ), D.valid d → M.resources.span (S.budget d) ≤ S.span d := by intro _ _;
exact le_rfl)
(hmemory :
∀ (d : Fin r → ℕ),
D.valid d → ∀ (X : D.problem.Input d), D.problem.initialBytes d X + S.scratch d ≤ S.memory 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 SImport NLAlib.Ops.RoutineProblem.