NLA-lib Explorer

NLAlib.Ops.writes_loop

Library · theorem

The counted loop, in the standard invariant form.

NLAlib.Ops.writes_loop {Op Tst K : Type} {md : Ops.Mode} {I : Ops.Interp Op Tst K} {τ : Ops.Tape K}
  {ρ : Ops.Env} {m : Ops.Mem K} {n : Ops.IExp} {body : Ops.Stmt Op Tst} {N : ℕ}
  (hn : Ops.IExp.eval ρ.idx n = some N) (F : ℕ → Ops.Fp) (hF : ∀ i < N, F i ≤ F (i + 1))
  (P : ℕ → Ops.Mem K → Prop) (h0 : P 0 m)
  (hstep :
    ∀ i < N,
      ∀ (m' : Ops.Mem K),
        Ops.Store.EqOff (F i) m.store m'.store →
          P i m' → Ops.Writes md I τ body (ρ.pushIdx i) (F (i + 1)) (P (i + 1)) m') :
  Ops.Writes md I τ (Ops.Stmt.loop n body) ρ (F N) (P N) m

Full source on GitHub

Import NLAlib.Ops.Logic.Loop.