Documentation

Complexity.Algorithms.WordRAM.ThreeSum.ChanHe.TraversalDeliver

Charged native output delivery for one traversal node #

The three actual heavy counts are read from the node allocation. The packed pointer is appended to the reserved output table and the fresh heap advances past all node output and scratch cells. Address computation is repeated explicitly instead of assuming scratch-register outputs that the node builder's public contract does not export.

Main definitions #

Main results #

The layout and native composition proofs are original.

All arithmetic results of the native delivery block, including its sole memory store.

Instances For

    Delivery writes exactly one output-pointer cell; all other memory retains the node output.

    All allocated node output, residues and histogram lie below the new fresh heap.

    Each delivered count was read from its actual count-prefixed heavy array.

    Output delivery preserves the node builder's exact heavy/packed readback and allocation frame. The sole external output-pointer store is recorded explicitly in the before-memory.

    The delivered register is the existing heavy-set cardinality, not a capacity or pair count.

    All non-output controller parameters and the entire stack workspace survive delivery.

    theorem Cslib.Algorithms.WordRAM.ThreeSum.ChanHe.Traversal.deliveryState_preserves (x : WordRAM.Data 128) (i : Fin 128) (hh : i ≠ heap) (hc : i ≠ outputCount) (ht : i ≠ temporary) (hi : ↑i < 88 ∨ 96 ≤ ↑i) :

    The explicit delivered state retains every non-output controller and stack register.

    Every intermediate address and the output-count increment fit once the final endpoint fits. The output table precedes the fresh allocation, so its store cannot change a heavy-count load.