Selecting and packing bit-string records #
A record has a prefix key of k bits followed by a payload of p bits. Keys are unsigned
numbers with the least significant bit first. Pairwise minimum selection retains the first
record on equal keys, including empty keys. Packing places records in consecutive blocks.
Main definitions #
Cslib.BitString.recordKey: the prefix key.Cslib.BitString.keyedMinFn: a least-key record, the first on ties.Cslib.BitString.packRecords: concatenate a finite family of records.
Main results #
Cslib.BitString.keyedMinFn_eq_or_eq: selection returns one of its inputs.Cslib.BitString.equivFin_recordKey_keyedMinFn_le_left,Cslib.BitString.equivFin_recordKey_keyedMinFn_le_right: the selected key is least.Cslib.BitString.packRecords_comp: recover a record from its packed block.
References #
Adapted from Samuel Schlesinger's earlier Complexitylib modules
Circuits/{KeyedMinimum,KeyedMinimumTournament}.
The selected record is one of the two inputs.
m records of r bits packed one after the other: bit j of record i is input
finProdFinEquiv (i, j), that is i r + j.
Instances For
Reading block i of the packed records recovers record i.