Collision flags returned to their original records #
Sort by a collision key, mark adjacent duplicates, and sort by a preserved identifier. Every original record returns to its literal input position, together with a flag reporting whether another original record has its key.
Duplicate flag prepended to a marked record.
Equations
- Algebraic.MassProduction.Nonuniform.MarkDuplicates.flag record = record (Fin.castAdd recordWidth 0)
Instances For
Original bits carried by a marked record.
Equations
- Algebraic.MassProduction.Nonuniform.MarkDuplicates.body record bit = record (Fin.natAdd 1 bit)
Instances For
Regard one Boolean duplicate flag per record as a width-one array.
Equations
- One or more equations did not get rendered due to their size.
Instances For
flagsArrayCircuit has exactly the gates of AdjacentDuplicates.circuit; the surrounding
wiring adds none.
Attach the global duplicate flags to complete original records.
Equations
- One or more equations did not get rendered due to their size.
Instances For
markCircuit has exactly the gates of RecordArray.combine; the surrounding wiring adds
none.
Marking adds one flag and preserves every original bit.
The complete sort-mark-restore circuit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact gate count of circuit.
Distinct increasing input identifiers restore both the original records and their exact duplicate flags to fixed output positions.
Sorting and marking costs are additive, with linear record-count dependence throughout all three stages.