NLA-lib Explorer

NLAlib.Ops.RunsFromWL.link_from

Library · theorem

Link a liberal counted segment from states with the same memory and live cells. The upper starting peak must fit within the lower segment's peak bound. If the linked segment succeeds, its added counts have weight at most the upper weight of the counts added by the algorithm segment, which satisfy its postcondition.

NLAlib.Ops.RunsFromWL.link_from {Tst K Op₁ Op₂ A : Type} [AddCommMonoid A] [PartialOrder A]
  [IsOrderedAddMonoid A] {T : Ops.Table Op₁ Op₂ Tst} {I : Ops.Interp Op₂ Tst K}
  {W₂ : Op₂ → List ℕ → ℕ} {w₂ : Ops.Count Op₂ Tst →+ A} {t : Op₁ → List ℕ → A}
  {W₁ : Op₁ → List ℕ → ℕ} {τ : Ops.Tape K} {s : Ops.Stmt Op₁ Tst} {ρ : Ops.Env} {p : ℕ}
  {Q : Ops.Count Op₁ Tst → Ops.Mem K → Prop} {a : Ops.St Op₁ Tst K} {c : Ops.St Op₂ Tst K}
  (hacc : T.AccountsW I W₂ w₂ t W₁) (h : Ops.RunsFromWL (I.link T) W₁ τ s ρ a p Q)
  (hmem : c.mem = a.mem) (hcur : c.cur = a.cur) (hpeak : a.peak ≤ max c.peak (c.cur + p)) :
  Ops.RunsFromWL I W₂ τ (Ops.Stmt.link T s) ρ c p fun dc m' ↦
    ∃ da, w₂ dc ≤ (Ops.Count.upper w₂ t) da ∧ Q da m'

Full source on GitHub

Import NLAlib.Ops.Counted.