Exact output contract for complete native Chan–He node construction #
The output uses the existing mathematical heavy subsets and Node.oneArray. A heavy array
contains each selected integer once, preceded by its exact cardinality. The
packed array has 4N cells, including every sentinel and padded cell. Memory outside the
explicit allocation and caller registers 46–55 are preserved.
Main results #
NodePacking.exec_spec: complete native execution and exact semantic readback.NodePacking.Output.packed_square: exact native readback at the common8m²length.NodePacking.abs_oneArray_le: the node magnitude bound is60U+40.
These programs and composition proofs are original. The mathematical comparator is the existing Chan–He development; no host-level output is substituted for native execution.
Exact semantic readback from the concrete native allocation.
- heavy (j : Fin 3) : ∃ (zs : List ℤ), zs.Nodup ∧ zs.toFinset = ThreeSum.ChanHe.heavy (Finset.image (values j) (Finset.range (L.n j))) L.M ∧ after (L.descriptor j) = zs.length ∧ ∀ (k : ℕ) (hk : k < zs.length), after (L.heavy j + k) = WordRAM.Signed.encode zs[k]
Each compact list enumerates precisely the existing heavy set, without duplicates.
- packed (u : ℕ) : u < 4 * L.N → after (L.packed + u) = WordRAM.Signed.encode ((node L values).oneArray L.U u)
Every packed cell equals the existing mathematical node array.
All memory outside the fresh allocation retains its old contents.
Instances For
The native descriptor is the cardinality of the existing heavy set.
The complete fixed native program constructs all three exact heavy outputs and the exact packed node array, charging setup, clearing, padding, signed tags, every address and count store, and every actual residue/histogram call. Initial output and scratch contents are arbitrary.
The supplied magnitude bound transfers to the existing finite-set notion.
Exact readback at the full preprocessing's common length, with no extra padding assumption.