Model counting by tensor contraction: the fixed-density bound of Theorem 1.1 #
For every fixed clause width k, one native machine computes the number of satisfying
assignments CNF.modelCount φ of every formula φ whose clauses have at most k literals, in
time 2 ^ (A (m + 1) / √⌊log₂ (n + 2)⌋) times a polynomial in the encoding length, and in
polynomial space, where m is the number of clauses and n the number of variables
(ContractionCounting.exists_modelCounter). For formulas with at most D n clauses this is
time 2 ^ O_{k,D}(n / √log n) times a polynomial, the fixed-density bound of Theorem 1.1 of
[OAI26k] (ContractionCounting.exists_modelCounter_fixedDensity). Measured by the number
N of literal occurrences instead, the time is 2 ^ (A (N + 1) / √⌊log₂ (N + 2)⌋) times a
polynomial (ContractionCounting.exists_modelCounter_occurrences), with no logarithm of the number
of variables in the exponent; this form extends to formulas of unbounded clause width
(Cslib.Complexity.ContractionCounting.exists_modelCounter_unboundedWidth).
The machine is the proof of Appendix D.2: it writes out the clause network of the formula
(Cslib.Circuits.Frontier.ClauseNetwork.clauseNetwork), whose contraction is the model count,
and contracts it modulo 2 ^ (3 N), where N is the number of literal occurrences, with the
contraction algorithm of Theorem D.1 (CountingSimulation.fastContractionAlgorithm). The network
has s = 3 N edges, at most 3 N vertices and degree at most max k 4, so it is admissible at
size s and the contraction takes 2 ^ O(s / √log s) steps; since n + 2 ≤ s ≤ 3 k m, the
exponent is O_k(m / √log n). Formulas that are empty, have an empty clause or have a clause
longer than k are answered directly.
This does not prove the arbitrary-density bound 2 ^ O_k(n log log n / √log n) of Theorem 1.1,
which Appendix D.3 obtains from Theorem D.1 with truncation order ℓ = n + 1; the contraction
algorithm here has ℓ = 1. For dense formulas the exponent above exceeds n; the
interpolation-scale counter CountingNativeEndpoint.exists_modelCounter remains the bound for
them.
Main results #
Cslib.Complexity.ContractionCounting.exists_modelCounter: the counter, with exponentA (m + 1) / √⌊log₂ (n + 2)⌋.Cslib.Complexity.ContractionCounting.exists_modelCounter_occurrences: the counter, with exponentA (N + 1) / √⌊log₂ (N + 2)⌋forNliteral occurrences.Cslib.Complexity.ContractionCounting.exists_modelCounter_fixedDensity: for each density boundD, exponentA (n + 1) / √⌊log₂ (n + 2)⌋on formulas with at mostD nclauses.
References #
- OpenAI, The Exponential Time Hypothesis is False, Theorem 1.1 (p. 2), Appendix D.2 (p. 54) and Theorem D.1 (p. 53).
The formulas handed to the contraction algorithm: nonempty, with every clause of between one
and k literals.
The input of the contraction algorithm: the precision 3 N, for N literal occurrences, and
the clause network.
The answer off the guard: one for the empty formula, zero otherwise.
The count computed by the machine.
The machine: the guard, then the contraction algorithm on the clause network or the direct answer.
Correctness #
A formula whose clauses are nonempty has at least as many literals as clauses.
The machine counts models of every formula whose clauses have at most k literals.
Resources #
Admissibility: the clause network of a guarded formula with N literal occurrences is
admissible at size 3 N, its number of edges, with constant k + 4.
Model counting by tensor contraction. For each clause width k, one machine computes
φ.modelCount on every formula φ whose clauses have at most k literals, in time
2 ^ (A (m + 1) / √⌊log₂ (n + 2)⌋) times a polynomial in the encoding length and in polynomial
space, where m is the number of clauses and n the number of variables.
Model counting by tensor contraction, measured by literal occurrences. For each clause
width k, one machine computes φ.modelCount on every formula φ whose clauses have at most k
literals, in time 2 ^ (A (N + 1) / √⌊log₂ (N + 2)⌋) times a polynomial in the encoding length
and in polynomial space, where N is the number of literal occurrences. Unlike
exists_modelCounter, the exponent does not divide by the logarithm of the number of variables,
so it stays O(N / √log N) for formulas with many clauses on few variables.
The fixed-density bound of Theorem 1.1. For each clause width k, one machine computes
φ.modelCount on every formula φ whose clauses have at most k literals, in polynomial space,
and for each density D its time on formulas with at most D n clauses, for n variables, is
2 ^ (A (n + 1) / √⌊log₂ (n + 2)⌋) times a polynomial in the encoding length. The machine, its
time and space functions and the degree e of the polynomial are fixed before D; only A
depends on D.