Abstract 1 Introduction 2 Preliminaries 3 Polynomial Calculus for MaxSAT 4 A possible application: Max-3-Coloring 5 Completeness 6 Another example: Flow in graphs 7 Conclusions References

An Algebraic Approach to MaxCSP

Ilario Bonacina ORCID UPC Universitat Politècnica de Catalunya, Barcelona, Spain Jordi Levy ORCID IIIA, CSIC, Bellatera, Spain
Abstract

Recently, there have been some attempts to base SAT and MaxSAT solvers on calculi beyond Resolution, even trying to solve SAT using MaxSAT proof systems. One of these directions was to perform MaxSAT sound inferences using polynomials over finite fields, extending the proof system Polynomial Calculus, which is known to be more powerful than Resolution.

In this work, we extend the use of the Polynomial Calculus for optimization, showing its completeness over many-valued variables. This allows using a more direct and efficient encoding of CSP problems (e.g., k-Coloring) and solving the maximization version of the problem on such encoding (e.g., Max-k-Coloring).

Keywords and phrases:
MaxCSP, Polynomial Calculus, MaxSAT
Copyright and License:
[Uncaptioned image] © Ilario Bonacina and Jordi Levy; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Proof complexity
; Computing methodologies Algebraic algorithms ; Mathematics of computing Solvers
Funding:
This work was supported by the grant numbers PID2022-138506NB-C21, and PID2022-138506NB-C22 funded by AEI.
Editors:
Jeremias Berg and Jakob Nordström

1 Introduction

The Constraint Satisfaction Problem (CSP) is the problem of, given a set of constraints on variables, finding an assignment satisfying all of them. SAT can be seen as the restriction of this problem to Boolean, ​i.e., 0/1-valued, variables and constraints given as clauses. MaxCSP and MaxSAT are their respective optimization versions, where we find assignments maximizing the number of satisfied restrictions. CSP could be tackled via translations to SAT, see for instance, [21]. MaxCSP could be tackled via translations to MaxSAT, but this kind of reduction is more subtle since we have to preserve not only satisfiability, but also the number of violated constraints. As a result, in some problems, it may be more efficient to try to solve the original problem using CSP techniques directly, instead of these translations.

In this paper, we consider the natural adaptation of the notions of MaxCSP and MaxSAT to sets of polynomials and we show how to use an algebraic framework to tackle optimization problems on sets of polynomials over multi-valued variables. Sets of polynomials over many-valued variables can be used to encode CSP and MaxCSP more directly, avoiding the translation to SAT.

Given a set of polynomials P, we want to determine the maximum number of polynomials in P that can be simultaneously evaluated to zero under a common assignment of the variables. Unlike SAT and MaxSAT that rely on Boolean encodings, using sets of polynomials allows to use a direct multi-valued encoding of MaxCSP problems that are more expressive, concise, and closer in nature to possible underlying algebraic properties of the original problem at hand.

The algebraic framework we use is an adaptation of Polynomial Calculus (PC) introduced in [9]. PC is the proof system underlying the reasoning power of algorithms to compute Gröbner bases [7, 6, 12], and, from a theoretical point of view, PC is well-studied in connection with big open questions in Complexity Theory. From a practical point of view, the interest in PC stems from the fact that it is stronger and more versatile than Resolution, the proof system underlying the Conflict-Driven-Clause-Learning paradigm of state-of-the-art SAT-solvers [20, 1]. Moreover, algorithms computing Gröbner bases are useful in practice in the context of coloring of graphs [18, 10, 11] and verification of multiplier circuits [16, 14, 15, 13]. The previous applications use polynomials over multi-valued or Fourier encoding, ​i.e., using variables such that xκ=1. Unlike the case of PC over Boolean variables, PC over multi-valued variables is not so well understood. Some well-known principles, such as Tseitin formulas have short (polynomial size) proofs in PC over ±1-variables, while they do not have short proofs over PC with Boolean variables. Recently, it has also been shown that there are unsatisfiable formulas having polynomial size refutation in PC over Boolean variables, while requiring exponential size in PC over ±1-valued [19].

Recently, Bonacina, Bonet and Levy [2, 3] introduced an algebraic calculus (wPCκ) for certifying the optimum value in optimization problems on polynomials over the finite field 𝔽κ. This is a generalization of PC to the context of optimization and not only satisfiability. The authors proved the completeness of the calculus in the case of polynomials over Boolean variables.

In this work, we consider polynomials over non-Boolean encodings and therefore we give a theoretical ground for extending the applicability of the algorithms using algebraic reasoning and many-valued variables from the context of CSPs to MaxCSPs. For the sake of clarity, we omit the possible generalization to the case of weights and the presence of hard constraints, for instance coming from a Fourier encoding (i.e. using polynomials x1 to limit the possible values taken), although all the content of this paper will adapt easily to those cases.

The main contribution of this work is the completeness of the calculus wPCκ over arbitrary sets of polynomials in 𝔽κ (Theorem 5.1). This argument loosely follows the structure of the completeness of wPCκ over polynomials forced to take Boolean values in [3] but requires several non-trivial adaptations. This gives an algorithmic procedure that is efficient in some cases, see Section 6.

As a proof of concept, we also show how to apply the calculus wPC3 to certify Max-3-colorability of graphs exploiting the use of non-Boolean variables (see Section 4).

Structure of the Paper

Section 2 contains all the necessary preliminaries. Section 3 gives the definition of the algebraic framework for optimization and the definition of wPCκ. Section 4 exemplifies the algebraic framework to Max-coloring. Section 5 contains the completeness of the calculus wPCκ (Theorem 5.1). This is the main technical contribution of this work. Section 6 gives an application of the algorithmic procedure giving the completeness of wPCκ. Section 7 give respectively some technical and more general final remarks.

2 Preliminaries

For a natural number n, let [n]={1,,n}. Capital letters typically denote sets and multi-sets, for instance, X usually denotes a set of variables. With p,q,f we typically denote polynomials. κ will always denote the number of elements of a generic finite field.

Basic Algebra Notations

Informally, a field 𝔽 is a set equipped with addition and multiplication that behave similarly as they would do in the rationals or real numbers.

For instance, 𝔽3 is the finite field with 3 elements {0,1,1}. The addition is modulo 3, that is 1+1=1 and 11=1, the multiplication is the usual one, and for each a𝔽3, a3=a. For κ a power of a prime, 𝔽κ is the (unique up-to-isomorphism) finite field with κ elements. For every element a𝔽κ it holds that aκ=a.

Given a set of variables X and a field 𝔽, 𝔽[X] is the ring of polynomials with coefficients in 𝔽 and variables in X.

A assignment on the variables X is a map α:X𝔽. The evaluation of a polynomial p𝔽[X] on α is p(α) and it is the element of 𝔽 given by substituting each variable x in p with α(x) and then simplifying the resulting expression using the sum and multiplication rules of 𝔽. An assignment α satisfies a polynomial p if p vanishes on α, i.e., p(α)=0.

MaxSAT on Polynomials

Similarly to the usual MaxSAT, in the optimization problem on polynomials, we are interested in maximizing the number of polynomials set to zero on a common assignment. For a multi-set of polynomials P𝔽[X] and an assignment α let

cost(P,α)=|{pP:p(α)0}|,

i.e., cost(P,α) is the number of polynomials in P non vanishing in α (the polynomials are counted with the respective multiplicity in P). The optimization problem on polynomials becomes minimizing the quantity cost(P,α) over all possible assignments α:

cost(P)=minαcost(P,α).

In this work we are interested in formal systems that can be used to certify lower bounds on cost(P), ​i.e., cost(P)s for some natural number s. To do so we use the notion of strongly sound inference rules introduced in the context of MaxSAT Resolution in [4, 5], adapted here from the context of clauses to generic polynomials.

Definition 2.1 (strongly sound rule).

Let p1,,pm,q1,,q be polynomials in 𝔽[X] and p1,,pmq1,,q be an inference rule. The rule is strongly sound if for every assignment α:X𝔽,

cost({p1,,pm},α)=cost({q1,,q},α).

The interest in strongly sound rules lies in the fact they can be used to build inference systems for MaxSAT or, in our case, inference systems for optimization on polynomials. This is based on the fact that a strongly sound rule p1,,pmq1,,q on a multi-set of polynomials P with p1,,pmP can be used as a substitution rule giving the multi-set

P=P{p1,,pm}{q1,,q},

where cost(P)=cost(P). Hopefully, P is simpler, and by repeating the process we would like to arrive to a P which trivially certifies that cost(P)s, for instance, since there are s-many constant non-zero polynomials in P. To certify that cost(P)=s we additionally need to prove that the remaining non-constant polynomials in P have a common zero.

Examples of such systems are wPC3 (Definition 3.1) or, working with clauses instead of polynomials, MaxSAT-Resolution [17, 4, 5].

In this work, we focus on polynomials in 𝔽[X] and actually we are only interested in how they behave after being evaluated, therefore it makes sense to consider them modulo the following equivalence relation.

Definition 2.2 ().

Given p,q𝔽[X], pq iff for every assignment α:X𝔽, p(α)=q(α).

For every polynomial p𝔽κ[X], it holds that pκp and, if p1q1 and p2q2, then p1p2q1q2. This gives the following strongly sound substitution rule:

pq(equivalence rule, ), (1)

where pq. By the Nullstellensatz, it is possible to check efficiently whether pq since this is equivalent to the polynomial pq being in the ideal generated by {xκx:xX}. This latter condition is efficiently checkable “multilinearizing” the polynomial pq, that is substituting each occurrence of variables xa(κ1)+b with xb, where b{0,,κ1}, and then checking that after this process all the terms cancel-out and the polynomial is identically 0.

3 Polynomial Calculus for MaxSAT

Bonacina, Bonet and Levy in [3] introduced Polynomial Calculus for MaxSAT (wPCκ) as a way to use a system stronger than MaxSAT-Resolution to solve MaxSAT. For simplicity, we omit the treatment of weighted polynomials and sets of polynomials as “hard” constraints. We also omit the case of negative weights and therefore what we call wPCκ is 𝗐𝖯𝖢,𝔽κ in [3].

Definition 3.1 (wPCκ, [3]).

Given a multi-set of polynomials P𝔽κ[X], a wPCκ derivation of a polynomial p𝔽κ[X] is a sequence of multi-sets L0,,Lt such that

  1. 1.

    L0=P, pLt, and

  2. 2.

    for each i>0, Li is the result of the application of a sum / prod /  rule as a substitution rule on Li1, where the sum and prod rules are the following:

    pqp+qpqp((p+q)κ11)(sum)ppqp(qκ11)(prod) (2)

The size of a wPCκ derivation is the total number of symbols in it.

The system wPCκ can be used to certify that for a multi-set of polynomials P𝔽κ[X], cost(P)s. Indeed, a wPCκ derivation from P of s copies of the constant polynomial 1 implies that cost(P)s. Or, equivalently, a wPCκ derivation of s non-zero constant polynomials, since by the prod rule from any non-zero constant we can derive the polynomial 1 multiplying by its inverse (for an example of application, see last inference step in Example 3.3). In wPCκ it is also possible to certify that cost(P)=s: if on top of the s-many polynomials identically 1 we give an assignment which is a common zero of the polynomials obtained alongside the 1s.

To clarify the rules for wPCκ, we give an equivalent, but more explicit, set of rules for κ=3:

pqp+qpqpq(qp)(sum)ppqp(q21)(prod) (3)

where p,q𝔽3[X]. The rule prod in (3) is strongly sound essentially because for any assignment α exactly one among q(α) and q(α)21 is zero. The rule sum in (3) is strongly sound by case analysis: the less trivial case to check is when we have an assignment α such that cost({p,q},α)=2, i.e. p(α){1,1} and q(α){1,1}. In this case, the cost of the conclusions of the rule is also 2 because p(α)q(α)0 and, over the assignments αs we are considering, exactly one among p(α)+q(α) and q(α)p(α) is zero.

 Remark 3.2 (On the coefficients of the polynomials).

Polynomial Calculus on polynomials with coefficients in a generic ring (for instance ) was also investigated in [8]. Both the article [3] and ours only consider the MaxSAT/MaxCSP adaptation of Polynomial Calculus over finite fields. The reason is that the rules sum and prod do not immediately adapt to arbitrary finite rings such as /4 (the set of integers with arithmetic modulo 4) or fields of characteristic 0. In particular, the sum and prod rules on polynomials with coefficients in /4 are not strongly sound. This seems to be related to the presence of 0-divisors, e.g. 22=0 in /4. Further investigation is needed to define a suitable version of Polynomial Calculus for MaxSAT or MaxCSP over infinite fields or generic rings.

To illustrate the calculus wPC3 and the use of the rules from (3) and (1) we give a couple of examples.

Example 3.3.

Consider the set of polynomials P={x,y,x+y1}𝔽3[x,y]. The following wPC3 derivation shows that cost(P)=1 (we use the -rule implicitly):

The first sum is between x and x+y1. The second sum is between y and y1. The polynomial xy2+xy in the first sum comes from the fact that

x(x+y1)((x+y1)x)xy2+xy.

The 0 in the second sum comes from the fact that (y)(y1)((y1)(y))0.

This shows that cost(P)1. To conclude that cost(P)=1, it is enough to show that the assignment x=0, y=0 is a zero of all polynomials of the next to last multi-set except the polynomial 1. The last step to transform this non-zero constant polynomial into 1 may be omitted.  

Example 3.4.

Consider P={x2+1}𝔽3[x]. Since (x2+1)2=x4+2x2+13x2+11, the following wPC3 derivation shows that cost(P)=1:

That is, in particular, the polynomial x2+1 doesn’t have roots in 𝔽3 (as expected). Proposition 5.5 generalizes this example.  

Example 3.5.

Consider P={i=1nxi,i=1nxi1}𝔽3[x1,,xn]. Clearly, P is unsatisfiable and a single application of the sum rule gives immediately the polynomial 1. On the other hand, encoding the multi-valued variables xi with Boolean indicator variables will result in polynomials with an exponential (in n) number of terms. For instance, when we encode the value of xi as yi,0+yi,1yi,1, and we add the additional polynomial constraints yi,0+yi,1+yi,11 and yi,j2yi,j, the Boolean analogue of the set P becomes {i=1n(yi,0+yi,1yi,1),i=1n(yi,0+yi,1yi,1)1}.

Bonacina, Bonet and Levy in [3] proved that the rules in (2) are strongly sound. This is just a case analysis on the values of p(α), q(α) on an assignment α and uses the fact that p(α)+q(α)0 if and only if (p(α)+q(α))κ1=1. As a consequence, the system wPCκ is sound.

Theorem 3.6 (soundness [3]).

Let P𝔽κ[X] be a multi-set of polynomials. If there exists a wPCκ derivation of s copies of the polynomial 1 from P then cost(P)s.

A converse of Theorem 3.6 (i.e., that the calculus wPCκ is also complete) is also true, under the additional assumption that the initial polynomials P are on Boolean 0/1-valued variables [3].

In Section 5 (Theorem 5.1), we complete and extend the completeness result in [3] showing a converse of Theorem 3.6 for an arbitrary κ without any additional assumption. Therefore allowing the use of wPCκ beyond multi-sets of polynomials over Boolean variables. As Example 3.5 shows, using Boolean or multi-valued variables might result in completely different complexities of the problem at hand.

4 A possible application: Max-3-Coloring

A calculus for optimization on polynomials on arbitrary variables allows using direct encoding of MaxCSPs. Moreover, the algebraic language offers the possibility to concisely encode many natural constraints used in CSP.

One notable example is the Vertex Coloring Problem (VCP), which we analyze in detail in this section. Given an undirected graph G=(V,E), the Vertex Coloring Problem (VCP) is the problem of finding a labeling of the vertices of G such that no vertices along an edge share the same label. Deciding if a given graph is 3-colorable, i.e. colorable with a set of 3 labels, is one of the classical NP-complete problems.

Max-3-Coloring, the problem of maximizing the number of edges that connect 3-colored vertexes with distinct labels, is a more difficult problem. Max-2-Coloring is exactly MaxCUT, which is NP-complete, whereas 2-Coloring is in P.

To show that a given graph G is not say 3-colorable we can associate to the VCP on G a CNF formula which is satisfiable iff G is 3-colorable. Alternatively, we can associate the VCP on G to a set of polynomials with a common solution iff G is 3-colorable. To encode the VCP algebraically, we need to express restrictions of the form xy. There are several ways of doing this. Using polynomials with coefficients in 𝔽3, it can be encoded as x2+xy+y21. This polynomial evaluates to zero when xy.

This immediately generalizes to expressing the nogood v1,,v for variables x1,,x, i.e. the fact that at least for one index i, xivi. This can be done using the polynomial i=1(xi2+vixi+vi21) which evaluates to zero exactly when there is an index i such that xivi.

Alternatively, for instance, the constraint xy for 3-coloring can be encoded using Fourier variables in 𝔽4 as {x31,y31,x2+xy+y21}, where the first two polynomials are hard constraints and the third one is a soft constraint. Both the encoding in 𝔽3 and the encoding in 𝔽4 with Fourier variables generalize easily to -coloring. In this work, for simplicity, we only consider the encoding with variables in 𝔽3.

Definition 4.1 (𝖵𝖢3(G)).

Given an undirected graph G=(V,E), consider one variable xv, for each vV, and the set of polynomials 𝖵𝖢3(G)𝔽3[{xv:vV}] given by

𝖵𝖢3(G)={xv2+xvxw+xw21:{v,w}E}.
Proposition 4.2.

The polynomials in 𝖵𝖢3(G) have a common zero iff G is 3-colorable. Moreover, cost(𝖵𝖢3(G)) equals the minimum number of edges connecting two vertexes with the same color in an optimal coloring.

Proof.

It is immediate to see that xv2+xvxw+xw21=0 if and only if xvxw. This could be done either by analyzing all cases or, alternatively, noticing that if xvxw, then

0 =xvxwxvxw1=xv3xw3xvxw1=xv2+xvxw+xw21.

If xv=xw, then xv2+xvxw+xw21=3xv21=1.

In the following, as an example, we consider the 3-colorability of the complete graph G=K4, ​i.e., the graph with 4 vertexes x,y,z,t, and 6 edges connecting all pairs of vertexes. For v,w{x,y,z,t}, let pvw=v2+vw+w21, that is

𝖵𝖢3(K4)={pxy,pxz,pxt,pyz,pyt,pzt}. (4)

In all optimal 3-colorings of K4, one edge connects two vertexes with the same color, i.e. we must have that cost(𝖵𝖢3(K4))=1.

Figure 1: A proof of the non-3-colorability of K4.

In Fig. 1 we show a wPC3 derivation certifying that cost(𝖵𝖢3(K4))1. An alternative derivation is in Fig. 2.

Every time that a polynomial is used in one inference, it is removed and cannot be used in other inferences. Therefore, every polynomial has a unique outgoing arrow.

In the wPC3 derivation in Fig. 1, we obtain the polynomial s7 which is

s7 =s1+s2+s3+o4,2+o5,2
=x2y2x2yzxy2zxyz2+y2z2x2ytxy2t
+x2zty2zt+xz2tyz2txyt2+y2t2+xzt2
yzt2+x2+xy+xz+yz+z2+xt+yt
+zt+t2+1.

To complete the proof and certify that cost(𝖵𝖢3(K4))1, we need to prove that s7 has no roots. This can be proved efficiently in wPC3 following the general structure of the wPC3 derivation in Proposition 5.5.

To prove that cost(𝖵𝖢3(K4))=1, we need to show that there exists an assignment that simultaneously evaluates to zero all the other polynomials. Obviously, this is not trivial.

An alternative wPC3 derivation for the set of polynomials in (4) is in Fig. 2. In this case, we obtain the polynomial s5, which directly proves cost(𝖵𝖢3(K4))1 since s51. In this second proof, we use the Rx(p) operator defined in (5) and the saturation strategy from the completeness theorem.

Figure 2: Alternative proof of the non-3-colorability of K4.

In the following section, we prove a completeness result ensuring that, instead of just an unsolvable polynomial, we can get cost(𝖵𝖢3(Kn)) copies of the polynomial 1 and a set of simultaneously solvable polynomials.

5 Completeness

In this section, we prove the converse of Theorem 3.6.

Theorem 5.1 (completeness).

Let P𝔽κ[X] be a multi-set of polynomials. If cost(P)=s, then there exists a wPCκ derivation of a multi-set containing s copies of the polynomial 1 from P.

The proof of Theorem 5.1 follows the structure of [3, Theorem 4.1] which was ultimately inspired by [5]. Informally, the argument goes by the following algorithmic procedure. Take an ordering on the variables X={x1,,xn}, then on the polynomials depending on x1 try to infer as many non-trivial polynomials without x1 as possible using the sum and prod rules. This would be, intuitively, the notion of saturation (Definition 5.6). Then repeat the process one variable at a time. At the end of the process, we will have obtained s-many copies of the polynomial 1 together with several other polynomials. The process will have preserved the cost along the way, while the remaining polynomials are satisfiable, by the structural properties of the saturation. To make this very high-level structure of the argument formal, first, we need to formalize the notion of when a polynomial depends on a variable x.

Definition 5.2 (dependence).

A polynomial p𝔽κ[X] does not depend on a variable xX if there exists a polynomial q𝔽κ[X] not containing x such that pq.

For instance, the polynomial x3x1𝔽3[x] does not depend on x, since x3x11 over 𝔽3.

The following proposition gives an equivalent characterization for when a polynomial does not depend on a variable.

For p𝔽κ[X], we use the notation pxa, where xX, to denote the polynomial p where each occurrence of x has been substituted with a𝔽κ, and we use the notation

Rx(p)=a𝔽κpxa.

In particular, for p𝔽3[X] and xX,

Rx(p)=px0px1px1. (5)
Proposition 5.3.

Let p𝔽κ[X] be a polynomial and xX a variable. Then the following are equivalent

  1. 1.

    p does not depend on x,

  2. 2.

    pRx(p).

Proof.

Clearly item 2 implies item 1, since p is equivalent to the polynomial Rx(p) that does not contain x.

Conversely, if p does not depend on x, then there exists q not containing the variable x such that pq. Then, restricting by xa for all a𝔽κ, we get pxaqxaq. Which gives ppxa for each a𝔽κ. Hence

Rx(p)=a𝔽κpxapκp.

The polynomials Rx(p) play a central role in our argument for Theorem 5.1. In particular, it is possible to derive Rx(p) from p using the rules of wPC3.

Lemma 5.4.

From any polynomial p𝔽κ[X], it is possible to derive Rx(p) using prod and the equivalence rule.

Proof.

The derivation is the following:

(6)

In the last equivalence, we used the fact that pκ1Rx(p)Rx(p). To see this, we just need to show that for every assignment α:X𝔽κ,

pκ1(α)Rx(p)(α)Rx(p)(α). (7)

Let b=α(x). Then, the equivalence in (7) follows from the following equalities:

pκ1(α)Rx(p)(α) =pκ1(α)a𝔽κpxa(α)
=pκ(α)a𝔽κ{b}pxa(α)
p(α)a𝔽κ{b}pxa(α)
=Rx(p)(α).

Towards proving Theorem 5.1, first consider a generalization of Example 3.4.

Proposition 5.5.

If p𝔽κ[X] is a polynomial that never vanishes, i.e. cost({p})=1, then there is a wPCκ derivation of 1 from {p}.

Proof.

Let the variables in X be x1,,xn. A possible derivation is to consider p0=p and, for each i=0,,n1, consider

pi+1=Rxi+1(pi). (8)

By induction on i, we prove that pi never vanishes and pi does not depend on x1,,xi. By assumption, this holds for i=0. Suppose then pi never vanishes and pi does not depend on x1,,xi. We have two cases.

If pi does not depend on xi+1, then, by Proposition 5.3, pi+1pi and the inductive hypothesis is implied.

If pi does depend on xi+1, then pi+1, by construction does not depend on xi+1. We need to show that pi+1 never vanishes. Suppose towards a contradiction it vanishes in α. Evaluating (8) in α we get:

0=pi+1(α)=Rxi+1(pi)(α)=a𝔽κpi,xi+1a(α)=a𝔽κpi(αa)

where αa is the assignment α modified such that xi+1a. A contradiction immediately arises from the fact that pi never vanishes, while the previous chain of equalities implies that pi(αa)=0 for some a𝔽κ.

The sequence of polynomials p0,,pn gives a backbone of a wPCκ derivation: indeed, by Lemma 5.4, each pi is derivable from pi1 and pn is equivalent to 1.

The argument in Proposition 5.5, give rise to the notion of saturated set of polynomials, and the extension of the previous argument to saturated sets is Lemma 5.9, the main lemma needed to prove Theorem 5.1.

Definition 5.6 (x-saturated).

A set of polynomials S𝔽κ[X] is x-saturated if for all -tuple p1,,pS depending on x and for all -tuple a1,,a𝔽κ,

Rx(i=1aipi)0.

Some combinations of polynomials in the definition above are trivially zero or are redundant. For instance, Rx(p)0 if and only if Rx(p)0.

The notion of x-saturated set of polynomials (Definition 5.6) is more general than what is actually needed to prove Lemma 5.9 and therefore Theorem 5.1. It is enough to check that

Rx(p1) 0
Rx(ωp1+p2) 0
Rx(ωp1+ωp2+p3) 0
Rx(ωp1++ωpκ2+pκ1) 0
Rx(p1++pκ) 0

for every ω𝔽κ{0} and polynomials pj𝔽κ[X] depending on x.

First, we show that for any set of polynomials P𝔽κ[X] it is possible to derive in wPCκ an x-saturated set S.

Lemma 5.7.

For polynomials p1,,p𝔽κ[X], coefficients a1,,a𝔽κ and xX, there is a wPCκ derivation from P of a multi-set containing Rx(i=1aipi).

Proof.

To derive in wPCκ the polynomial Rx(i=1aipi) we first use the prod and sum rules to derive i=1aipi and then apply the construction in Lemma 5.4 to i=1aipi deriving Rx(i=1aipi).

Lemma 5.8.

For any multi-set of polynomials P𝔽κ[X] and xX, there is a derivation from P in wPCκ of an x-saturated multi-set of polynomials S.

The proof of this lemma is similar to analoguos lemmas in [5, 3].

Proof.

We start from P and whenever we have polynomials p1,,pP depending on x and coefficients a1,,a𝔽κ such that Rx(i=1aipi)0 we apply the construction from Lemma 5.7 and get a new multi-set of polynomials P with the property that for every α, cost(P,α)=cost(P,α) but in P we have at least one more polynomial q without x and q0. This polynomial q is Rx(i=1aipi). For a set of polynomials Q, let σ(Q)=αcost(Qx,α), where Qx is the multi-set of polynomials in Q depending on x. It is always the case that σ(Q)0.

From the fact that q0, that is σ({q})>0, and the fact that wPCκ rules preserve the cost, we obtain that σ(P)<σ(P). We exhaustively apply this construction and in at most σ(P) many steps we must reach a set of polynomials S which is x-saturated.

The main property of saturated sets of polynomials is that they behave very nicely w.r.t. assignments. The following is the main technical lemma of the article.

Lemma 5.9.

If S𝔽κ[X] is an x-saturated multi-set of polynomials, then every assignment α:X𝔽κ can be modified in x to an assignment satisfying all the polynomials in S depending on x.

Proof.

Suppose towards a contradiction, there is an assignment α and polynomials fb for b𝔽κ in S depending on x such that fb(αb)0 for every b𝔽κ, where αb is the assignment mapping x to b and every other value as in α. For shortness let fb,j=fb(αj), that is, in particular fb,b0. We just need to prove that for each bb, fb,b=0. This will imply a contradiction in the following way: Since S is saturated,

Rx(b𝔽κfb)=j𝔽κ(b𝔽κfb)xj0,

and applying α we get

0 =()Rx(b𝔽κfb)(α)=j𝔽κ(b𝔽κfb,j)=()j𝔽κfj,j0,

since fj,j0 for any j𝔽κ. The equality () holds since S is saturated and applying α, while the equality () holds if we manage to prove fb,j=0 for any jb. The rest of the argument is to prove that for each bb, fb,b=0. This will be a consequence of S being x-saturated. We consider all the polynomials of the form ωfb1+ωfb2++ωfbt1+fbt, for 1t<κ and ω𝔽κ{0}, and proceed by induction on t.

For t=1, since the saturation process stopped in S we must have that, for every b𝔽κ,

Rx(fb)=j𝔽κ(fb)xj0,

and, since (fb)xj(α)=fb(αj)=:fb,j, we get

j𝔽κfb,j=0. (9)

In turn, this implies

j𝔽κ{b}fb,j=0, (10)

since by assumption fb,b0.

For t=2, again, since S is saturated, for any b,b distinct elements of 𝔽κ and any ω𝔽κ, j𝔽κ(ωfb+fb)xj0.

Evaluating in α we get

0 =j𝔽κ(ωfb+fb)xj(α)
=j𝔽κ(ωfb(αj)+fb(αj))
=j𝔽κ(ωfb,j+fb,j)
=S𝔽κω|S|jSfb,jjSfb,j
==0κωS(𝔽κ)jSfb,jjSfb,j
=()=1κ1ωS(𝔽κ)jSfb,jjSfb,j,

where with (𝔽κ) we denoted the set of all subsets of 𝔽κ of size . The equality in () is due to (9).

Let A=S(𝔽κ)jSfb,jjSfb,j. By the previous equality, we get that

(ω1ω12ω1κ1ω2ω22ω2κ1ωκ1ωκ12ωκ1κ1)(A1A2Aκ1)=(000)

where 𝔽κ{0}={ω1,,ωκ1}. The Vandermonde matrix above is invertible, therefore the unique solution is A=0 for every {1,,κ1}.

For any 3tκ1, in a similar way, starting from

j𝔽κ(ωfb1+ωfb2++ωfbt1+fbt)xj0

we obtain that for every {1,κ1}

S1,,Stdisjoint decomposition of 𝔽κ|S1|++|St1|=m=1tjSmfbm,j=0, (11)

where S1,,St being a disjoint decomposition of 𝔽κ means that i=1tSi=𝔽κ and the Sis are disjoint, but possibly empty. Since the equality (11) holds for every t and then, by induction, we also have that the equality in (11) holds for non-empty S1,,St, that is we have

S1,,Stpartition of 𝔽κ|S1|++|St1|=m=1tjSmfbm,j=0, (12)

For t=2 and =1 this means

0 =S(𝔽κ1)jSfb,jjSfb,j
=r𝔽κfb,rj𝔽κ{r}fb,j
=(due to (10))r𝔽κ{b}fb,rj𝔽κ{r}fb,j
=fb,br𝔽κ{b}fb,rj𝔽κ{r,b}fb,j.

Multiplying by j𝔽κ{b,b}fb,j and using (10) we get 0=fb,bfb,bj𝔽κ{b,b}fb,j2, which implies

j𝔽κ{b,b}fb,j=0. (13)

For t=3 the product in (13) is a single term fb,j=0 for jb arbitrary, hence concluding the argument. For an arbitrary t, we use an inductive argument with t=+1 and =1,,κ2. For simplicity we show how to go from =1, t=2 to =2, t=3. We have the following

0 =S1,S2,S3partition of 𝔽κ|S1|+|S2|=2m=13jSmfbm,j
=1,2𝔽κ12fb1,1fb2,2j𝔽κ{1,2}fb3,j
=(due to (13))1,2𝔽κ{b3}12fb1,1fb2,2j𝔽κ{1,2}fb3,j
=fb3,b31,2𝔽κ{b3}12fb1,1fb2,2j𝔽κ{1,2,b3}fb3,j.

Multiplying by j𝔽κ{b1,b2,b3}fb3,j and using (13) we get

0=fb1,b1fb2,b2fb3,b3j𝔽κ{b1,b2,b3}fb3,j2,

which implies

j𝔽κ{b1,b2,b3}fb3,j=0. (14)

Repeating this argument inductively, when t=κ1 and =κ2, we get that the analogue of the product in (14) becomes a single term fbt,j=0 for jbt. This concludes the argument for an arbitrary κ.

 Remark 5.10.

The argument for Lemma 5.9 also adapts to sets of polynomials with coefficients in 𝔽κ if they are forced to take non-zero values, i.e. we consider the sets of polynomials containing xκ11 for each variable x as hard constraints.

Using Lemma 5.8 and Lemma 5.9 it is then immediate to prove Theorem 5.1 using an inductive argument. This is very similar to the argument in [5, Theorem 10] and [3, Lemma 4.5].

Proof of Theorem 5.1.

Choose some ordering on the set of variables X={x1,,xn}. From the initial set of polynomial P using Lemma 5.8 derive using the wPCκ rules a multi-set P1 x1-saturated. Let R1 be the part of P1 not depending on x1 and S1 be the part of P1 depending on x1. The next step is to saturate R1 w.r.t. x2 to get a P2. As before let S2 and R2 be the sets of polynomials in P2 depending on x2 and not depening on x2 (resp.). Repeat the process on R2 saturating it w.r.t. x3. In an inductive fashion keep doing this on all the variables one by one. Notice that that Si depends on xi but it does not depend on x1,,xi1.

At the end of the process, we get s-many constant and non-zero polynomials together with the set of polynomials S1S2Sn. With some trivial application of the prod rule, we can assume that we have s-many copies of the polynomial 1.

To conclude the argument, since the cost is always preserved along the process, it is enough to show that the remaining polynomials are satisfiable. Informally, this holds because the saturated sets we produce are over fewer and fewer variables and therefore we can use Lemma 5.9 inductively on the saturated sets we produced from the last to the first one. Starting from any assignment, by Lemma 5.9 we can modify it in xn to satisfy Sn. In general, given an assignment αi satisfying Si, by Lemma 5.9, we can modify it in the variable xi1 obtaining an assignment αi1 satisfying Si1. Since all the Sj for ji do not depend on xi1 the assignment αi1 continues to satisfy SiSn.

The argument for Theorem 5.1 gives a saturation-based proof-construction strategy. Lemma 5.8 gives a possible way to obtain a saturated set, but any other heuristics to obtain a saturated set would be equally good. We exemplify the saturation strategy in Section 6.

 Remark 5.11 (On the completeness).

To prove Theorem 5.1 we used very little of the actual form of the sum and prod rules. We indeed only used the fact that there are strongly sound inference rules that given as premise a polynomial p allow to infer pq (together with other polynomials), for an arbitrary q, and that given as premises p and q allow to infer p+q (together with other polynomials). In other words, Theorem 5.1 will hold for any set of strongly sound rules satisfying the properties above.

6 Another example: Flow in graphs

We exemplify the effectiveness of the saturation process on a simple constraint satisfaction problem. Given a connected graph G=(V,E), an order on its vertices, and a function b:V, find a flow for every edge such that b(v) is the sum of the flows of all adjacent edges, i.e. find an assignment f:E such that for all vV

b(v)=uN(v)u<vf({u,v})uN(v)u>vf({u,v}). (15)

The problem can be solved using linear programming and it has a solution if and only if vVb(v)=0. However, we are interested in possible refutations when the problem has no solution. In this case, we can pick any prime κ not dividing vVb(v) and refute the set of eq. (15) modulo κ, that is show that the set of polynomials, for vV,

uN(v)u<vxu,vuN(v)u>vxv,u(b(v)modκ) (16)

has no solution in 𝔽κ. We show how the saturation process in wPCκ, independently of the order we decide to saturate variables, always easily gives a short refutation of (16).

At the beginning choose arbitrarily a variable to saturate, let it be xu,v. There are only two polynomials in (16) depending on xu,v, one with positive coefficient 1, one with negative coefficient 1. It is easy to see (see Lemma 6.1 below), that to saturate w.r.t. xu,v, the only option is to apply the sum rule to the two (linear) polynomials containing xu,v, and the obtained set is saturated for xu,v. In this set, there is only one polynomial without xu,v which is linear. We keep saturating for all the variables one by one. It is easy to see that at any given moment the set to saturate w.r.t. the current variable x only has linear polynomials and only two of them depending on x, in one x appears with coefficient 1, in the other with coefficient 1. Again it is easy to see that the only option to saturate w.r.t. x is to apply the sum rule to the two linear polynomials depending on x and the obtained set is saturated. Repeating this process for all variables gives the refutation. Since G is connected this will also show that the set of polynomials in (16) is minimally unsatisfiable.

Lemma 6.1.

Let p=q be a polynomial in 𝔽κ[X] with a linear polynomial depending on a variable x. Then Rx(p)0.

Proof.

The polynomial p has the form p=(cx+)q with linear not containing the variable x and c0. We have that Rx(p)=j𝔽κ(cj+|xj)q|xj. To show that Rx(p)0 it is enough to show that for every assignment α:X𝔽κ, Rx(p)(α)=0:

Rx(p)(α) =j𝔽κ(cj+|xj(α))q|xj(α)=j𝔽κ(cj+(α))q|xj(α)

which is set to 0 by the factor corresponding to j=(α)c.

7 Conclusions

We described a calculus for MaxCSP based on polynomials and variables ranging over finite fields 𝔽κ. This provided a theoretical ground for further investigations of the efficiency of algebraic methods in the context of MaxCSPs.

The calculus is proved complete, and from this proof, we derived a saturation-based proof-construction strategy. We exemplified the constructions on a coloring principle, the Max-3-Coloring Problem and on a Flow principle.

References

  • [1] Albert Atserias, Johannes Klaus Fichte, and Marc Thurley. Clause-learning algorithms with many restarts and bounded-width resolution. Journal of Artificial Intelligence Research, 40:353–373, 2011. doi:10.1613/JAIR.3152.
  • [2] Ilario Bonacina, Maria Luisa Bonet, and Jordi Levy. Polynomial calculus for MaxSAT. In Proceedings of the 26th International Conference on Theory and Applications of Satisfiability Testing (SAT), 2023. doi:10.4230/LIPIcs.SAT.2023.5.
  • [3] Ilario Bonacina, Maria Luisa Bonet, and Jordi Levy. Polynomial calculus for optimization. Artificial Intelligence, 337:104208, 2024. A preliminary version of this work appeared as [2]. doi:10.1016/j.artint.2024.104208.
  • [4] Maria Luisa Bonet, Jordi Levy, and Felip Manyà. A complete calculus for Max-SAT. In Proceedings of the 9th International Conference on Theory and Applications of Satisfiability Testing, (SAT), volume 4121 of LNCS, pages 240–251. Springer, 2006. doi:10.1007/11814948_24.
  • [5] Maria Luisa Bonet, Jordi Levy, and Felip Manyà. Resolution for Max-SAT. Artificial Intelligence, 171(8-9):606–618, 2007. doi:10.1016/j.artint.2007.03.001.
  • [6] Michael Brickenstein and Alexander Dreyer. PolyBoRi: A framework for Groebner-basis computations with Boolean polynomials. Journal of Symbolic Computation, 44(9):1326–1345, 2009. Effective Methods in Algebraic Geometry. doi:10.1016/j.jsc.2008.02.017.
  • [7] B. Buchberger. A theoretical basis for the reduction of polynomials to canonical forms. ACM SIGSAM Bulletin, 10(3):19–29, August 1976. doi:10.1145/1088216.1088219.
  • [8] Sam Buss, Dima Grigoriev, Russell Impagliazzo, and Toniann Pitassi. Linear gaps between degrees for the polynomial calculus modulo distinct primes. Journal of Computer and System Sciences, 62(2):267–289, 2001. doi:10.1006/JCSS.2000.1726.
  • [9] Matthew Clegg, Jeff Edmonds, and Russell Impagliazzo. Using the Groebner basis algorithm to find proofs of unsatisfiability. In Proceedings of the 28th Annual ACM Symposium on the Theory of Computing (STOC), pages 174–183, 1996. doi:10.1145/237814.237860.
  • [10] Jesús A. De Loera, Jon Lee, Peter N. Malkin, and Susan Margulies. Computing infeasibility certificates for combinatorial problems through Hilbert’s Nullstellensatz. Journal of Symbolic Computation, 46(11):1260–1283, 2011. doi:10.1016/J.JSC.2011.08.007.
  • [11] Jesús A De Loera, Susan Margulies, Michael Pernpeintner, Eric Riedl, David Rolnick, Gwen Spencer, Despina Stasi, and Jon Swenson. Graph-coloring ideals: Nullstellensatz certificates, Gröbner bases for chordal graphs, and hardness of Gröbner bases. In Proceedings of the 2015 ACM on International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 133–140, 2015. doi:10.1145/2755996.2756639.
  • [12] Jean Charles Faugère. A new efficient algorithm for computing Gröbner bases without reduction to zero (F5). In Proceedings of the 2002 International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 75–83, 2002. doi:10.1145/780506.780516.
  • [13] Daniela Kaufmann, Paul Beame, Armin Biere, and Jakob Nordström. Adding dual variables to algebraic reasoning for gate-level multiplier verification. In Proceedings of the 25th Design, Automation and Test in Europe Conference (DATE), pages 1431–1436, 2022. doi:10.23919/DATE54114.2022.9774587.
  • [14] Daniela Kaufmann and Armin Biere. Nullstellensatz-proofs for multiplier verification. In Proceedings of the 22nd International Workshop on Computer Algebra in Scientific Computing (CASC), pages 368–389, 2020. doi:10.1007/978-3-030-60026-6_21.
  • [15] Daniela Kaufmann, Armin Biere, and Manuel Kauers. Verifying large multipliers by combining SAT and computer algebra. In Proceedings of the 19th Conference on Formal Methods in Computer Aided Design (FMCAD), pages 28–36, 2019. doi:10.23919/FMCAD.2019.8894250.
  • [16] Daniela Kaufmann, Armin Biere, and Manuel Kauers. From DRUP to PAC and back. In Proceedigns of the 2020 Design, Automation & Test in Europe Conference & Exhibition (DATE), pages 654–657, 2020. doi:10.23919/DATE48585.2020.9116276.
  • [17] Javier Larrosa and Federico Heras. Resolution in Max-SAT and its relation to local consistency in weighted CSPs. In Proceedings of the 19th International Joint Conference on Artificial Intelligence (IJCAI), pages 193–198, 2005. URL: http://ijcai.org/Proceedings/05/Papers/0360.pdf.
  • [18] Jesús A. De Loera, Jon Lee, Susan Margulies, and Shmuel Onn. Expressing combinatorial problems by systems of polynomial equations and Hilbert’s Nullstellensatz. Combinatorics, Probability and Computing, 18(4):551–582, 2009. doi:10.1017/S0963548309009894.
  • [19] Sasank Mouli. Polynomial calculus sizes over the Boolean and Fourier bases are incomparable. In Proceedings of the 65th IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 790–796, 2024. doi:10.1109/FOCS61266.2024.00055.
  • [20] Knot Pipatsrisawat and Adnan Darwiche. On the power of clause-learning SAT solvers as resolution engines. Artificial Intelligence, 175(2):512–525, 2011. doi:10.1016/j.artint.2010.10.002.
  • [21] Toby Walsh. SAT v CSP. In Proceedings of the 6th International Conference on Principles and Practice of Constraint Programming (CP), volume 1894, pages 441–456, 2000. doi:10.1007/3-540-45349-0_32.