Reusable native sparse box-query kernel #
The actual setup writes a root record above the retained table, then the actual loop enumerates all permitted prefixes and consumes real source or table words. The caller provides original scalar contents and pure memory readback established by the real table constructor; no execution, timing, enumeration or intermediate-fitting oracle is supplied.
def Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.queryTime {L : ℕ} (m t : ℕ) (η : MatrixMultiplication.Schonhage.OutStr L) :
Complete reusable query charge, including scalar/root setup and actual loop exit.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.exec_queryProgram {w L m t AA BB D V K A B : ℕ} (x : WordRAM.Data registers) (η : MatrixMultiplication.Schonhage.OutStr L) (hη : (MatrixMultiplication.Schonhage.innerSetO η).card = m) (a b : MatrixMultiplication.Schonhage.Leaf L → ℤ) (ha : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (a τ).natAbs ≤ A) (hb : ∀ (τ : MatrixMultiplication.Schonhage.Leaf L), (b τ).natAbs ≤ B) (hL : x.regs BoxTable.Reg.levels = L) (ht : x.regs BoxTable.Reg.threshold = t) (hT : x.regs BoxTable.Reg.span = 10 ^ L) (hQ : x.regs Reg.query = ↑(PrunedQuery.queryIndex η)) (hA : x.regs BoxTable.Reg.arrayA = AA) (hB : x.regs BoxTable.Reg.arrayB = BB) (hD : x.regs BoxTable.Reg.directory = D) (hV : x.regs BoxTable.Reg.values = V) (hcount : x.regs BoxTable.Reg.count = K) (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) (hread : Readback m t D V AA BB a b x.mem) (hfit : WordRAM.Fits (w + 2) (queryAddressBound L t AA BB D V K)) (hmag : GenericRAM.Signed.Fits w ↑(magnitudeBound L A B)) :
∃ (y : WordRAM.Data registers),
WordRAM.ExecWithin (w + 2) queryProgram x y (queryTime m t η) ∧ Parameters L t (↑(PrunedQuery.queryIndex η)) AA BB D V K (V + K) y ∧ y.regs Reg.top = 0 ∧ y.regs Reg.answer = WordRAM.Signed.encode (queryValue m t η a b) ∧ Readback m t D V AA BB a b y.mem ∧ ∀ (q : ℕ), ¬(V + K ≤ q ∧ q < V + K + 5 * stackCapacity L) → y.mem q = x.mem q
Complete actual native query from original arguments and real constructed-table readback.