Certified finite-result word glue #
A finite family of scalar GlueComputes certificates realizes one faithfully encoded result.
Supplied scalar witnesses retain their scratch and code before every runtime input and word width.
The proposition-only frontend selects witnesses by classical choice instead. All coordinates
reuse a static auxiliary bank disjoint from the output slots, and each computed coordinate is
copied into its final slot. Both those copies and the empty-vector case are charged.
optionWords supplies the shared two-word result convention needed by memory-stack and queue
clients: none is (0,0) and some v is (1,v). The payload is not incremented, so the largest
fitting word remains representable. boolWords retains a zero slot for active-loop tests; a
true tag still requires the visible word-fit condition for 1.
Main definitions #
optionWordsWith: a presence tag over any faithful payload-word encoding.optionWords: a faithful tag/payload encoding of optional natural words.boolWords: a Boolean tag with a retained zero slot for native comparisons.
Main results #
Realizes.Witness.glueVectorOfScalars: retain supplied scalar code and its maximum bank.Realizes.Witness.glueVector,Realizes.glueVector: realize a finite result using certified scalar coordinate computations, retaining or erasing the witness data.Realizes.addWords,Realizes.increment,Realizes.decrement: charged scalar word arithmetic.Realizes.returnNone,Realizes.returnSome: charged optional-word results.
This is a realization rule over the existing memory client and structured native code, not an additional program syntax or execution judgment.
The legacy scalar encoding is the one-word instance of optionWordsWith. Its original
vector presentation is retained for existing definitional and simplification clients.
Compute every output coordinate using supplied scalar code and a maximum auxiliary bank. The common domain and all coordinate envelopes remain visible, while code, exchange constant and scratch are uniform. A final neutral copy pays for the empty result without materializing a non-fitting constant.
Instances For
Existential-only frontend to Witness.glueVectorOfScalars. Each scalar witness is
choice-selected once, before runtime; no concrete scratch identity for that choice is asserted.
The supplied-data entrypoint avoids this selection and retains its maximum auxiliary bank.
Instances For
The existential realization of the retained explicitly budgeted vector witness.
Add two input words when their sum fits; both projections and the addition are charged.
Increment an input word with an explicit successor-fit condition and three local units.
Defined subtraction of one keeps positivity and the input-word envelope explicit.
Return the two zero words encoding none, charging both constants and output copies.
Return a presence tag and unshifted input payload, with both word fits explicit.
Frontier-bounded realization of a finite result vector computed by scalar glue.
Frontier-bounded pure₀ rule with absorbed native glue cost.