Correctness of the packed Boolean sorting circuit #
This module bridges the explicit flat-bit Batcher circuit to the generic
record-level correctness theorem. Keys are the initial keyWidth bits of
each record, ordered lexicographically; all remaining bits are payload and
must move with their record.
View a flat row-major bit vector as a sequence of complete records.
Equations
- Algebraic.MassProduction.Sorting.flatRecords input record = Algebraic.MassProduction.Sorting.networkRecord input record
Instances For
First-half record index with the successor-depth type made explicit.
Equations
- Algebraic.MassProduction.Sorting.firstRecordIndex depth pair = ⟨↑pair, ⋯⟩
Instances For
Second-half record index with the successor-depth type made explicit.
Equations
- Algebraic.MassProduction.Sorting.secondRecordIndex depth pair = ⟨Algebraic.MassProduction.Sorting.networkRecords depth + ↑pair, ⋯⟩
Instances For
Lexicographic key carried by the initial bits of one record.
Equations
- Algebraic.MassProduction.Sorting.flatRecordKey keyFits record = toLex fun (bit : Fin keyWidth) => record (Fin.castLE keyFits bit)
Instances For
Key-sortedness of a packed record array in the selected direction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Preservation of all complete records, including payload bits.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every output record of a complete-record permutation occurs in the input record array.
A complete-record permutation preserves unique satisfaction of every record predicate.
The packed merge refines the generic keyed record merge.
The packed sorter refines the generic keyed Batcher sorter.
The explicit packed semantics sorts all record keys.
The explicit packed semantics preserves complete records up to permutation.
The evaluated Boolean circuit sorts every key in the chosen direction.
The evaluated Boolean circuit permutes complete records and therefore cannot separate a payload from its key.