Fine-grained complexity of finite-domain #CSP and k-CSP #
This module proves that the binary-encoding compilation Cslib.Logic.PL.CSP.toBoolean from
finite-domain CSPs over Fin q to Boolean CSPs runs in polynomial time on the native encoding
encDeclaredCSP encRel (with compiled encoding length polynomially bounded in
the native input encoding length), and composes it with the subexponential bounded-arity Boolean
#CSP and k-CSP endpoints (Cslib.Complexity.CSP) to obtain native subexponential counting and
decision over any fixed finite domain size q and arity bound k:
- Polynomial-time compilation (
CSP.computableInPolyTime_toBoolean,CSP.computableInPolyTime_toBooleanDeclared,CSP.polyBounded_length_toBooleanDeclared): compiling(N, F) : DeclaredCSP Relto(N * CSP.bitWidth q, F.toBoolean q N)is computable in polynomial time fromencDeclaredCSP encReltoencDeclaredCSP (encOption encRel). - Native declared-variable counting (
CSP.exists_declaredCounter_finiteDomain_of_forall,CSP.exists_declaredCounter_finiteDomain): one machine onencDeclaredCSP encRelcomputes the exact guarded declared-variable model countF.modelCountOn sem (Finset.range N)in timeO(2 ^ (A * interpolationScale N) * (|x| + 1) ^ e)and polynomial space in the native finite-domain input length|x|. - Native occurring-variable counting (
CSP.exists_modelCounter_finiteDomain_of_forall,CSP.exists_modelCounter_finiteDomain): one machine onencCSP encRel encVcomputesF.modelCount semfor every instanceF : CSP Rel Vof constraint arity≤ kin timeO(2 ^ (A * interpolationScale F.numVars) * (|F| + 1) ^ e)and polynomial space via dense variable relabeling. - Subexponential decision (
CSP.decidableInSubexpTime_finiteDomainKCSP_of_forall,CSP.decidableInSubexpTime_finiteDomainKCSP):CSP.KCSP k semoverFin qis decidable in subexponential time with respect toCSP.numVars.
Main results #
Cslib.Complexity.CSP.computableInPolyTime_bitScope,Cslib.Complexity.CSP.computableInPolyTime_toBoolean,Cslib.Complexity.CSP.computableInPolyTime_toBooleanDeclared,Cslib.Complexity.CSP.polyBounded_length_toBooleanDeclared: polynomial-time compilation and output-length bound forCSP.toBoolean.Cslib.Complexity.CSP.exists_declaredCounter_toBoolean: transfer lemma on the compiled Boolean encoding.Cslib.Complexity.CSP.exists_counter_of_polyTime_toFiniteDeclaredCSP,Cslib.Complexity.CSP.exists_declaredCounter_finiteDomain_of_forall,Cslib.Complexity.CSP.exists_declaredCounter_finiteDomain: native declared-variable exact counting and polynomial-time reduction interface for finite-domain#CSP.Cslib.Complexity.CSP.exists_modelCounter_finiteDomain_of_forall,Cslib.Complexity.CSP.exists_modelCounter_finiteDomain: native occurring-variable exact counting for finite-domain#CSP.Cslib.Complexity.CSP.decidableInSubexpTime_finiteDomainKCSP_of_forall,Cslib.Complexity.CSP.decidableInSubexpTime_finiteDomainKCSP: subexponential-time decision for bounded-arity finite-domainCSP.
References #
- OpenAI, The Exponential Time Hypothesis is False, Appendix C.2, Corollary C.2.
Polynomial-time compilation to Boolean CSP #
Expanding a variable index v into its b-bit variable block CSP.bitScope b v is
computable in polynomial time.
Compiling a finite-domain CSP on declared variables 0, …, N - 1 into its equivalent Boolean
CSP x.formula.toBoolean q x.numVars is computable in polynomial time from the native encoding
encDeclaredCSP encRel.
Compiling a declared finite-domain CSP (N, F) into the declared Boolean CSP
(N * CSP.bitWidth q, F.toBoolean q N) is computable in polynomial time.
The compiled Boolean CSP encoding length is polynomially bounded in the native finite-domain input encoding length.
Pattern-wise polynomial-time computability of the compiled Boolean semantics
CSP.semBoolean q sem. Whenever fun R => sem R w is computable in polynomial time for each
domain tuple w : List (Fin q) of length at most max 1 k, fun oR => CSP.semBoolean q sem oR bw
is computable in polynomial time for every bit pattern bw of length at most
max 1 k * CSP.bitWidth q.
Exact counting and decision endpoints #
Declared-variable model counting transfer via Boolean compilation.
For any fixed domain size q, arity bound k, and finite relation alphabet Rel with semantics
sem : Rel → List (Fin q) → Bool, evaluating the bounded-arity Boolean CSP counter on the
compiled Boolean instance (x.numVars * CSP.bitWidth q, x.formula.toBoolean q x.numVars) computes
the exact
declared-variable model count x.formula.modelCountOn sem (Finset.range x.numVars) for every valid
finite-domain instance x of constraint width at most k.
General polynomial-time reduction to declared-variable finite-domain #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.computableInPolyTime_toBooleanDeclared and CSP.exists_counter_of_polyTime_toDeclaredCSP,
and rescaling interpolationScale ((f x).numVars * bitWidth q) via interpolationScale_mul_le,
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 finite-domain #CSP (pattern-wise
hypothesis). Whenever fun R => sem R w is computable in polynomial time for each domain tuple
w : List (Fin q) of length at most max 1 k, one native machine on
encDeclaredCSP encRel computes the exact guarded declared-variable model count
F.modelCountOn sem (Finset.range N) on every input x = (N, F) : DeclaredCSP Rel in time
O(2 ^ (A * interpolationScale N) * (|x| + 1) ^ e) and polynomial space in the native finite-domain
input length |x|.
Declared-variable exact counting for bounded-arity finite-domain #CSP over a finite relation
alphabet. For any fixed domain size q, arity bound k, and finite relation alphabet Rel, one
native machine on encDeclaredCSP encRel computes the exact guarded
declared-variable model count F.modelCountOn sem (Finset.range N) on every input x = (N, F) in
time O(2 ^ (A * interpolationScale N) * (|x| + 1) ^ e) and polynomial space.
Occurring-variable exact counting for bounded-arity finite-domain #CSP (pattern-wise
hypothesis).
Occurring-variable exact counting for bounded-arity finite-domain #CSP over a finite
relation alphabet.
Subexponential-time decision for bounded-arity finite-domain CSP (pattern-wise
hypothesis).
Subexponential-time decision for bounded-arity finite-domain CSP over a finite relation
alphabet.