One-hot bit lists #
listSingle dimension index is the bit list of length dimension whose only true coordinate
is index; an index outside the dimension gives all zeros. It is the list form of a one-hot row
in an explicit relation table (CSP.Table.exactlyOne) and of the basis vector
Pi.single index true (listSingle_eq_ofFn_single in BitString.List.Operations).
Main definitions #
Cslib.BitString.listSingle: the one-hot list of a given length.
Main results #
Cslib.BitString.listSingle_eq_ofFn: an in-range one-hot list asList.ofFn.Cslib.BitString.listSingle_succ_zero,Cslib.BitString.listSingle_succ_succ: the recursive description by the first coordinate.Cslib.BitString.count_true_listSingle,Cslib.BitString.exists_listSingle_of_count_true: the one-hot lists of a given length are exactly the lists with onetruecoordinate.
A coordinate mask, with all zeros when the index is outside the requested dimension.
Instances For
An in-range one-hot list is the list of the indicator of its index.
A one-hot list at position zero starts with true.
Shifting the selected position prepends a zero.
An in-range one-hot list has precisely one true coordinate.