Adding up binary weights along the item order #
The certificate of a binary-weighted problem walks the items in order and
carries the running total: PS i is the total over the chosen items up to
i, and Cy i the carries of the step that appends i. The conditions the
walk must satisfy – every bit the exclusive or of the three inputs, every
carry their majority, no carry into the lowest position, none out of the
highest – are DescriptiveComplexity.IsChain, and this file proves the two
statements the Σ₁ definitions need:
DescriptiveComplexity.chain_sound: a walk really does compute the running totals, so at the last item it computes the total;DescriptiveComplexity.exists_chain: whenever the total fits in the positions, a walk exists – the certificate a yes-instance offers.
Nothing here mentions a vocabulary: the items, their order and the bit positions are all parameters, because the clients need different ones.
- Knapsack walks the instance's own positions, its running totals being bounded by the target, which is written there;
- Partition cannot – each half is
total / 2, which may exceed every number the instance can write – so it walks the wider positions ofDescriptiveComplexity.Numbers.Wide; - 0-1 integer programming walks the same positions as Knapsack but needs one walk per row, so its guessed relations carry a row argument and each slice is a walk of its own.
Partial sums along the item order #
The running total of the weights w over the chosen items up to i.
Instances For
Dependency graph
Walks along the item order #
The bit that an item contributes at a position: its own bit, if chosen.
Equations
- DescriptiveComplexity.ChainAdd S wt i p = (S i ∧ wt i p)
Instances For
Dependency graph
A ripple-carry walk along the items: PS i is the running total up to
i and Cy i the carries of the step appending i.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A walk computes the running totals.
Dependency graph
A walk exists whenever the total fits in the positions: this is the certificate a yes-instance offers.
Dependency graph
A walk is determined by the chosen items #
What a definition that counts certificates needs: the conditions of a walk read the running totals only at items and positions, and the carries only at the items that have a predecessor, and there they are forced.
Dependency graph
The conditions of a walk only read the totals at items and positions, and the carries at the items that have a predecessor.
Dependency graph
Two walks of the same chosen items agree, wherever the conditions of a walk read them: the running totals are the partial sums, and each carry is the majority of three values already known.