NLA-lib Explorer

NLAlib.Ops.StoredDense.impl_writes_word

Library ยท theorem

The allocated dense implementation returns the actual word matrix-vector product and frees its single scalar temporary. The tree is the body of two table entries: the routine implRoutine, whose judgment is the exact specialisation, and the context-forwarded ContextDense.impl, which runs the same tree with the matrix as forwarded context; this lemma, for any machine, is their common proof.

NLAlib.Ops.StoredDense.impl_writes_word {Op Tst : Type} [Ops.Has Ops.ScalarOp Op] {๐•œ : Type}
  [RCLike ๐•œ] {I : Ops.Interp Op Tst ๐•œ} {tape : Ops.Tape ๐•œ} {mem : Ops.Mem ๐•œ} {M : Ops.Machine ๐•œ}
  (hS : Ops.IsScalar M I) {m n : โ„•} {data x y : โ„• ร— โ„•} (ds xs : List ๐•œ) (hl : mem.Live [data, x, y])
  (hD : mem.store.readBlock data.1 data.2 (m * n) = some ds)
  (hX : mem.store.readBlock x.1 x.2 n = some xs)
  (hYD : Ops.Fp.Disj (Ops.Store.inBlock y.1 y.2 m) (Ops.Store.inBlock data.1 data.2 (m * n)))
  (hYX : Ops.Fp.Disj (Ops.Store.inBlock y.1 y.2 m) (Ops.Store.inBlock x.1 x.2 n))
  (hy : y.2 + m โ‰ค mem.store.len y.1) :
  Ops.Writes Ops.Mode.total I tape Ops.StoredDense.impl (Ops.Env.frame [m, n] [data, x, y])
    (Ops.Store.inBlock y.1 y.2 m)
    (fun mem' โ†ฆ
      mem'.pos = mem.pos โˆง
        mem'.store.readBlock y.1 y.2 m =
          some (List.map (Ops.StoredDense.rowWord M m n ds xs) (List.range m)))
    mem

Full source on GitHub

Import NLAlib.Ops.Profiles.StoredDense.