Native branching in memory-client realizations #
The branch test reads only the encoded live words. Both alternatives have uniform emitters; only the selected alternative's domain, fit obligations and local work are required at runtime. The two-instruction allowance includes the jump on the negative path.
Main definitions #
test: interpret an existing native condition on a word-vector environment.
Main results #
test_rename: a renamed native condition tests the words in its source registers.branchPrefix_layout,branch_cost_le: prefix-bank layout, frame weakening and cost relaxation.Realizes.Witness.branch: retain a native conditional with one shared temporary bank.Realizes.branch: erase the supplied branch witness when only existence is needed.
Restricting a temporary bank tmp to a prefix Fin.castLE h preserves injectivity and
disjointness from src and frontier, and weakens a prefix frame to a frame on tmp.
Both alternatives reuse the same temporary prefix: only the larger scratch bank is reserved. The native conditional charges control and requires only the selected domain/work; the supplied code and resource fields remain data before all runtime values.
Instances For
Both branch emitters precede all runtime values. Shared result slots and disjointness from live inputs are synthesized internally; the entry domain and work charge select the actual path.
Frontier-bounded conditional realization.
Frontier-bounded branching with the test and jump absorbed (work = 0).