Fixed-wire record routing primitives #
After records are sorted by (key, type), both scatter and gather use the
same local operation: a destination record copies the payload of its immediate
predecessor exactly when the predecessor has the source tag and the keys
agree. The first array position uses a fixed dummy payload. This module
builds that operation as an explicit De Morgan circuit and proves its exact
semantics and a polynomial cost bound.
Width of a record containing key bits, one type bit, and payload bits.
Equations
- Algebraic.MassProduction.Routing.recordWidth keyWidth payloadWidth = keyWidth + 1 + payloadWidth
Instances For
Flat row-major index of one bit in a routing record array.
Equations
- Algebraic.MassProduction.Routing.recordBitIndex depth keyWidth payloadWidth record bit = finProdFinEquiv (record, bit)
Instances For
Index of one key bit in a routing record.
Equations
- Algebraic.MassProduction.Routing.keyBit keyWidth payloadWidth bit = ⟨↑bit, ⋯⟩
Instances For
Index of the source/destination type bit.
Equations
- Algebraic.MassProduction.Routing.tagBit keyWidth payloadWidth = ⟨keyWidth, ⋯⟩
Instances For
Index of one payload bit in a routing record.
Equations
Instances For
Key projection from one standalone packed record.
Equations
- Algebraic.MassProduction.Routing.packedRecordKey record bit = record (Algebraic.MassProduction.Routing.keyBit keyWidth payloadWidth bit)
Instances For
Type tag from one standalone packed record.
Equations
- Algebraic.MassProduction.Routing.packedRecordTag record = record (Algebraic.MassProduction.Routing.tagBit keyWidth payloadWidth)
Instances For
Payload projection from one standalone packed record.
Equations
- Algebraic.MassProduction.Routing.packedRecordPayload record bit = record (Algebraic.MassProduction.Routing.payloadBit keyWidth payloadWidth bit)
Instances For
Key projection from one record in a flat routing array.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Type tag of one record in a flat routing array.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Payload projection from one record in a flat routing array.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record immediately before a positive array position.
Equations
- Algebraic.MassProduction.Routing.predecessor record positive = ⟨↑record - 1, ⋯⟩
Instances For
XNOR of two selected array inputs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Test one selected input bit against a hardwired Boolean tag.
Equations
- Algebraic.MassProduction.Routing.bitEqualsConstantExpression expected input = if expected = true then Algebraic.DeMorgan.Expression.input input else (Algebraic.DeMorgan.Expression.input input).not
Instances For
Equality test for the keys of two records.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Guard saying that current is a destination immediately preceded by a
same-key source record.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One output bit of a guarded predecessor-copy pass. Keys and tags are
preserved. Payload bits of a matched destination copy the predecessor;
otherwise payload is the fixed dummy value false.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Semantic guarded predecessor-copy pass.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gate count emitted for one output formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Explicit circuit implementing one complete predecessor-copy pass.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A predecessor-copy pass preserves every key bit.
A predecessor-copy pass preserves every type tag.
At a positive position, every payload bit is selected by the same same-key/source/destination guard.
The first record has no predecessor and receives the fixed dummy payload.
A correctly tagged same-key predecessor is copied exactly.
If the predecessor match condition fails, the destination receives the fixed dummy payload.
One pass has linear record-array size and linear dependence on key width.
The key together with its following tag fits in a routing record.
Gate count of a complete sort-then-predecessor-match pass.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One complete scatter-match or gather-match pass: sort by (key, tag)
and perform the guarded predecessor copy.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Direction-parameterized match pass. Descending order with source tag
true and destination tag false is useful when a subsequent canonical sort
must place destination records first without negating the tag bit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The sorting half of a match pass preserves every complete routing record before the local payload update.
Explicit cost ledger for one complete sort-and-match pass.
The direction-parameterized pass has the same cost ledger.