Counting the accepting runs of a machine #
The counting version of DescriptiveComplexity.NTMAccept, on the same vocabulary: the
number of accepting runs of the machine an instance describes – the quantity
#P was introduced to measure (Valiant 1979).
A run is counted through its layout along the positions, as in
DescriptiveComplexity.TMData.IsWalk, with two more requirements that make the layout
of a run unique (DescriptiveComplexity.TMData.IsHaltWalk):
- an accepting configuration is repeated, never left: a run is counted up to the first accepting configuration it reaches, as for a machine whose accepting states are halting;
- times that are not positions carry the initial configuration: the clock of a run is the positions, and a walk says something only there.
DescriptiveComplexity.SharpNTMAccept is the bundled counting problem; its support is
machine acceptance (DescriptiveComplexity.sharpNtmAccept_support_iff), and it
belongs to #P (DescriptiveComplexity.sharpNtmAccept_mem_sharpP): the tableau of
Fagin's argument is functionally determined by the run, so its guesses are the
runs, bijectively (DescriptiveComplexity.haltWalkEquiv). With the counting
Cook–Levin theorem this gives its textbook form,
DescriptiveComplexity.sharpNtmAccept_reduces_to_sharpSat: counting the accepting runs
of a machine reduces parsimoniously to counting the models of a CNF formula.
The converse reduction is in
DescriptiveComplexity.Problems.Machine.CountingHardness, which makes this problem
parsimoniously #P-complete and #P the class of the problems reducing to
it.
A halting walk: a walk that repeats an accepting configuration once it has reached one, and carries the initial configuration at the times that are not positions. A run from an initial configuration to the first accepting one, within the budget, has exactly one such layout.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Halting walks of agreeing machines #
Dependency graph
The relational form of a halting walk #
The three relations describe the same configuration at t' as at t.
Equations
Instances For
Dependency graph
A halting walk, guessed as three relations.
- walk : M.RelWalk Q H T
The relations are a walk.
An accepting configuration is repeated.
Times that are not positions carry the initial configuration.
Instances For
Dependency graph
A relational halting walk is a halting walk, through the configurations it describes.
Dependency graph
A halting walk is a relational halting walk, through the graphs of its configurations.
Dependency graph
The kernel #
The state at t is accepting, as a formula.
Equations
Instances For
Dependency graph
The configuration at t' is the one at t, as a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
An accepting configuration is repeated.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Times that are not positions carry the initial configuration.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The kernel of the counting problem: the kernel of machine acceptance, and the two clauses that make the tableau of a run unique.
Equations
Instances For
Dependency graph
Runs are the witnesses of the kernel #
The guess of the block describing a family of configurations: the graphs of its state, head and tape.
Equations
- DescriptiveComplexity.confAssign conf DescriptiveComplexity.TMIdx.state = fun (w : Fin 2 → A) => w 1 = (conf (w 0)).state
- DescriptiveComplexity.confAssign conf DescriptiveComplexity.TMIdx.head = fun (w : Fin 2 → A) => w 1 = (conf (w 0)).head
- DescriptiveComplexity.confAssign conf DescriptiveComplexity.TMIdx.tape = fun (w : Fin 3 → A) => w 2 = (conf (w 0)).tape (w 1)
Instances For
Dependency graph
The number of halting walks is the number of witnesses of the kernel.
Dependency graph
The counting problem #
Counting accepting runs: the number of runs of the machine described by
the instance that reach an accepting state within as many steps as there are
positions, each counted up to the first accepting configuration it reaches,
through its layout along the positions (DescriptiveComplexity.TMData.IsHaltWalk). As
for DescriptiveComplexity.NTMAccept, the well-formedness promises are folded in: an
ill-formed instance has no run.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The support of counting accepting runs is machine acceptance.
Dependency graph
Counting accepting runs is in #P: the runs are the witnesses of an
existential second-order sentence, the tableau of a run being determined by
it.
Dependency graph
The textbook counting Cook–Levin theorem: counting the accepting runs
of a machine reduces, parsimoniously, to counting the models of a CNF formula.
As on the decision side, no tableau-to-CNF encoding appears: the Σ₁
definition of a run feeds the generic parsimonious Tseitin reduction.