Primal graphs of constraint satisfaction problems and nice-tree DP invariants #
For a constraint satisfaction problem F : CSP Rel V, the primal graph CSP.primalGraph F
places an edge between distinct variables that appear together in the scope of some constraint of
F. Every constraint scope is therefore a clique of CSP.primalGraph F, so every constraint
scope is covered by some bag of any RootedTreeDecomposition or NiceTreeDecomposition of
CSP.primalGraph F (and likewise for CSP.activePrimalGraph F on F.vars.toFinset, which
remains finite even when V is infinite).
Over any valid SimpleGraph.NiceTree V covering all constraint scopes of F, we define the exact
partial-assignment count CSP.subtreeSatCount and recursive dynamic-programming specification
CSP.specDPCount / CSP.specDPDecide, proving the leaf, introduce, forget, and join recurrences
and the root identity CSP.specDPCount = F.modelCount sem.
Main definitions #
Cslib.Logic.PL.CSP.primalGraph: primal graph onV.Cslib.Logic.PL.CSP.activePrimalGraph: induced primal graph onF.vars.toFinset.Cslib.Logic.PL.CSP.subtreeSatCount: count of satisfying partial extensions of a bag assignment.Cslib.Logic.PL.CSP.specDPCount,Cslib.Logic.PL.CSP.specDPDecide: nice-tree DP specifications.
Main results #
Cslib.Logic.PL.CSP.isClique_scope_of_mem,Cslib.Logic.PL.CSP.exists_coversFinset_scope_of_mem: constraint scopes form cliques and lie in some bag.Cslib.Logic.PL.CSP.subtreeSatCount_leaf,Cslib.Logic.PL.CSP.subtreeSatCount_introduce,Cslib.Logic.PL.CSP.subtreeSatCount_forget,Cslib.Logic.PL.CSP.subtreeSatCount_join: exact DP recurrences.Cslib.Logic.PL.CSP.specDPCount_eq_modelCount,Cslib.Logic.PL.CSP.specDPDecide_eq_true_iff_satisfiable: correctness of the DP specification.
The primal graph of F: distinct variables sharing a constraint scope are adjacent.
The scope of every constraint of F forms a clique in F.primalGraph.
Every constraint scope of F lies in some bag of any nice tree decomposition of
F.primalGraph.
Every constraint scope of F lies in some bag of any rooted tree decomposition of
F.primalGraph.
The primal graph induced on the active variables F.vars.toFinset.
Lift a nice tree decomposition of F.activePrimalGraph into NiceTree V preserving validity,
empty root bag, width, size, and constraint-scope coverage.
Exact subtree counting and DP recurrences #
Finite set of partial assignments on S ∩ U agreeing with α on B and satisfying every
constraint of F whose scope lies inside S.
Nice-tree dynamic programming specification returning the exact number of satisfying partial
extensions on T.subtreeVerts ∩ U extending α on T.bag.
Nice-tree dynamic programming specification for satisfiability.