Word-RAM DP for extensional finite-domain CSPs over serialized nice tree decompositions #
This module certifies one fixed exact-basis Word-RAM (Program .exact r) program solving
extensional finite-domain CSPs whose input is a pre-serialized nice tree decomposition
together with pre-materialized constraint truth tables (TreeCSPInstance.encode).
Computational model and scope #
- External preprocessing (uncharged by the Word-RAM):
ConstraintTable.ofConstraintdeduplicates repeated variables inc.scopeand materializes aq ^ |c.scope.toFinset|-word truth table (≤ q ^ (k + 1)entries for width-kdecompositions ofF.primalGraph) before.init inst.encode.- The nice-tree theorems (
exists_program_cspDecide_nice,exists_program_cspCount_nice_singleWord) take a caller-suppliedNiceTreeDecomposition. - The demoted corollaries
exists_program_cspDecide_of_toNiceTreePrunedandexists_program_cspCount_of_toNiceTreePruned_singleWordadditionally computeR.toNiceTreePrunedexternally before.init inst.encode, so their step boundcspPrunedNiceStepBounddoes not depend on or charge the rooted decomposition's node countn. Implementing and charging rooted-to-nice normalization (Cygan et al., Parameterized Algorithms, Lemma 7.4) on the Word-RAM remains open (#9170).
- Charged Word-RAM DP phases:
- Bag materialization and erasure (
copyBagProg,eraseBagProg), - Radix decoding and Horner projection (
lookupRadixProg,radixProjProg), - Constraint truth-table scanning and indexing (
checkLeafConstraintsProg,checkIntroConstraintsProg), - Bottom-up table combination across
leaf,introduce,forget, andjoinnodes.
- Bag materialization and erasure (
- Word-width conventions:
- Decision mode (
counting = false): all DP entries lie in{0, 1}(maxEntryBound = 1), so logarithmic word widthw = O(log(m + N.size + |F.vars| + |F| + q ^ (k + 1)))suffices (TreeCSPInstance.wordBound_ofNice_le). - Single-word counting mode (
counting = true): DP entries are bounded byq ^ activeForgetCount inst.vars inst.tree(= q ^ F.numVarson valid nice tree decompositions ofF.primalGraph, eliminating spurious dependence on redundant tree nodes;TreeCSPInstance.maxEntryBound_ofNice_eq). BecauseBasis.exactexecutes single-word addition atforgetand multiplication atjoinin unit cost, counting requires wide wordsw > F.numVars · log₂ q(matching the single-word arithmetic convention ofCslibFrontier.Algorithms.WordRAM.HamiltonianCount). Logarithmic-word multi-word exact model counting remains open (#9170).
- Decision mode (
The implementation is factored under CslibFrontier.Algorithms.WordRAM.TreeDecomposition.CSP
into Model (pure DP specification, encoding, and bounds; publicly re-exported here), Radix,
BagOps, ConstraintScan, NodeDesc, parallel node handlers LeafIntro, Forget, and Join,
NodeStep, and Pass (imported privately so the top-level interface stays minimal).
Main definitions #
Cslib.Algorithms.WordRAM.TreeDecomposition.ConstraintTable: materialized truth table of a constraint overℕvariable indices (with deduplicated scope viaConstraintTable.ofConstraint).Cslib.Algorithms.WordRAM.TreeDecomposition.encodeNiceTree: post-order 4-word-per-node serialization ofNiceTree ℕ.Cslib.Algorithms.WordRAM.TreeDecomposition.activeForgetCount: active-variableforgetcount giving the tight counting-mode entry exponent.Cslib.Algorithms.WordRAM.TreeDecomposition.TreeCSPInstance: serialized extensional CSP + nice tree decomposition instance (counting = falsefor decision,counting = truefor single-word wide-word exact model counting), with constructorsofNiceTree,ofNice, and the external preprocessing helperofToNiceTreePruned.Cslib.Algorithms.WordRAM.TreeDecomposition.cspNiceStepBound,Cslib.Algorithms.WordRAM.TreeDecomposition.cspPrunedNiceStepBound: explicit FPT step-count polynomials for the nice-tree DP phase.
Main results #
Cslib.Algorithms.WordRAM.TreeDecomposition.exists_program_csp_treeDecomposition,Cslib.Algorithms.WordRAM.TreeDecomposition.uniformComputableInTime_csp_treeDecomposition: one fixed Word-RAM program computesTreeCSPInstance.resultwithinC * (inst.stepBound + 1) + 1instructions wheneverFits w inst.wordBound.Cslib.Algorithms.WordRAM.TreeDecomposition.exists_program_cspDecide_nice: logarithmic-word FPT Word-RAM satisfiability over a pre-serializedNiceTreeDecompositionand pre-materialized constraint truth tables.Cslib.Algorithms.WordRAM.TreeDecomposition.exists_program_cspCount_nice_singleWord: single-word wide-word (w > F.numVars · log₂ q, unit-costBasis.exactarithmetic) FPT Word-RAM exact model counting over a pre-serializedNiceTreeDecompositionand pre-materialized constraint tables.TreeDecomposition.exists_program_cspDecide_of_toNiceTreePruned,TreeDecomposition.exists_program_cspCount_of_toNiceTreePruned_singleWord: demoted intermediate corollaries where rooted-to-nice pruning (RootedTreeDecomposition.toNiceTreePruned) is computed externally outside the Word-RAM and uncharged (#9170; single-word wide-word counting for the second).
One fixed exact-basis Word-RAM program computes TreeCSPInstance.result within
≤ C * (inst.stepBound + 1) + 1 instructions for every word width w satisfying
Fits w inst.wordBound and InputFits w inst.encode.
Uniform exact-basis Word-RAM computability certificate for TreeCSPInstance.result.
Word-RAM Extensional CSP Decision (Supplied Nice Tree Decomposition). One fixed exact-basis
Word-RAM program decides CSP.Satisfiable sem F (returning 1 if satisfiable, 0 otherwise) from
the serialized nice tree decomposition N (N.width ≤ k) and externally materialized,
scope-deduplicated constraint truth tables (TreeCSPInstance.ofNice false ...) in
≤ C * (cspNiceStepBound q N.size k |F.vars| |F| + 1) + 1 instructions at any word width w
satisfying Fits w inst.wordBound. Because decision-mode DP entries lie in {0, 1},
TreeCSPInstance.wordBound_ofNice_le guarantees logarithmic word width
w = O(log(m + N.size + |F.vars| + |F| + q ^ (k + 1))). Tree-decomposition construction and
constraint truth-table materialization (ConstraintTable.ofConstraint) are external to the
Word-RAM and uncharged.
Single-Word Wide-Word (w > F.numVars · log₂ q) Word-RAM Extensional CSP Exact Model
Counting (Supplied Nice Tree Decomposition). One fixed exact-basis Word-RAM program computes
CSP.modelCount sem F from the serialized nice tree decomposition N (N.width ≤ k) and
externally materialized, scope-deduplicated constraint truth tables (TreeCSPInstance.ofNice true)
in ≤ C * (cspNiceStepBound q N.size k |F.vars| |F| + 1) + 1 instructions at any word width w
satisfying Fits w inst.wordBound.
On valid nice tree decompositions, inst.maxEntryBound = q ^ F.numVars
(TreeCSPInstance.maxEntryBound_ofNice_eq, independent of redundant tree nodes), so this theorem
operates in the wide-word single-register regime (w > F.numVars · log₂ q) where Basis.exact
charges unit cost for adding (forget) and multiplying (join) single-word counts (matching
CslibFrontier.Algorithms.WordRAM.HamiltonianCount). Logarithmic-word multi-word exact counting,
tree-decomposition construction, and truth-table materialization remain open (#9170).
Intermediate step (not a rooted-tree Word-RAM algorithm or a Word-RAM formalization of Cygan
et al., Parameterized Algorithms, Lemma 7.4): corollary of exists_program_cspDecide_nice in
which R.toNiceTreePruned and ConstraintTable.ofConstraint are computed externally outside the
Word-RAM and uncharged before .init inst.encode. Consequently, cspPrunedNiceStepBound bounds
only the post-normalization nice-tree DP phase and has no dependence on the input rooted tree's
node count n. Executing and charging rooted-to-nice normalization on the Word-RAM remains open
(#9170).
Intermediate step (not a rooted-tree Word-RAM algorithm, not a Word-RAM formalization of Cygan
et al., Parameterized Algorithms, Lemma 7.4, and not a logarithmic-word counting algorithm):
single-word wide-word (w > F.numVars · log₂ q, unit-cost Basis.exact arithmetic) corollary of
exists_program_cspCount_nice_singleWord in which R.toNiceTreePruned and
ConstraintTable.ofConstraint are computed externally outside the Word-RAM and uncharged before
.init inst.encode. Consequently, cspPrunedNiceStepBound bounds only the post-normalization
nice-tree DP phase and has no dependence on n. Executing and charging rooted-to-nice
normalization on the Word-RAM and logarithmic-word multi-word exact counting remain open (#9170).