Internal weighted circuit synthesis primitives #
Internal CostSynthesis engine and zero-weight binary addition combinators shared by
AdditiveBound, BlockCols, Decomposition, Complexity, StageStep, and UpperBound; never
re-exported through Zhegalkin.
Main definitions #
Cslib.Circuits.CostSynthesis: simultaneous total-gate and weight synthesis predicate.
Main results #
Cslib.Circuits.CostSynthesis.comp,CostSynthesis.trans,CostSynthesis.union,CostSynthesis.gate,CostSynthesis.biUnion,CostSynthesis.exists_circuit_outputs,CostSynthesis.exists_circuit: synthesis combinators.Cslib.Circuits.add_two_of_mem,nonempty_sum_of_mem,sum_of_mem_of_zero,block_nonempty_subSums: zero-weight addition primitives.
Simultaneous synthesis tracking both total gate count and an auxiliary per-gate weight w
(such as andCost over {⊕, ∧, 1}).
Zero-weight binary addition primitives #
Summing a nonempty finite family of already-available wires uses #S - 1 binary addition gates
and zero weight, with no constant or zero gate needed.
Summing a finite family when (fun _ => 0) is already available uses at most #S - 1 binary
addition gates (in particular 0 gates when #S ≤ 1).
Nonempty subset sums of a block of b wires #
All 2 ^ b - 1 nonempty subset sums of b available functions cost 2 ^ b - b - 1 binary
addition gates (since the b singletons are already available).