One fixed queue dispatcher over realized physical-array methods #
The finite method family chooses all code and register packing before any runtime count, base, capacity, width, memory or operation. Only the tag and payload are delivered by the external dynamic calling convention. The count words, base, capacity and frontier remain resident. A native branch selects a body, and two actual copies commit its returned counts.
The initializer is a literal-parameterized code family, as in the original queue: base and
capacity are fixed before the arbitrary dirty entry data. It writes registers only, performs
six instructions, and reserves exactly 2*capacity physical cells. It is not a memory-clearing
initializer or an uncharged use of Backend.install.
Main definitions #
family,program: the finite body family and its fixed native dispatcher.implementation: the existing dynamic-program calling convention and typed observation.Rep,QueueRep,footprint: the original two physical arrays with resident count words.initializeCode,initialized: six register writes and their exact state.
References #
The queue and its algorithmic references are in Cslib.DataStructure.Queue.Spec.
One fixed family contains both method bodies. Runtime arguments select no new code.
Certificate.ofRealizes takes each body, its scratch size and its exchange factor by classical
choice from an existential Realizes proof, so registers and Backend.factor family are fixed
natural numbers whose values this construction does not determine.
One finite register file for both bodies and the dispatcher.
The complete physical reservation, including unused array cells.
Persistent count, layout and payload bank. Both tags have the same five-word input.
The two counts occupy the first two words of this common result prefix.
Tag delivery reuses scratch word zero, which the selected body may overwrite.
A paid zero constant for the native tag test, also in the shared scratch bank.
Two paid copies update the resident count bank.
The same native program executes every operation. No host-selected body is substituted.
Only the tag and payload are external inputs. The result decoder observes Unit for enqueue and the faithful option tag/value for dequeue; enqueue need not echo its argument.
A dequeue observes only a canonical zero/one option tag and its unmodified payload word.
The existing two-array representation, with counts and layout in the shared input bank. Unused cells and the delivered tag/payload impose no extra memory or register premise.
- bounded : WordRAM.Data.Bounded w x
The same logical FIFO projection as the original queue.
The actual resident input words, without installing the maintained metadata again.
Rear credit is scaled by the single native exchange factor. This definition does not assert the still separate dispatcher clock or the final per-call amortized inequality.
Exact initialized data: only the frontier, counts, layout and zero scratch word change.
A literal base/capacity initializer with the original uniform six-instruction cost.
Initialization starts from arbitrary bounded dirty data and keeps every memory cell.
The original Fits w 1 premise is needed by operation tag delivery, not these zero writes.