Native generation of carry-lookahead circuit codes #
All constructors return the actual binary gate-and-output encoding. Widths and loop counts are unary; distances and wire references are binary. The prefix loop carries its already generated code and appends one fixed-width round at a time. Bounds on the complete intermediate encoding justify the loop, including tags, delimiters and output references.
Main definitions #
Cslib.Circuits.Boolean.CarryLookahead.stepCode: one round on raw parameters.
Main results #
Cslib.Circuits.Boolean.CarryLookahead.stepCode_eq: agreement with the typed round.Cslib.Circuits.Boolean.computableInPolyTime_carryLookahead: native generation of the complete adder code from unary width.Cslib.Circuits.Boolean.computableInPolyTime_carryLookaheadAdd,computableInPolyTime_carryLookaheadFinish: the modular and carry-save finishing codes.
The total raw neighbour rule used by the doubling layer.
Instances For
A doubling round is generated uniformly from a unary width and a binary distance.
Generate any number of doubling rounds from unary width and round count. The native loop keeps the accumulated code and unary round counter, with polynomial intermediate encoded length.
Native generation of the complete initial carry row from unary width.
Native generation of all the input carries from unary word width.
Native generation of sum-bit and carry-out wiring from unary width.
One native polynomial-time algorithm generates the entire logarithmic-depth adder code from unary width. Every binary gate reference, output reference and framing bit is charged.
The modular adder is generated by the same uniform native algorithm plus free output wiring and one hardwired carry gate.
Generate the complete carry-save finishing code, including its repeated zero output wires.