Linear-size segmented propagation circuits #
Source bits occupy the first input block and links the second. The circuit outputs every
prefix value of BitString.propagate: one false constant initializes the computation, and
each record adds an AND gate and an OR gate. Earlier values are shared wires, so the gate
count is linear even when links connect a long run.
Main definitions #
Cslib.Circuits.Boolean.propagateCircuit: all prefix values in input order.
Main results #
Cslib.Circuits.Boolean.eval_propagateCircuit: agreement with the functional recurrence.Cslib.Circuits.Boolean.eval_propagateCircuit_eq_true_iff: a connected true source exists.Cslib.Circuits.Boolean.cost_program_propagateCircuit: exact arbitrary weighted cost.Cslib.Circuits.Boolean.size_propagateCircuit: one constant and two gates per record.
Weighted cost distinguishes conventions that charge the initial constant from those that make constants free. The zero-record circuit still contains its unused initial constant. The constructor is executable; these gate counts do not certify its running time.
References #
- Adapted from MassProduction/Nonuniform/Propagation.lean in S. Schlesinger, Boolean circuit mass production formalization.
Every earlier prefix value is retained at the corresponding even-numbered gate.
Every output is the recurrence value after processing its record.
A finite-array interface: a true output has an earlier true source connected by links. The link at the source itself need not be true.
The circuit contains one false constant and two gates per record.