Finite-domain constraint satisfaction problems and Boolean reduction #
This module formalizes the canonical reduction from finite-domain constraint satisfaction
problems (CSPs) over domain size q to Boolean CSPs. The finite-domain encoding is a standard
extension (ruling out non-domain bit patterns with validity constraints) that builds on the
Boolean subexponential counting framework of [OAI26c], Corollary C.2 / Theorem 1.1.
Each domain variable in a domain of size q is encoded by b = max 1 (Nat.clog 2 q) Boolean
variables. Unused bit patterns in [q, 2^b) are ruled out by domain-validity constraints of
scope length b for each declared variable v < N. Original constraints of arity r are
translated to Boolean constraints of scope length r * b. When every constraint has arity at
most k, the compiled Boolean CSP has constraint scope lengths bounded by max 1 k * b, and
the number of satisfying assignments on declared variables is exactly preserved.
Main definitions #
Cslib.Logic.PL.CSP.bitWidth: the number of bitsb = max 1 (Nat.clog 2 q)for domainq.Cslib.Logic.PL.CSP.bitScope: the list ofbBoolean variables representing domain variablev.Cslib.Logic.PL.CSP.decodeChunks: extract decoded natural numbers from chunked bit lists.Cslib.Logic.PL.CSP.toFin: clamped conversion of natural numbers intoFin q.Cslib.Logic.PL.CSP.semBoolean: the Boolean semantics evaluating domain-validity (none) and original relation (some R) constraints.Cslib.Logic.PL.CSP.toBoolean: compilation of a finite-domain CSP on declared variables0, …, N - 1into an equivalent Boolean CSP.
Main results #
Cslib.Logic.PL.CSP.all_length_le_toBoolean: constraint scope length boundmax 1 k * bitWidth q.Cslib.Logic.PL.CSP.vars_toBoolean_subset,Cslib.Logic.PL.CSP.numVars_toBoolean_le: all variables bounded byN * bitWidth q.Cslib.Logic.PL.CSP.validDeclaredCSP_toBoolean: validity of compiled Boolean CSP on declared variables.Cslib.Logic.PL.CSP.modelCountOn_toBoolean,Cslib.Logic.PL.CSP.satisfiable_toBoolean: exact equality of declared-variable model counts and satisfiability equivalence between the finite-domain CSP and its Boolean compilation.
References #
- OpenAI, The Exponential Time Hypothesis is False, Appendix C.2, Corollary C.2.
Binary encoding and conversions #
The number of bits needed to encode a domain of size q. Always at least 1.
Instances For
The b Boolean variables representing domain variable v.
Instances For
Boolean reduction for finite-domain CSP #
Boolean semantics for compiled finite-domain constraints:
none: domain-validity constraint asserting lengthbandlsbValue bs < q.some R: relation constraint decodingbsinto $r$ chunks of lengthband evaluatingsem R.
Instances For
Compile a finite-domain CSP on declared variables 0, …, N - 1 into an equivalent Boolean CSP.
Emits a domain-validity constraint (none, bitScope b v) for every v < N, and translates each
constraint (R, vs) to (some R, vs.flatMap (bitScope b)).
Instances For
Model count equivalence #
Count-preserving bijection for finite-domain CSP to Boolean CSP.
The declared-variable model count of a finite-domain CSP on 0, …, N - 1 equals the
declared-variable model count of its compiled Boolean CSP on 0, …, N * bitWidth q - 1.
F.toBoolean q N is satisfiable under CSP.semBoolean q sem if and only if F is
satisfiable under sem, whenever all occurring variables of F are < N.