NLA-lib Explorer

NLAlib.Ops.Examples.runs_srsum

Library · theorem

The run of srsum, for every interpretation satisfying the contract of srAdd and every tape: n calls, and the cell z holds the function srsumF of the n tape entries from the position, which advances by n.

NLAlib.Ops.Examples.runs_srsum {K : Type} [Inhabited K] {g : K → K → K → K}
  {J : Ops.Interp Ops.Examples.SrOp Empty K} (hJ : Ops.Examples.IsSrAdd g J)
  (W : Ops.Examples.SrOp → List ℕ → ℕ) {τ : Ops.Tape K} {n : ℕ} {x z : ℕ × ℕ} {m : Ops.Mem K}
  {xs : List K} {z₀ : K} (hxz : x.1 ≠ z.1) (hx : m.store.readBlock x.1 x.2 n = some xs)
  (hz : m.store.get z.1 z.2 = some z₀) :
  Ops.ConditionalRuns J W τ Ops.Examples.srsum { idx := [n, x.2, z.2], buf := [x.1, z.1] } m
    (n • Ops.Count.one Ops.Examples.SrOp.srAdd []) (W Ops.Examples.SrOp.srAdd []) fun x ↦
    x = (m.upd z (Ops.Examples.srsumF g z₀ (Ops.vec xs) τ m.pos n)).advance n

Full source on GitHub

Import NLAlib.Ops.Examples.StochRound.