NLA-lib Explorer

NLAlib.Ops.Examples.runs_sq2_link

Library · theorem

The concrete corollary: sq2 linked with the triple loop computes the rounded products mmF, within the pushed-forward counts and one scratch cell. One application of the linking theorem.

NLAlib.Ops.Examples.runs_sq2_link {K : Type} [Inhabited K] {M : Ops.Machine K}
  {I : Ops.Interp Ops.ScalarOp Empty K} (hI : Ops.Examples.IsArith M I) {τ : Ops.Tape K} {n : ℕ}
  {A P S : ℕ × ℕ} {m : Ops.Mem K} {As : List K} (hAP : A.1 ≠ P.1) (hPS : P.1 ≠ S.1)
  (hA : m.store.readBlock A.1 A.2 (n * n) = some As) (hP : P.2 + n * n ≤ m.store.len P.1)
  (hS : S.2 + n * n ≤ m.store.len S.1) (hl : m.Live [A, P, S]) :
  Ops.ConditionalRuns I (fun x x_1 ↦ 0) τ (Ops.Stmt.link Ops.Examples.mmTable Ops.Examples.sq2)
    { idx := [n, A.2, P.2, S.2], buf := [A.1, P.1, S.1] } m
    ((2 * (n * n)) • Ops.Count.one (Ops.ScalarOp.lit 0) [] +
      (2 * (n * n * n)) • (Ops.Count.one Ops.ScalarOp.mul [] + Ops.Count.one Ops.ScalarOp.add []))
    1 fun x ↦
    x =
      (m.updBlock P (Ops.Examples.mmF M n n n As As)).updBlock S
        (Ops.Examples.mmF M n n n (Ops.Examples.mmF M n n n As As) (Ops.Examples.mmF M n n n As As))

Full source on GitHub

Import NLAlib.Ops.Examples.MatMul.