NLA-lib Explorer

NLAlib.Ops.Wp.runs_original_weighted

Library · theorem

Total word-level logic and a scalar weighted source bound give a total instrumented execution with that bound on its exact original-count projection. Structural instructions remain in the actual count. Stored/primitive scratch has its independent source peak bound.

NLAlib.Ops.Wp.runs_original_weighted {Op Tst K : Type} {I : Ops.Interp Op Tst K} {τ : Ops.Tape K}
  {s : Ops.Stmt Op Tst} {ρ : Ops.Env} {m : Ops.Mem K} {Q : Ops.Mem K → Prop}
  (h : Ops.Wp Ops.Mode.total I τ s ρ Q m) (op : Op → List ℕ → ℕ) (query : Tst → List ℕ → ℕ)
  (W : Op → List ℕ → ℕ) {b : ℕ} (hb : Ops.stmtWeightedCost op query s ρ.idx ≤ b) :
  Ops.ConditionalRunsW I.instrument (Ops.instrumentWorkspace W) τ s.instrument ρ m
    (Ops.stmtPeak W s ρ.idx) fun c m' ↦
    (Ops.Count.lift (op ⊕ᵥ query)) (Ops.Count.original c) ≤ b ∧ Q m'

Full source on GitHub

Import NLAlib.Ops.WeightedCost.