Exact subexponential counting and decision for bounded-arity Boolean #CSP #
When the arity bound k is fixed and the relation semantics sem : Rel → List Bool → Bool is
computable in polynomial time on patterns of length at most k (in particular whenever
fun p : Rel × List Bool => sem p.1 p.2 is computable in polynomial time or Rel is finite),
the width-guarded forbidden-pattern compiler CSP.toCNFBounded k sem runs in polynomial time.
Its reusable encoding and compilation certificates live in Computability.PolyTime.CSP.ToCNF.
Composing with CountingNativeEndpoint.exists_counter_of_polyTime_toDeclared yields:
- Exact declared-variable counting (
CSP.exists_declaredCounter) in timeO(2 ^ (A * interpolationScale N) * (|x| + 1) ^ e)and polynomial space; - Exact occurring-variable counting (
CSP.exists_modelCounter) in timeO(2 ^ (A * interpolationScale F.numVars) * (|F| + 1) ^ e)and polynomial space via dense variable relabeling; - Subexponential-time decision (
CSP.decidableInSubexpTime_KCSP) forCSP.KCSP k semwith respect toCSP.numVars.
Source relation and library adaptations #
- Generalizing the forbidden-assignment encoding of Corollary C.2 (
7ef5c0cc, p. 52): In [OAI26k] (Appendix C, p. 52), the proof of Corollary C.2 encodes each local output test $G_i(x_{S_i}) = b_i$ of arity $|S_i| \le d$ as at most $2^d$ width-$d$ clauses forbidding the assignments to $x_{S_i}$ on which $G_i$ disagrees with $b_i$, producing an equivalent $d$-CNF formula on the same $n$ variables with no auxiliary variables (so $|G^{-1}(\vec{b})|$ equals the model count of the compiled $d$-CNF formula). This module andCslib.Logic.PL.CSP.ToCNFabstract and generalize that proof pattern to arbitrary polynomial-time computable (or finite) Boolean constraint languages of arity at mostk. - Runtime scale: As in
CountingNativeEndpoint, the sublinear exponent $\rho(n)$ of Proposition 6.4 (pp. 43–44) is formalized asinterpolationScale.
Main results #
Cslib.Complexity.CSP.computableInPolyTime_validDeclaredCSP,Cslib.Complexity.CSP.mem_vars_denseRelabel_lt_numVars,Cslib.Complexity.CSP.validDeclaredCSP_denseRelabel: polynomial-time guard and dense-relabeling validity lemmas.Cslib.Complexity.CSP.exists_counter_of_polyTime_toDeclaredCSP,Cslib.Complexity.CSP.exists_declaredCounter,Cslib.Complexity.CSP.exists_declaredCounter_of_forall,Cslib.Complexity.CSP.exists_declaredCounter_of_finite: exact subexponential declared-variable counting and polynomial-time reduction interface.Cslib.Complexity.CSP.exists_modelCounter,Cslib.Complexity.CSP.exists_modelCounter_of_forall,Cslib.Complexity.CSP.exists_modelCounter_of_finite: exact subexponential occurring-variable counting.Cslib.Complexity.CSP.decidableInSubexpTime_KCSP_of_reduction,Cslib.Complexity.CSP.decidableInSubexpTime_KCSP,Cslib.Complexity.CSP.decidableInSubexpTime_KCSP_of_forall,Cslib.Complexity.CSP.decidableInSubexpTime_KCSP_of_finite: subexponential-time decision for bounded-arity Boolean CSP and domain-polymorphicKCSPreduction lemma.
References #
- OpenAI, The Exponential Time Hypothesis is False, Section 6.4 and Appendix C.
Computing the number of distinct occurring variables CSP.numVars in unary is computable in
polynomial time.
Dense variable relabeling CSP.denseRelabel is computable in polynomial time.
The executable arity and variable-range guard CSP.validDeclaredCSP k is computable in
polynomial time.
Every variable occurring in F.denseRelabel is strictly less than F.numVars.
When every constraint scope of F has length at most k, (F.numVars, F.denseRelabel)
satisfies validDeclaredCSP k.
General polynomial-time reduction to declared-variable Boolean #CSP:
Composing any polynomial-time reduction f : α → DeclaredCSP Rel and polynomial-time validity guard
valid : α → Bool (implying validDeclaredCSP k (f x).numVars (f x).formula = true) with
CSP.toCNFBounded k sem and CountingNativeEndpoint.exists_counter_of_polyTime_toDeclared yields
an exact guarded model counter in time
O(2 ^ (A * interpolationScale (f x).numVars) * (|x| + 1) ^ e)
and polynomial space.
Declared-variable exact counting for bounded-arity Boolean #CSP (pattern-wise hypothesis).
Whenever fun R => sem R w is polynomial-time computable for each pattern w of length ≤ k, one
machine computes the exact guarded declared-variable model count
F.modelCountOn sem (Finset.range N) on every input (N, F) : DeclaredCSP Rel in time
O(2 ^ (A * interpolationScale N) * (|x| + 1) ^ e) and polynomial space.
Declared-variable exact counting for bounded-arity Boolean #CSP. For any polynomial-time
computable relation semantics sem and arity bound k, one machine computes the exact guarded
declared-variable model count F.modelCountOn sem (Finset.range N) on every input
(N, F) : DeclaredCSP Rel in time O(2 ^ (A * interpolationScale N) * (|x| + 1) ^ e) and
polynomial space.
Declared-variable exact counting for bounded-arity Boolean #CSP over a finite relation
alphabet.
Occurring-variable exact counting for bounded-arity Boolean #CSP (pattern-wise
hypothesis).
Occurring-variable exact counting for bounded-arity Boolean #CSP. For any polynomial-time
computable relation semantics sem, variable encoding encV, and arity bound k, one machine
computes F.modelCount sem on every instance F : CSP Rel V of constraint arity ≤ k in time
O(2 ^ (A * interpolationScale F.numVars) * (|F| + 1) ^ e) and polynomial space.
Occurring-variable exact counting for bounded-arity Boolean #CSP over a finite relation
alphabet.
Domain-polymorphic subexponential reduction from CSP.KCSP:
Whenever f : CSP Rel V → β is computable in polynomial time, L : Set β is decidable in
subexponential time with respect to μ : β → ℕ with μ (f F) ≤ c * F.numVars, and f F ∈ L
characterizes F.Satisfiable sem on instances of constraint arity ≤ k, CSP.KCSP k sem is
decidable in subexponential time with respect to CSP.numVars.
Subexponential-time decision for bounded-arity Boolean CSP (pattern-wise hypothesis).
Subexponential-time decision for bounded-arity Boolean CSP. For any polynomial-time
computable relation semantics sem, variable encoding encV, and arity bound k,
CSP.KCSP k sem is decidable in subexponential time in the number of occurring variables
CSP.numVars.