NLAlib.Ops.Examples.dotLoop_wp
Library · theorem
The accumulation loop computes dotF in the cell z, for a store with one scratch cell on top (the operand t), input cells in other buffers than z.
NLAlib.Ops.Examples.dotLoop_wp {K : Type} {M : Ops.Machine K} {I : Ops.Interp Ops.ScalarOp Empty K}
(hI : Ops.Examples.IsArith M I) {md : Ops.Mode} {τ : Ops.Tape K} {ρ : Ops.Env} {n : Ops.IExp}
{x y z t : Ops.Operand} {N bx by' bz oz : ℕ} {fx fy : ℕ → ℕ} {s : Ops.Store K} {tb : Ops.Buf K}
{p : ℕ} {a b : ℕ → K} (hn : Ops.IExp.eval ρ.idx n = some N)
(hz0 : Ops.Operand.eval ρ z = some (bz, oz))
(hx : ∀ (k : ℕ), Ops.Operand.eval (ρ.pushIdx k) x = some (bx, fx k))
(hy : ∀ (k : ℕ), Ops.Operand.eval (ρ.pushIdx k) y = some (by', fy k))
(hz : ∀ (k : ℕ), Ops.Operand.eval (ρ.pushIdx k) z = some (bz, oz))
(ht : ∀ (k : ℕ), Ops.Operand.eval (ρ.pushIdx k) t = some (List.length s, 0))
(htb : List.length tb = 1) (hxz : bx ≠ bz) (hyz : by' ≠ bz) (hzl : oz < s.len bz)
(ha : ∀ k < N, s.get bx (fx k) = some (a k)) (hb : ∀ k < N, s.get by' (fy k) = some (b k))
{Q : Ops.Mem K → Prop}
(hQ :
∀ (tb' : Ops.Buf K),
List.length tb' = 1 →
Q { store := s.upd bz oz (Ops.Examples.dotF M a b N) ++ [tb'], pos := p }) :
Ops.Wp md I τ (Ops.Examples.dotLoop n x y z t) ρ Q { store := s ++ [tb], pos := p }Import NLAlib.Ops.Examples.Dot.