Counting accepting runs is parsimoniously #P-complete #
The machine bridge of the counting world. The machine M_φ of a CNF instance
(DescriptiveComplexity.satMachine) has exactly as many accepting runs as φ has
models (DescriptiveComplexity.card_haltWalk_satMachine), so the reduction of
DescriptiveComplexity.Problems.Machine.Interp is parsimonious
(DescriptiveComplexity.SatTM.sharpSat_ordered_parsimonious_sharpNtmAccept). With
membership (DescriptiveComplexity.sharpNtmAccept_mem_sharpP) this gives
DescriptiveComplexity.sharpNtmAccept_sharpP_parsimoniousComplete, andDescriptiveComplexity.mem_sharpP_iff_le_sharpNtmAccept: a counting problem is in#P– counts the witnesses of an existential second-order sentence – exactly when it reduces parsimoniously to counting the accepting runs of a nondeterministic machine within a polynomial budget. That is the definition of#Pin Valiant 1979.
Why the counts agree #
The machine branches only at the guess, and it guesses only at the variables of the formula, writing “false” at every other element. So:
- an accepting run ends on the tape of the assignment it guessed, which is a
model (
DescriptiveComplexity.good_of_haltWalk, from the run analysisDescriptiveComplexity.sat_of_guess); - every model has a run ending on its tape
(
DescriptiveComplexity.exists_haltWalk_of_good); - two runs ending on the same tape are the same run
(
DescriptiveComplexity.haltWalk_ext): a truth value once written is never overwritten, so the final tape says what each guess step wrote, and away from the guess the machine is deterministic.
The assignments the machine can guess and accept: true only at variables of the instance, and satisfying every clause.
Equations
- DescriptiveComplexity.SatGood ν = ((∀ (x : A), ν x = true → DescriptiveComplexity.SatVar x) ∧ ∀ (e : A), DescriptiveComplexity.SatCl e → ∃ (y : A), DescriptiveComplexity.SatLit e y (ν y))
Instances For
Dependency graph
Dependency graph
Dependency graph
Every model has a run: a halting walk ending on its tape.
Dependency graph
Every run is the run of a model: a halting walk ends on the tape of an assignment the machine can guess and accept.
Dependency graph
Two runs ending on the same tape are the same run.
Dependency graph
Dependency graph
The machine of a CNF instance has as many accepting runs as the assignments it can guess and accept.
Dependency graph
The machine characterization of #P #
Counting the accepting runs of a machine is parsimoniously #P-hard.
Dependency graph
Counting the accepting runs of a nondeterministic machine is
parsimoniously #P-complete. The class of this library is defined in logic;
this theorem is the bridge saying it is the machine one.
Registered in the Lax archive as
Lax366625.CountingRunsComplete.sharpNtmAccept_sharpP_parsimoniousComplete.
Dependency graph
SharpNTMAccept is #P-complete: parsimoniously, hence under subtractive
reductions.
Dependency graph
The machine characterization of #P: a counting problem counts the
witnesses of an existential second-order sentence exactly when it reduces
parsimoniously to counting the accepting runs of a nondeterministic machine.
Registered in the Lax archive as
Lax366625.CountingRunsComplete.mem_sharpP_iff_le_sharpNtmAccept.
Dependency graph
Counting accepting runs and counting models reduce to each other, parsimoniously: the counting form of the Cook–Levin correspondence.