NLA-lib Explorer

NLAlib.Ops.RCLikeBlas.writes_scal

Library ยท theorem

Scaling divides the input block by the actual supplied scalar. The field operation is total; an algorithm needing normalization proves its own nonzero norm premise.

NLAlib.Ops.RCLikeBlas.writes_scal {๐•œ Op Tst : Type} [RCLike ๐•œ] [Ops.Has Ops.Blas1Op Op]
  {I : Ops.Interp Op Tst ๐•œ} {ฯ„ : Ops.Tape ๐•œ} {ฯ : Ops.Env} {m : Ops.Mem ๐•œ}
  (hI : Ops.RCLikeBlas.IsExact I) {ds : List Ops.IExp} {ins outs : List Ops.Operand} {n : โ„•}
  {a x z : โ„• ร— โ„•} {alpha : ๐•œ} {xs : List ๐•œ} (hd : Ops.IExp.evalList ฯ.idx ds = some [n])
  (ha : Ops.Operand.evalList ฯ ins = some [a, x]) (hz : Ops.Operand.evalList ฯ outs = some [z])
  (hl : m.Live [a, x, z]) (hA : m.store.readBlock a.1 a.2 1 = some [alpha])
  (hX : m.store.readBlock x.1 x.2 n = some xs)
  (hAZ : Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 1) (Ops.Store.inBlock z.1 z.2 n))
  (hXZ : Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 n) (Ops.Store.inBlock z.1 z.2 n) โˆจ x = z)
  (hZ : z.2 + n โ‰ค m.store.len z.1) :
  Ops.Writes Ops.Mode.total I ฯ„ (Ops.Stmt.call (Ops.Has.inj Ops.Blas1Op.scal) ds ins outs) ฯ
    (Ops.Store.inBlock z.1 z.2 n)
    (fun m' โ†ฆ
      m'.pos = m.pos โˆง
        m'.store.readBlock z.1 z.2 n = some (List.ofFn fun i โ†ฆ xs.getD (โ†‘i) 0 / alpha))
    m

Full source on GitHub

Import NLAlib.Ops.Logic.RCLikeBlas.