NLA-lib Explorer

NLAlib.Ops.scalarBroadcast_writes

Library · theorem

A stored broadcast operation returns its pointwise value. The vector operands may alias exactly; the broadcast scalar must be disjoint from the entire output vector. One tree, two routines: the common proof of NLAlib.Ops.scalarBroadcastRoutine_meets (output apart) and NLAlib.Ops.scalarBroadcastInPlaceRoutine_meets (output on the vector), stated for either layout.

NLAlib.Ops.scalarBroadcast_writes {K Op Tst : Type} {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 : ℕ × ℕ} {v : ℕ → K} {c : K}
  (hx : m.store.HoldsVec x.1 x.2 n v) (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'.store.HoldsVec y.1 y.2 n fun i ↦ f (v i) c) ∧ m'.pos = m.pos) m

Full source on GitHub

Import NLAlib.Ops.Blas.Broadcast.