Segmented propagation of Boolean sources #
Each position contributes a source bit. A true link carries the previous value forward; a false link starts a new segment. The value of a prefix is true precisely when it contains a true source connected to the end by uninterrupted true links. The link at the source itself is irrelevant, including the first link.
Main definitions #
Cslib.BitString.propagate: the source/link recurrence, initialized with false.Cslib.BitString.keyLinks: link adjacent equal keys.
Main results #
Cslib.BitString.propagate_eq_true_iff: characterization by a connected true source.Cslib.BitString.propagate_sorted_eq_true_iff: on sorted keys, the output is the OR of the sources in the equal-key run ending at the last processed record.
References #
- Adapted from MassProduction/Nonuniform/{Propagation,SortedPropagation}.lean in S. Schlesinger, Boolean circuit mass production formalization.
A true value has a true source connected to the end by uninterrupted true links.
Adjacent records are linked precisely when their keys agree; the first link is false.
Instances For
In a sorted prefix, propagation reports exactly the true sources having the last key. The prefix may be empty. No uniqueness of sources or keys is required, and no order is required beyond the prefix. The explicit equality instance retains the caller's executable equality test when it differs from the one inherited from the order.