Protected original data for a real record consumer #
The original arrays, selected record and original interleaved queries all precede the actual
producer heap. These bounds are derived from Instances.Output and membership in the existing
finite instance family. A product execution can therefore preserve the actual words needed
by candidate recovery without copying the catalogue or snapshotting its workspace.
theorem Cslib.Algorithms.WordRAM.ExactTriangle.RecordWitness.record_view {n D g p : ℕ} (values : ℕ → ℤ) (initial y : WordRAM.Data 64) (h : Instances.Output n D g p values initial y) (hD : 16 ≤ D) (hDn : D ≤ n) (hg : 1 ≤ g) (hp : p ≠ 0) (idx : ExactTriangle.InstanceIndex p) (hidx : idx ∈ ExactTriangle.instanceIndices (fun (a b : Fin n) => values (Matrix.pairIndex (a, b))) D g p) :
have ord := RecordProduct.recordOrdinal n D g p values idx;
have base := y.regs Instances.output + ord * (6 + 2 * (n * D));
have q := RecordProduct.recordQueries n D p idx;
have Q := RecordProduct.recordQueryCount n D p values idx;
5 + 3 * (n * n) ≤ y.regs Instances.heap ∧ base + 6 ≤ y.regs Instances.heap ∧ q + 2 * Q ≤ y.regs Instances.heap ∧ idx.piece * ExactTriangle.pieceSize D g ≤ n ∧ (∀ (j : Fin 6), y.mem (base + ↑j) = ![↑idx.residue, idx.piece, q, Q, base + 6, base + 6 + n * D] j) ∧ (∀ j < Q, y.mem (q + 2 * j) < n ∧ y.mem (q + 2 * j + 1) < n) ∧ ∀ j < 5 + 3 * (n * n), y.mem j = initial.mem j
Read the real selected record and prove every subsequent read is in the protected prefix. The native program obtains these fields by loads; this theorem only derives their meaning.