Division with remainder, in unary #
Every index decomposition in an algorithmic constraint graph is a division: which edge of the original graph, which step of the walk, which copy of the gadget. This module divides one unary number by another in polynomial time, by counting up and rolling the remainder over.
Main definitions #
Complexity.dmStep— one tick of the count
Main results #
Complexity.dmStep_iterate— the count dividesComplexity.halfFn_mem_FP,Complexity.halfFn_eq— halving a length
Halving #
The counting run: divide a length by a fixed divisor.
Equations
Instances For
The quotient of a length by a fixed divisor, in unary.
Equations
Instances For
The remainder of a length by a fixed divisor, in unary.
Equations
Instances For
Dividing by a length read from the input #
The counting run with the divisor read from the argument: pair b s.
Equations
Instances For
The quotient of one length by another, in unary.
Equations
Instances For
The remainder of one length by another, in unary.
Equations
Instances For
Halving a length, in unary.