Documentation

CslibFrontier.Computability.Complexity.Problems.SharpFormula

Counting the satisfying assignments of a Boolean formula #

QBF.modelCount φ is the number of satisfying assignments of a formula φ: the sets of free variables of φ whose indicator makes φ true. For a quantifier-free formula, a Boolean formula not necessarily in conjunctive normal form, this is the count #(φ) of Arora and Barak, draft §9.3.2, printed p. 181, and φ belongs to their ⊕SAT (Definition 9.14) exactly when the count is odd. Cslib.Complexity.SharpSAT is the count for formulas in conjunctive normal form.

The counting verifier Cslib.Complexity.SharpFormula.verifier reads a certificate as the values of the free variables of φ without repetition, in the order of Cslib.Logic.PL.QBF.distinctFreeVars, and evaluates φ from its tokens. On a quantifier-free formula it accepts exactly one certificate of that length for each satisfying assignment (Cslib.Complexity.SharpFormula.acceptCount_verifier), and it runs in polynomial time (Cslib.Complexity.SharpFormula.computableInPolyTime_verifier).

Main definitions #

Main results #

References #

The number of satisfying assignments of φ: the sets S of free variables of φ such that φ is true when exactly the variables of S are true.

The free variables of a formula over ℕ, without repetition.

A formula has at least as many tokens as free variables, counted with multiplicity.

Each free variable takes at least three bits of the encoding.

The variables of the list vs made true by the certificate w: the variable at position i of vs takes the value of bit i of w.

The counting verifier for Boolean formulas: the certificate gives the values of the free variables in the order of distinctFreeVars, and φ is evaluated from its tokens under the assignment making exactly the variables of trueVars true.

On a quantifier-free formula the verifier evaluates it.

The counting verifier accepts one certificate for each satisfying assignment of a quantifier-free formula: certificates of length |distinctFreeVars φ|.

Polynomial time #