Partition functions of weighted constraint satisfaction problems #
A weighting wt : Rel → List D → R reads each relation symbol as a function from local
assignments to a semiring R. The partition function of a CSP instance F : CSP Rel V
sums, over the assignments of the variables occurring in F to the finite domain D, the product
of the weights of the constraints at their scopes:
F.partitionFunction wt = ∑ σ, ∏ (R, vs) ∈ F, wt R (vs.map σ).
With 0/1 weights this is the model count of the relation semantics
(CSP.partitionFunction_boole). Weighted counting problems such as the hard-core model, or the
number of perfect matchings as a Holant problem with edge variables, are instances with other
weightings.
Main definitions #
Cslib.Logic.PL.CSP.weight: the product of the constraint weights at an assignment.Cslib.Logic.PL.CSP.partitionFunction: the sum of the weights over the assignments of the occurring variables.
Main results #
Cslib.Logic.PL.CSP.partitionFunction_boole: with0/1weights it isCSP.modelCount.Cslib.Logic.PL.CSP.map_partitionFunction: semiring homomorphisms commute with the partition function, including evaluation of polynomial weights.Cslib.Logic.PL.CSP.partitionFunction_le_prod: a separate bound for each relation gives the product of those bounds times the number of assignments.Cslib.Logic.PL.CSP.partitionFunction_le: it is at most|D| ^ n * W ^ mwhen every weight is at mostW, fornvariables andmconstraints.Cslib.Logic.PL.CSP.partitionFunction_eq_zero_of_mem: a constraint of weight zero makes it zero.Cslib.Logic.PL.CSP.partitionFunction_eq_sum_powerset: overBool, it is a sum over the sets of occurring variables that aretrue.
The partition function of a weighted CSP instance: the sum of F.weight wt σ over the
assignments σ of the variables occurring in F (extended by default elsewhere).
Instances For
Semiring homomorphisms commute with the partition function.
With 0/1 weights the partition function is the model count of the relation
semantics.
The partition function is at most the number of assignments times the product of the local bounds, which may vary with the relation symbol.
The partition function is at most |D| ^ n * W ^ m when every weight at a local
assignment of the right length is at most W.
A constraint of weight zero makes the partition function zero: if some constraint of F
weighs zero at every local assignment of the right length, every assignment weighs zero.
Boolean partition functions as sums over sets of true variables: an assignment of the
occurring variables to Bool is the set of variables it makes true.