Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxBatch.Exec

Correctness and charged execution of a native sparse-query batch #

The original wanted codes lie below the retained table's end, and answers lie above the query stack. Each query preserves both the original codes and all earlier answers. The bound sums actual sparse query allowances and charges six further instructions per wanted code, plus two for final loop exit. Empty lists execute only that exit.

Persistent ordinary arguments of the reused tile; no execution or resource fields.

The actual native batch charge, including every load, store, cursor increment and loop test.

Original addresses cover the reused kernel, batch cursors and their one-past-end values.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxBatch.exec_queryProgram {w L m t AA BB D V K A B Q O : ℕ} (qs : List (MatrixMultiplication.Schonhage.OutStr L)) (x : WordRAM.Data registers) (hx : Arguments L t AA BB D V K x) (hnext : x.regs Reg.next = Q) (hstop : x.regs Reg.stop = Q + qs.length) (hout : x.regs Reg.output = O) (a b : MatrixMultiplication.Schonhage.Leaf L → ℤ) (ha : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (a τ).natAbs ≤ A) (hb : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (b τ).natAbs ≤ B) (hη : ∀ η ∈ qs, (MatrixMultiplication.Schonhage.innerSetO η).card = m) (hcodes : ∀ (i : Fin qs.length), x.mem (Q + ↑i) = ↑(PrunedQuery.queryIndex (qs.get i))) (hK : K = (MatrixMultiplication.Schonhage.boxes L m t).card) (hAA : AA + 10 ^ L ≤ V + K) (hBB : BB + 10 ^ L ≤ V + K) (hDir : D + (m - t + 1) * 10 ^ L ≤ V + K) (hQ : Q + qs.length ≤ V + K) (hO : V + K + 5 * BoxQuery.stackCapacity L ≤ O) (hread : BoxQuery.Readback m t D V AA BB a b x.mem) (hfit : WordRAM.Fits (w + 2) (addressBound L t AA BB D V K Q O qs.length)) (hmag : GenericRAM.Signed.Fits w ↑(BoxQuery.magnitudeBound L A B)) :
∃ (y : WordRAM.Data registers), WordRAM.ExecWithin (w + 2) queryProgram x y (queryTime m t qs) ∧ Arguments L t AA BB D V K y ∧ y.regs Reg.next = Q + qs.length ∧ y.regs Reg.stop = Q + qs.length ∧ y.regs Reg.output = O + qs.length ∧ (∀ (i : Fin qs.length), y.mem (O + ↑i) = WordRAM.Signed.encode (BoxQuery.queryValue m t (qs.get i) a b)) ∧ BoxQuery.Readback m t D V AA BB a b y.mem ∧ ∀ (p : ℕ), ¬(V + K ≤ p ∧ p < V + K + 5 * BoxQuery.stackCapacity L ∨ O ≤ p ∧ p < O + qs.length) → y.mem p = x.mem p

Execute all wanted codes against one actual retained table. The input list may be empty or contain duplicates. The same final memory stores every answer in order and preserves source/table readback and all words outside the stack and output intervals.