NLA-lib Explorer

NLAlib.Ops.scalarBroadcast_writes_readBlock

Library · theorem

Packed vector readback of the same broadcast loop, for either layout: the two judgments read at operands. Kept because the block-sequence rule NLAlib.Ops.Writes.seq_readBlock takes its statement in this form, and because NLAlib.Ops.RCLikeScalar.scal is proved once for both of its layouts.

NLAlib.Ops.scalarBroadcast_writes_readBlock {K Op Tst : Type} [Inhabited K] {o : Op} {f : K → K → K}
  {I : Ops.Interp Op Tst K}
  (hI : I.IsFn Ops.Mode.total o (Ops.BlockFn.bin fun x y ↦ some (f x y)) Ops.AnyOperands)
  {τ : Ops.Tape K} {m : Ops.Mem K} {n : ℕ} {x a y : ℕ × ℕ} {xs : List K} {c : K}
  (hx : m.store.readBlock x.1 x.2 n = some xs) (ha : m.store.get a.1 a.2 = some c)
  (hy : y.2 + n ≤ m.store.len y.1)
  (hxy : Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 n) (Ops.Store.inBlock y.1 y.2 n) ∨ x = y)
  (hay : Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 1) (Ops.Store.inBlock y.1 y.2 n)) :
  Ops.Writes Ops.Mode.total I τ (Ops.scalarBroadcast o) (Ops.Env.frame [n] [x, a, y])
    (Ops.Store.inBlock y.1 y.2 n)
    (fun m' ↦ m'.pos = m.pos ∧ m'.store.readBlock y.1 y.2 n = some (List.map (fun v ↦ f v c) xs)) m

Full source on GitHub

Import NLAlib.Ops.Blas.Broadcast.