NLAlib.HutchPlusPlus.sketch_writes
Library ยท theorem
Draw and apply a sketch, retaining its exact tape window and removing its scratch. The statement includes zero dimensions and does not assume sample independence. A fragment of NLAlib.HutchPlusPlus.estimateRoutine: run only inside its tree, on its operands and the buffers it allocates.
NLAlib.HutchPlusPlus.sketch_writes {๐ Op Tst : Type} [RCLike ๐] [Ops.Has Ops.StoredOperatorOp Op]
[Ops.Has Ops.SampleOp Op] {I : Ops.Interp Op Tst ๐} {ฯ : Ops.Tape ๐} {m : Ops.Mem ๐}
{dataLength : โ โ โ โ โ} {matrix : (m n : โ) โ List ๐ โ Matrix (Fin m) (Fin n) ๐}
(hI : Ops.StoredOperator.IsExact dataLength matrix I) (hSample : Ops.IsSample I) (stream : โ)
{n k : โ} {data b : โ ร โ} (as : List ๐) (hl : m.Live [data, b])
(hA : m.store.readBlock data.1 data.2 (dataLength n n) = some as)
(hBA :
Ops.Fp.Disj (Ops.Store.inBlock b.1 b.2 (k * n))
(Ops.Store.inBlock data.1 data.2 (dataLength n n)))
(hb : b.2 + k * n โค m.store.len b.1) :
Ops.Writes Ops.Mode.total I ฯ (HutchPlusPlus.sketch stream) (Ops.Env.frame [n, k] [data, b])
(Ops.Store.inBlock b.1 b.2 (k * n))
(fun m' โฆ
m'.pos = m.pos + n * k โง
m'.store.readBlock b.1 b.2 (k * n) =
some
((Ops.EntryCodec.scalar ๐).packFinMatrix
(matrix n n as *
(Ops.EntryCodec.scalar ๐).matrix n k (ฯ.window stream m.pos (n * k)))))
mImport NLAlib.Estimation.Trace.HutchPlusPlus.Sketch.