NLAlib.Ops.writes_loop_disjoint
Library · theorem
A loop initializes independent regions. The caller supplies each local mathematical output and its read footprint; the shared rule retains all previously initialized regions.
NLAlib.Ops.writes_loop_disjoint {K Op Tst : Type} {md : Ops.Mode} {I : Ops.Interp Op Tst K}
{τ : Ops.Tape K} {ρ : Ops.Env} {m : Ops.Mem K} {n : Ops.IExp} {N : ℕ} {body : Ops.Stmt Op Tst}
{F : Ops.Fp} (region : ℕ → Ops.Fp) (result : ℕ → Ops.Store K → Prop)
(hn : Ops.IExp.eval ρ.idx n = some N) (hsub : ∀ i < N, region i ≤ F)
(hdisj : ∀ i < N, ∀ j < N, i ≠ j → (region i).Disj (region j))
(hread : ∀ i < N, Ops.Store.ReadsOnly (region i) (result i))
(hstep :
∀ i < N,
∀ (m' : Ops.Mem K),
Ops.Store.EqOff F m.store m'.store →
Ops.Writes md I τ body (ρ.pushIdx i) (region i)
(fun m'' ↦ m''.pos = m'.pos ∧ result i m''.store) m') :
Ops.Writes md I τ (Ops.Stmt.loop n body) ρ F
(fun m' ↦ m'.pos = m.pos ∧ ∀ i < N, result i m'.store) mImport NLAlib.Ops.Logic.IndependentLoop.