Binary numbers as sets of positions, and sweeps along an order #
The semantic layer of the normal form of FP
(DescriptiveComplexity.Counting.Digits): no formula appears here.
- Carries:
DescriptiveComplexity.Digits.testBit_add_iffreads a binary digit of a sum off the digits of the summands, the carry being given by lookahead (DescriptiveComplexity.Digits.Carry) rather than by a ripple – a condition with one existential and one universal quantifier over positions, hence first-order over an ordered set of positions. - Numbers over a finite linear order
Pof positions:DescriptiveComplexity.Digits.bitsOf Nis the set of positions whose rank (DescriptiveComplexity.orank) is a digit1ofN. Only the digits of rank below the number of positions are seen, so this isNmodulo2 ^ |P|(DescriptiveComplexity.Digits.bitsOf_congr), and addition, doubling and the choice between a number and zero are operations on such sets with no side condition. - Sweeps (
DescriptiveComplexity.Digits.sweep_stage): a family of rows indexed by a finite linear order, each a function of the rows before it, is computed by an inflationary iteration that marks a row done in the very step that writes it, and writes a row only when the previous one is done and it is not itself. A row is thus written once, in full, from rows that are complete – which is what lets its defining condition be an arbitrary one, negations included.
Carries #
The carry into the digit of rank i of M + N, by lookahead: some lower
rank generates a carry, and every rank in between propagates it.
Equations
Instances For
Dependency graph
A digit of a sum: the exclusive or of the digits of the summands and of the carry.
Dependency graph
Numbers over a finite linear order of positions #
The positions holding a digit 1 of N, the rank of a position being
the rank of its digit.
Equations
Instances For
Dependency graph
Only the digits of rank below the number of positions are seen.
Dependency graph
Sums and products along an order #
The sum of a family up to an index.
Instances For
Dependency graph
The product of a family strictly before an index.
Instances For
Dependency graph
Dependency graph
Dependency graph
Reading a number back from its digits #
Sweeps #
The stages of a sweep. Rows T w i indexed by a finite linear order,
each determined by the rows before it through Φ, are computed by the
iteration whose step marks a row done when it is the first or follows a done
one, and writes a row under the same condition when it is not yet done: after
s steps, the rows of rank below s are done and written, and nothing else
is.
Dependency graph
The limit of a sweep: every row is eventually written, and written right.