NLA-lib Explorer

NLAlib.Ops.writes_fillEntryRows

Library · theorem

The fixed-width region fill rule in an ordinary column-major matrix layout.

NLAlib.Ops.writes_fillEntryRows {Op Tst K E : Type} {md : Ops.Mode} {I : Ops.Interp Op Tst K}
  {τ : Ops.Tape K} {ρ : Ops.Env} {m : Ops.Mem K} {n₁ n₂ : Ops.IExp} {body : Ops.Stmt Op Tst}
  (C : Ops.EntryCodec K E) (L : Ops.MatLayout) (hL : L.Valid) (N : ℕ → ℕ)
  (hN : ∀ j < L.cols, N j ≤ L.rows) (hn₁ : Ops.IExp.eval ρ.idx n₁ = some L.cols)
  (hn₂ : ∀ (j : ℕ), Ops.IExp.eval (ρ.pushIdx j).idx n₂ = some (N j)) (A : ℕ → ℕ → E)
  (pos : ℕ → ℕ → ℕ) (hpos : m.pos = pos 0 0) (hnext : ∀ j < L.cols, pos j (N j) = pos (j + 1) 0)
  (hstep :
    ∀ j < L.cols,
      ∀ i < N j,
        ∀ (m' : Ops.Mem K),
          Ops.Store.EqOff (C.rowsUpto L N j i) m.store m'.store →
            m'.pos = pos j i →
              Ops.Writes md I τ body ((ρ.pushIdx j).pushIdx i)
                (C.entryBlock L.buf L.off (j * L.ld + i))
                (fun m'' ↦
                  (∀ (z : Fin C.width),
                      m''.store.get L.buf (L.off + C.width * (j * L.ld + i) + ↑z) =
                        some (C.words (A i j) z)) ∧
                    m''.pos = pos j (i + 1))
                m') :
  Ops.Writes md I τ (Ops.Stmt.loop n₁ (Ops.Stmt.loop n₂ body)) ρ (C.rowsFp L N)
    (fun m' ↦ m'.store.HoldsRowEntries C L N A ∧ m'.pos = pos L.cols 0) m

Full source on GitHub

Import NLAlib.Ops.Logic.EntryRows.