Actual native initialization of the fused Chan–He forest #
The existing snapshot, prime-table builder and layout programs prepare the same physical regions as before. The caller then computes its value envelope before the first root. Every stage executes actual native code and retains the computed frontend descriptors.
The stage contracts it composes are private to the proof-only companion
ChanHe.PreprocessingSetup; this module reads them through import all.
theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.initialize_forest {r κ n w d : ℕ} (rs : List (ℕ × ℕ)) (x : WordRAM.Data (registerCount r)) (hw : width κ d n ≤ w + 2) (hx : WordRAM.Data.Bounded (w + 2) x) (hlen : x.regs (controllerRegisters r inputLength) = n) (hans : x.regs (controllerRegisters r answer) = 0) (hfront : Frontend.Output (Frontend.layout κ n) ((n + 2) ^ κ) rs x.mem) (hparams :
ChanHe.Parameters.Output n ((n + 2) ^ κ)
(WordRAM.Data.comap Frontend.parameterRegisters (WordRAM.Data.comap (preprocessingRegisters r) x))) (hbase : x.regs (preprocessingRegisters r Frontend.descriptorBase) = (Frontend.layout κ n).descriptors) (hcount : x.regs (preprocessingRegisters r Frontend.descriptorCount) = (Frontend.layout κ n).count) (hend : x.regs (preprocessingRegisters r Frontend.heapEnd) = (Frontend.layout κ n).endpoint) (hcard : rs.length ≤ n) :
have m := ThreeSum.ChanHe.mPar n (2 * (n + 2) ^ κ);
have F := ThreeSum.ChanHe.fuel n;
∃ (y : WordRAM.Data (registerCount r)),
WordRAM.ExecWithin (w + 2)
((WordRAM.Code.rename (preprocessingRegisters r) prepareTraversal).seq
((prepareEnvelope κ).seq (WordRAM.Code.rename (controllerRegisters r) power)))
x y (13 + (2 + ((m + 1) * (7 * m + 15) + 8)) + 19 + (4 * (F + 1) + 5) + (4 * envelopeExponent κ + 8)) ∧ ForestCursor.Invariant (ChanHe.Preprocessing.arena κ n y.mem) w κ n (Frontend.layout κ n) ((n + 2) ^ κ) rs
{ index := 0, nodes := [] } y
Execute every shared preparation instruction and the value-envelope loop before the forest. Only actual frontend output and the uniform ordinary width are supplied.