Native generation of carry-save circuits #
Fixed three-input formula templates generate each sum and carry bit. The lowest carry bit is a
constant, so the carry blocks have different gate counts. appendCodes assembles their actual
codes without padding. Composition then generates the existing four-to-two reducer.
The width is unary, and all emitted gate and output references are binary. These certificates charge the full code and hold uniformly at every width, including zero.
Main definitions #
Cslib.Circuits.Boolean.csa3to2Code: raw code generation for the three-to-two reducer.Cslib.Circuits.Boolean.csa4to2Code: raw code generation for the four-to-two reducer.
Main results #
Cslib.Circuits.Boolean.csa3to2Code_eq_code,Cslib.Circuits.Boolean.csa4to2Code_eq_code: exact agreement with the existing circuits.Cslib.Circuits.Boolean.computableInPolyTime_csa3to2,Cslib.Circuits.Boolean.computableInPolyTime_csa4to2: uniform native constructors.
References #
The underlying carry-save circuits are formalized in Boolean.CarrySave, following
Chandra, Stockmeyer and Vishkin and
Vollmer, Chapter 1.
Generation preserves the exact existing circuit, including its unequal carry-bit blocks.
The actual three-to-two reducer has a uniform native generator on unary widths.
The generated code is exactly the existing four-to-two circuit's code.
The actual four-to-two reducer has a uniform native generator on unary widths.