NLA-lib Explorer

NLAlib.Ops.Hermitian.boxTest_writes

Library · theorem

The box test writes the selected machine zero/one literal for whether all actual component words decode between the stored bounds. Literal exactness is not assumed. Inputs and flag occupy disjoint word spans; they may use the same buffer at different offsets. A fragment of the tree NLAlib.Sign.test.

NLAlib.Ops.Hermitian.boxTest_writes {K Op Tst : Type} [Inhabited K] [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine K} {dec : K → ℝ} {I : Ops.Interp Op Tst K}
  (hS : Ops.IsScalar M I) (hC : Ops.IsCmp dec I) {md : Ops.Mode} {τ : Ops.Tape K} {m : Ops.Mem K}
  {rows cols : ℕ} {x lo hi z : ℕ × ℕ} {a b : K} {xs : List K} (hl : m.Live [x, lo, hi, z])
  (hx : m.store.readBlock x.1 x.2 (2 * (rows * cols)) = some xs)
  (hlo : m.store.get lo.1 lo.2 = some a) (hhi : m.store.get hi.1 hi.2 = some b)
  (hz : z.2 < m.store.len z.1)
  (hXz : Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 (2 * (rows * cols))) (Ops.Store.inBlock z.1 z.2 1))
  (hloz : Ops.Fp.Disj (Ops.Store.inBlock lo.1 lo.2 1) (Ops.Store.inBlock z.1 z.2 1))
  (hhiz : Ops.Fp.Disj (Ops.Store.inBlock hi.1 hi.2 1) (Ops.Store.inBlock z.1 z.2 1)) :
  Ops.Writes md I τ Ops.Hermitian.boxTest (Ops.Env.frame [rows, cols] [x, lo, hi, z])
    (Ops.Store.inBlock z.1 z.2 1)
    (fun m' ↦
      m'.pos = m.pos ∧
        m'.store.get z.1 z.2 =
          some (M.lit (if Ops.InInterval dec a b (Ops.vec xs) (2 * (rows * cols)) then 0 else 1)))
    m

Full source on GitHub

Import NLAlib.Ops.Blas.HermitianTest.