This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: Key Laboratory of System Software (Chinese Academy of Sciences) and
State Key Laboratory of Computer Science,
Institute of Software, Chinese Academy of Sciences, Beijing, China
11email: {hexiang,libh,zhaomy,caisw}@ios.ac.cn
22institutetext: School of Computer Science and Technology
University of Chinese Academy of Sciences, Beijing, China

A Local Search Algorithm for MaxSMT(LIA)

Xiang He 1122 0009-0005-0730-1388    Bohan Li These two authors are co-first authors, as they contribute equally.1122 0000-0003-1356-6057    Mengyu Zhao 1122 0009-0001-8436-3532    Shaowei Cai Corresponding author1122 0000-0003-1730-6922
Abstract

MaxSAT modulo theories (MaxSMT) is an important generalization of Satisfiability modulo theories (SMT) with various applications. In this paper, we focus on MaxSMT with the background theory of Linear Integer Arithmetic, denoted as MaxSMT(LIA). We design the first local search algorithm for MaxSMT(LIA) called PairLS, based on the following novel ideas. A novel operator called pairwise operator is proposed for integer variables. It extends the original local search operator by simultaneously operating on two variables, enriching the search space. Moreover, a compensation-based picking heuristic is proposed to determine and distinguish the pairwise operations. Experiments are conducted to evaluate our algorithm on massive benchmarks. The results show that our solver is competitive with state-of-the-art MaxSMT solvers. Furthermore, we also apply the pairwise operation to enhance the local search algorithm of SMT, which shows its extensibility.

Keywords:
MaxSMT Linear Integer Arithmetics Local Search.

1 Introduction

The maximum satisfiability problem (MaxSAT) is an optimization version of the satisfiability problem (SAT), aiming to minimize the number of falsified clauses, and it has various applications [22]. A generalization of MaxSAT is the weighted Partial MaxSAT problem, where clauses are divided into hard and soft clauses with weights (positive numbers). The goal is to find an assignment that satisfies all hard clauses and minimizes the total weight of falsified soft clauses. MaxSAT solvers have made substantial progress in recent years [2, 25, 19, 23, 17].

However, MaxSAT has limited expressiveness, and it can be generalized from the Boolean case to Satisfiability Modulo Theories (SMT), deciding the satisfiability of a first-order logic formula with respect to certain background theories, leading to a generalization called MaxSAT Modulo Theories (MaxSMT) [29]. With its enhanced expressive power, MaxSMT has various practical applications, such as safety verification [6], concurrency debugging [33], non-termination analysis [18] and superoptimization [1].

Compared to MaxSAT and SMT solving, the research on MaxSMT solving is still in its preliminary stage. Cimatti et al. [13] introduced the concept of “Theory of Costs” and developed a method to manage SMT with Pseudo-Boolean (PB) constraints and minimize PB cost functions. Sebastiani et al. [30, 31] proposed an approach to solve MaxSMT problem by encoding it into SMT with PB functions. A modular approach for MaxSMT called Lemma-Lifting was proposed by Cimatti et al. [14], which involves the iterative exchange of information between a lazy SMT solver and a purely propositional MaxSAT solver. The implicit hitting set approach was lifted from the propositional level to SMT [15]. Two well-known MaxSMT solvers are OptiMathSAT [32] and νZ\nu Z [5], which are currently the state-of-the-art MaxSMT solvers. In this paper, we focus on the MaxSMT problem with the background theory of Linear Integer Arithmetic (LIA), denoted as MaxSMT(LIA), which consists of arithmetic atomic formulas in the form of linear equalities or inequalities over integer variables.

We apply the local search method to solve MaxSMT(LIA). Although local search has been successfully used to solve SAT [21, 3, 12, 11, 4] and recently to SMT on the theory of bit-vector theory [16, 27, 28, 26], integer arithmetic [9, 10] and real arithmetic [20, 24], this is the first time that it is applied to MaxSMT.

First, we propose a novel operator for integer variables, named pairwise operator, to enrich the search space by simultaneously operating on two variables. When the algorithm falls into the local optimum w.r.t. operations on a single variable, further exploring the neighborhood structure of pairwise operator can help it escape from the local optimum.

Moreover, a novel method based on the concept of compensation is proposed to determine the pairwise operation. Specifically, the pairwise operation is determined as a pair of simultaneous modifications, one to satisfy a falsified clause, and the other to minimize the disruptions the first operation might wreak on the already satisfied clauses. Then, a two-level picking heuristic is proposed to distinguish these pairwise operations, by considering the potential of a literal becoming falsified.

Based on the above novel ideas, we design the first local search solver for MaxSMT(LIA) called PairLS, prioritizing hard clauses over soft clauses. Experiments are conducted on massive benchmarks. New instances based on SMT-LIB are generated to enrich the benchmarks for MaxSMT(LIA). We compare our solver with 2 state-of-the-art MaxSMT(LIA) solvers, OptiMathSAT and νZ\nu Z. Experimental results show that our solver is competitive with these state-of-the-art solvers. We also present the evolution of solution quality over time, showing that PairLS can efficiently find a promising solution within a short cutoff time. Ablation experiments are also conducted to confirm the effectiveness of proposed strategies. Moreover, we apply the pairwise operator to enhance the local search algorithm of SMT, demonstrating its extensibility.

2 Preliminary

2.1 MaxSMT on Linear Integer Arithmetics

The Satisfiability modulo theories (SMT) problem determines the satisfiability of a given quantifier-free first-order formula with respect to certain background theories. Here we consider the theory of Linear Integer Arithmetic (LIA), consisting of arithmetic formulae in the form of linear equalities or inequalities over integer variables (i=0naixik\sum_{i=0}^{n}{a_{i}x_{i}\leq k} or i=0naixi=k\sum_{i=0}^{n}{a_{i}x_{i}=k})111strict linear equalities in the form of (i=0naixi<k\sum_{i=0}^{n}{a_{i}x_{i}<k}) can be transformed to (i=0naixik1\sum_{i=0}^{n}{a_{i}x_{i}\leq k-1}). An atomic formula can be a propositional variable or an arithmetic formula. A literalliteral is an atomic formula, or the negation of an atomic formula. A clauseclause is the disjunction of a set of literals, and a formula in conjunctive normal form (CNF) is the conjunction of a set of clauses. Given the sets of propositional variables and integer variables, denoted as PP and XX respectively, an assignment α\alpha is a mapping XZX\rightarrow Z and P{false,true}P\rightarrow\{false,true\}, and α(x)\alpha(x) denotes the value of a variable xx under α\alpha.

The (weighted partial) MaxSAT Modulo Theories problem (MaxSMT for short) is generated from SMT. The clauses are divided into hardhard clauses and softsoft clauses with positive weight.

Definition 1.

For a MaxSMT instance FF, given the current assignment α\alpha, if it satisfies all hard clauses, then α\alpha is a feasible solution, and the cost is defined as the total weight of all falsified soft clauses, denoted as cost(α)cost(\alpha).

MaxSMT aims to find a feasible solution with minimal costcost, that is, to find an assignment satisfying all hard clauses and minimizing the sum of the weights of the falsified soft clauses. The MaxSMT problem with the background theory of LIA is denoted as MaxSMT(LIA).

Example 1.

Given a MaxSMT(LIA) formula F=c1c2c3c4=(ab1ac0)(bc1)(ad1)(A)F=c_{1}\wedge c_{2}\wedge c_{3}\wedge c_{4}=(a-b\leq 1\vee a-c\leq 0)\wedge(b-c\leq-1)\wedge(a-d\leq 1)\wedge(A), let c1c_{1} and c4c_{4} be hard clauses, c2c_{2} and c3c_{3} be soft clauses with weight 1 and 2. Given the current assignment α={a=0,b=0,c=0,d=0,A=true}\alpha=\{a=0,b=0,c=0,d=0,A=true\}, cost(α)=1cost(\alpha)=1, since only c2c_{2} is falsified.

2.2 Local Search Components

The clause weighting scheme is a popular local search method that associates an additional property (which is an integer number) called penalty weight to clauses and dynamically adjusts them to prevent the search from getting stuck in a local optimum. We adopt the weighting scheme called Weighting-PMS [19] to instruct the search. Weighting-PMS has been applied in state-of-the-art local search solvers for MaxSAT, such as SATLIKE [19] and SATLIKE3.0 [8]. When the algorithm falls into a local optimum, the Weighting-PMS dynamically adjusts the penalty weights of hard and soft clauses to guide the search direction.

Note that the penalty weight and the original weight of soft clauses are different. The goal of MaxSMT is to minimize the total original weight of unsatisfied soft clauses, while the penalty weight is updated during the search process, guiding the search in a promising direction.

Another key component of a local search algorithm is the operator, defining how to modify the current solution. When an operator is instantiated by specifying the variable to operate and the value to assign, an operation is obtained.

Definition 2.

The score of an operation opop, denoted by score(op)score(op), is the decrease of the total penalty weight of falsified clauses caused by applying opop.

An operation is decreasing if its score is greater than 0. Note that given a set of clauses, denoted as CC, the scorescore of operation opop on the subformula composed of CC is denoted as scoreC(op)score_{C}(op).

3 Review of LS-LIA

As our algorithm adopts the two-mode framework of LS-LIA, which is the first local search algorithm for SMT(LIA) [9], we briefly review it in this section.

After the initialization, the algorithm switches between Integer mode and Boolean mode. In each mode, an operation on a variable of the corresponding data type is selected to modify the current assignment. The two modes switch to each other when the number of non-improving steps of the current mode reaches a threshold. The threshold is set to L×PbL\times P_{b} for the Boolean mode and L×PiL\times P_{i} for the Integer mode, where PbP_{b} and PiP_{i} denote the proportion of Boolean and integer literals to all literals in falsified clauses, and LL is a parameter.

In the Boolean mode, the flip operator is adopted to modify a Boolean variable to the opposite of its current value. In the Integer mode as in Algorithm 1, a novel operator called critical move (cmcm for short) is proposed by considering the literal-level information.

Definition 3.

The critical move operator, denoted as cm(x,)cm(x,\ell), assigns an integer variable xx to the threshold value making literal \ell true, where \ell is a falsified literal containing xx.

Specifically, the threshold value refers to the minimum modification to xx that can make \ell true. Example 2 is given to help readers understand the definition.

Example 2.

Given two falsified literals 1:(2ab3)\ell_{1}:(2a-b\leq-3) and 2:(5cd=5)\ell_{2}:(5c-d=5), and the current assignment is α={a=0,b=0,c=0,d=0}\alpha=\{a=0,b=0,c=0,d=0\}. Then cm(a,1)cm(a,\ell_{1}), cm(b,1)cm(b,\ell_{1}), cm(c,2)cm(c,\ell_{2}), and cm(d,2)cm(d,\ell_{2}) refers to assigning aa to -2, assigning bb to 33, assigning cc to 1 and assigning dd to 5-5 respectively.

An important property of the critical move operator is that after the execution, the corresponding literal must be true. Therefore, by picking a falsified literal and performing a cmcm operation on it, we can make the literal true.

In our algorithm for MaxSMT(LIA), the critical move operator is also adopt-
ed to make a falsified literal become true.

1 while non-improving steps L×Pi\leq L\times P_{i} do
2       if all clauses are satisfied then return ;
3       if \exists decreasing cm operation  then
4             op:=op:= such an operation with the greatest scorescore
5      else
6             update penalty weights;
7             c:=c:= a random falsified clause with integer variables;
8             op:=op:= a cm operation in cc with scorescore;
9            
10      perform opop ;
11      
12
Algorithm 1 Integer Mode of LS-LIA

4 Pairwise Operator

In this section, we introduce a novel operator for integer variables, denoted as pairwise operator. It extends the original critical move operator to enrich the search space, serving as an extended neighborhood structure. We first introduce the motivation for the pairwise operator. Then, based on pairwise operator, the framework of our algorithm in Integer mode is proposed.

4.1 Motivation

The original critical move operator only considers one single variable each time. However, it may miss potential decreasing operations. Specifically, when there exists no decreasing critical move operation, operations that simultaneously modify two variables may be decreasing, which are not considered by critical move.

Example 3.

Given a formula F=c1c2c3=(ab2)(bc1)(ca1)F=c_{1}\wedge c_{2}\wedge c_{3}=(a-b\leq-2)\wedge(b-c\leq 1)\wedge(c-a\leq 1) where the penalty weight of each clause is 1. and the current assignment is α={a=0,b=0,c=0}\alpha=\{a=0,b=0,c=0\}. There exist two critical move operations: cm(a,ab2)cm(a,a-b\leq-2) and cm(b,ab2)cm(b,a-b\leq-2), referring to assigning aa to 2-2 and bb to 22, respectively. Both operations are not decreasing, since these two operations will respectively falsify c3c_{3} and c2c_{2}. However, simultaneously assigning bb to 22 and cc to 11 can be decreasing, since after the operation, all clauses become satisfied.

Thus, the pairwise operator simultaneously modifying two variables is proposed to find a decreasing operation when there is no decreasing cmcm operation.

Definition 4.

Pairwise operator, denoted as p(v1,v2,val1,val2)p(v_{1},v_{2},val_{1},val_{2}), will simultaneously modify v1v_{1} to val1val_{1} and v2v_{2} to val2val_{2} respectively, where v1v_{1} and v2v_{2} are integer variables, and val1val_{1} and val2val_{2} are integer parameters.

The pairwise operator can be regarded as an extended neighborhood. When there exists no decreasing critical move operation, indicating that the local optimum of modifying individual variables is found, the search space can be expanded by simultaneously modifying two variables, and the solution may be further improved, thanks to the following property:

Proposition 1.

Given a pairwise operation op1=p(v1,v2,val1,val2)op_{1}=p(v_{1},v_{2},val_{1},val_{2}), and two operations individually assigning v1v_{1} to val1val_{1} and v2v_{2} to val2val_{2}, denoted as op2op_{2} and op3op_{3} respectively. op1op_{1} is decreasing while neither op2op_{2} nor op3op_{3} is decreasing, only if there exists a clause cc containing both v1v_{1} and v2v_{2}, and on clause cc, score{c}(op1)>score{c}(op2)+score{c}(op3)score_{\{c\}}(op_{1})>score_{\{c\}}(op_{2})+score_{\{c\}}(op_{3}).

The proof can be found in Appendix 0.A. Recall the Example 3, the pairwise operation that simultaneously assigns bb to 2 and cc to 1, denoted as op1op_{1}, is decreasing, while none of the operations that individually assign bb to 2 and cc to 1, denoted as op2op_{2} and op3op_{3}, is decreasing. The reason lies in that bb and cc both appear in the clause c2c_{2}, and score{c2}(op1)>score{c2}(op2)+score{c2}(op3)score_{\{c_{2}\}}(op_{1})>score_{\{c_{2}\}}(op_{2})+score_{\{c_{2}\}}(op_{3}).

5 Compensation-based Picking Heuristic

To find a decreasing pairwise operation when there is no decreasing cmcm operation, we first introduce a method based on the concept of compensation to determine pairwise operations, which can satisfy the necessary condition in Proposition 1 (Details can be found in Lemma 1 of Appendix 0.B). Then, among these pairwise operations, we propose a two-level heuristic to distinguish them, by considering the potential of the compensated literals becoming falsified.

5.1 Pairwise Operation Candidates for Compensation

Motivation for compensation: Since one variable may exist in multiple literals, changing a variable will affect all literals containing the variable, and may make some originally true literals become false. Moreover, if the literal is the reason for some clauses being satisfied, i.e., it is the only true literal in the clause, then falsifying the literal also falsifies the clause.

Formally, for an operation opop, we define a special set of literals CL(op)={|CL(op)=\{\ell|\ell is true and is the only true literal for some clauses, but \ell would become false after individually performing op}op\}. After performing an operation opop, the literals in the set CL(op)CL(op) are of special interest since some clauses containing such a literal would become falsified.

Concept of compensation: Let op1op_{1} and op2op_{2} denote two operations modifying individual variables. To minimize the disruptions that op1op_{1} might wreak on the already satisfied clauses, another operation op2op_{2} is simultaneously executed to make a literal CL(op1)\ell\in CL(op_{1}) remain true under the assignment after operating op1op_{1}. op2op_{2} is denoted as compensation for \ell, and literals in the set CLCL are denoted as Compensated Literals.

Compensation-based pairwise operation: A pairwise operation p(v1v_{1},v2v_{2}, val1val_{1},val2val_{2}) can be regarded as simultaneously performing a pair of operations modifying individual variables, op1op_{1} assigning v1v_{1} to val1val_{1} and op2op_{2} assigning v2v_{2} to val2val_{2}. The procedure to determine op1op_{1} and op2op_{2} is described as follows.

First, a candidate op1op_{1} is chosen to satisfy a falsified clause. To this end, we pick a variable v1v_{1} from a false literal 1\ell_{1} in a random falsified clause, and op1op_{1} is the corresponding cm operation, cm(v1,1)cm(v_{1},\ell_{1}). It prioritizes literals from hard clauses and soft clauses are considered only when all hard clauses are satisfied. To obtain sufficient candidates of op1op_{1}, KK (a parameter) literals are randomly selected from overall falsified clauses, and all variables in these literals are considered. The set of all candidate op1op_{1} found in this stage is denoted as CandOpCandOp.

Second, given a literal 2CL(op1)\ell_{2}\in CL(op_{1}), the op2op_{2} w.r.t op1CandOpop_{1}\in CandOp is determined to guarantee that 2\ell_{2} remains true after simultaneously performing op1op_{1} and op2op_{2}, meaning that op2op_{2} is selected to compensate for 2\ell_{2}. Specifically, to determine op2op_{2}, we pick a variable v2v_{2} appearing in a literal 2CL(op1)\ell_{2}\in CL(op_{1}), and calculate the value val2val_{2} according to cm(v2,2)cm(v_{2},\ell_{2}) assuming op1op_{1} performed.

Example 4.

Let us consider the formula presented in example 3: F=c1c2c3=(ab2)(bc1)(ca1)F=c_{1}\wedge c_{2}\wedge c_{3}=(a-b\leq-2)\wedge(b-c\leq 1)\wedge(c-a\leq 1) where the penalty weight of each clause is 1, and the current assignment is α={a=0,b=0,c=0}\alpha=\{a=0,b=0,c=0\}. There is no decreasing critical move operation. As shown in Fig. 1, performing op1=cm(b,ab2)op_{1}=cm(b,a-b\leq-2) that assigns bb to 22 would falsify the literal =(bc1)\ell=(b-c\leq 1), the only true literal in c2c_{2}. To compensate for \ell, the operation op2op_{2} that assigns cc to 1 is determined according to cm(c,)cm(c,\ell), assuming that op1op_{1} has been performed. All clauses become satisfied after simultaneously performing op1op_{1} and op2op_{2}, and thus a decreasing pairwise operation p(b,c,2,1)p(b,c,2,1) is found.

Refer to caption
Figure 1: Given the literal =(bc1)\ell=(b-c\leq 1), the axis refers to the value of (bc)(b-c). Individually performing op1op_{1} will falsify \ell, while op2op_{2} can compensate for \ell.

Note that there may exist multiple variables in the literal 2CL(op1)\ell_{2}\in CL(op_{1}), and thus given the operation op1op_{1}, and the literal 2\ell_{2} selected in the second step, a set of pairwise operations is determined by considering all variables in 2\ell_{2} except the variable in op1op_{1}, denoted as pair_set(2\ell_{2},op1op_{1}).

5.2 Two-level Heuristic

Among the literals selected in the second step of determining a pairwise operation, we consider that some literals are more likely to become false, and should be given higher priority. Thus, we distinguish such literals from others. They are formally defined as follows.

Definition 5.

Given an assignment α\alpha, and a literal in the form of i=0naixik\sum_{i=0}^{n}{a_{i}x_{i}\leq k}, we denote Δ=i=0naiα(xi)k\Delta=\sum_{i=0}^{n}{a_{i}\alpha(x_{i})}-k. The literal is a fragile literal if Δ=0\Delta=0 holds. Any true literal with Δ<0\Delta<0 is safe.

A fragile literal with Δ=0\Delta=0 is true as the inequality Δ0\Delta\leq 0 holds, but it can be falsified by any little disturbance that enlarges Δ\Delta of the corresponding fragile literal. Comparatively, a literal is safe means that even if the value of a variable in the literal changes comparatively larger (as long as Δ0\Delta\leq 0 after the modification), it remains true.

Example 5.

Consider the formula: F=l1l2l3=(ba1)(ac0)(ad3)F=l_{1}\wedge l_{2}\wedge l_{3}=(b-a\leq-1)\wedge(a-c\leq 0)\wedge(a-d\leq 3), where the current assignment is α={a=0,b=0,c=0,d=0}\alpha=\{a=0,b=0,c=0,d=0\}. l2l_{2} and l3l_{3} are two true literals. l2l_{2} is a fragile literal since its Δ=0\Delta=0, while l3l_{3} is a safe literal since its Δ<0\Delta<0. We consider that l2l_{2} is more fragile than l3l_{3}, since a small disturbance, cm(a,l1)cm(a,l_{1}) that assigns aa to 1, can falsify l2l_{2} but not l3l_{3}.

In the second step of determining a pairwise operation, among those compensated literals, we prefer fragile literals and prioritize the corresponding pairwise operations. Based on the intuition above, a two-level picking heuristic is defined:

  • We first choose the decreasing pairwise operation involving a fragile compensated literal.

  • If there exists no such decreasing pairwise operation, we further select the pairwise operation involving safe compensated literals.

5.3 Algorithm for Picking a Pairwise Operation

Based on the picking heuristic, the algorithm for picking a pairwise operation is described in Algorithm 2. In the beginning, we initialize the set of pairwise operations involving fragile and safe compensated literals, denoted as FragilePairsFragilePairs and SafePairsSafePairs (line 1). Firstly, KK (a parameter) false literals are picked from overall falsified clauses, and all critical move operations in these literals are added into CandOpCandOp (lines 2–7). Note that it prioritizes hard clauses over soft clauses.

Then, for each operation op1CandOpop_{1}\in CandOp, we go through each compensated literal 2CL(op1)\ell_{2}\in CL(op_{1}). If 2\ell_{2} is fragile (resp. safe), the set of corresponding pairwise operations determined by pair_set(2,op1)pair\_set(\ell_{2},op_{1}) are added to the FragilePairsFragilePairs (resp. SafePairsSafePairs) (line 8–13).

According to the two-level picking heuristic, if there exist decreasing operations in FragilePairsFragilePairs, we pick the one with the greatest scorescore (lines 14–15). Otherwise, we pick a decreasing operation in SafePairsSafePairs if it exists (lines 16–17). An operation with the greatest scorescore is selected via the BMS heuristic [7]. Specifically, the BMS heuristic samples tt pairwise operations (a parameter), and selects the decreasing one with the greatest scorescore.

Output: a decreasing pairwise operation if found
1 FragilePairs:=FragilePairs:=\emptyset,SafePairs:=SafePairs:=\emptyset, CandOp:=CandOp:=\emptyset BestPair:=nullBestPair:=null ;
2 for i=1i=1 to KK do
3       if {\exists} hard falsified clauses then
4             1:=\ell_{1}:= a random literal in a falsified hard clause ;
5            
6      else if {\exists} soft falsified clauses then
7             1:=\ell_{1}:= a random literal in a falsified soft clause ;
8            
9      CandOp:=CandOp{cm(x,1)|xappearsin1}CandOp:=CandOp\bigcup\{cm(x,\ell_{1})|x\;appears\;in\;\ell_{1}\};
10      
11foreach op1op_{1} in CandOpCandOp do
12       foreach literal 2CL(op1)\ell_{2}\in CL(op_{1})  do
13             if 2\ell_{2} is fragile then
14                   FragilePairs:=FragilePairsFragilePairs:=FragilePairs \cup pair_set(2,op1)pair\_set(\ell_{2},op_{1});
15                  
16            else if 2\ell_{2} is safe then
17                   SafePairs:=SafePairsSafePairs:=SafePairs \cup pair_set(2,op1)pair\_set(\ell_{2},op_{1});
18                  
19            
20      
21if {\exists} decreasing operation in FragilePairsFragilePairs then
22       BestPair:=BestPair:=the operation with the greatest score picked by BMS;
23      
24else if {\exists} decreasing operation in SafePairsSafePairs then
25       BestPair:=BestPair:=the operation with the greatest score picked by BMS;
26      
27return BestPairBestPair;
28
Algorithm 2 pick_pairwise_op

6 Local search algorithm

1 while non_imp_steps<MaxStepsnon\_imp\_steps<MaxSteps do
2       if \not\exists falsified hard clauses AND cost(α)<costcost(\alpha)<cost^{*} then
3             α:=α,cost:=cost(α)\alpha^{*}:=\alpha,\;cost^{*}:=cost(\alpha);
4            
5      if {\exists} decreasing critical move in hard falsified clauses then
6             op:=op:= a decreasing critical move with the greatest score picked by BMS;
7            
8      else if {\exists} decreasing critical move in soft falsified clauses then
9             op:=op:= a decreasing critical move with the greatest score picked by BMS;
10            
11      else op:=pick_pairwise_op()op:=pick\_pairwise\_op();
12       if op==nullop==null then
13             update penalty weights by Weighting-PMS;
14             if \exists falsified hard clauses then  c:=c:= a random falsified hard clause ;
15             else  c:=c:= a random falsified soft clause ;
16             op:=op:= the critical move with the greatest scorescore in c;
17            
18      perform opop to modify α\alpha;
19      
Algorithm 3 Integer Mode of PairLS

Based on the above novel components, we propose our algorithm for MaxSMT(L
IA) called PairLS, prioritizing hard clauses over soft clauses. PairLS initializes the complete current solution α\alpha by assigning all Integer variables to 0 and all Boolean variables to falsefalse. Then, PairLS switches between Integer mode and Boolean mode. When the time limit is reached, the best solution α\alpha^{*} and the corresponding best cost costcost^{*} are reported if a feasible solution can be found. Otherwise, “No solution found” is reported.

The Integer mode of PairLS is described in Algorithm 3. The current solution α\alpha is iteratively modified until the number of non-improving steps non_impr_stepnon\_impr\_step exceeds the threshold boundsbounds (line 1). If a feasible solution with a smaller costcost is found, then the best solution α\alpha^{*} and the best cost costcost^{*} are updated (lines 2–3). In each iteration, the algorithm first tries to find a decreasing critical move operation with the greatest score via BMS heuristic [7] (line 4–7). Note that it prefers to pick operations from falsified hard clauses, and falsified soft clauses are picked only if all hard clauses are satisfied. If it fails to find any decreasing critical move operation, indicating that it falls into the local optimum of modifying individual variables, then it continues to search the neighborhood of pairwise operation (line 8). If there exists no decreasing operation in both neighborhoods, the algorithm further escapes from the local optimum by updating the penalty weight (line 10), and satisfying a random clause by performing a critical move operation in it, preferring the one with the greatest score (lines 11–13). Specifically, it also prioritizes hard clauses over soft clauses.

In the Boolean mode, the formula is reduced to a subformula that purely contains Boolean variables, which is indeed a MaxSAT instance. Thus, our algorithm performs in the same way as SATLike3.0222 https://lcs.ios.ac.cn/~caisw/Code/maxsat/SATLike3.0.zip, a state-of-the-art local search algorithm for MaxSAT [19].

7 Experiments

Experiments are conducted on 3 benchmarks to evaluate PairLS, comparing it with state-of-the-art MaxSMT solvers. The promising experimental result indicates that our algorithm is efficient and effective in most instances. We also present the evolution of solution quality over time, showing that PairLS can efficiently find promising solutions within a short time limit. Moreover, the ablation experiment is carried out to confirm the effectiveness of our proposed strategies.

7.1 Experiment Preliminaries

Implementation: PairLS is implemented in C++ and compiled by g++ with the ’-O3’ option enabled. There are 3 parameters in the solver: LL for switching modes; tt (the number of samples) for the BMS heuristic; KK denotes the size of CandOpCandOp. The parameters are tuned according to our preliminary experiments and suggestions from the previous literature. They are set as follows: L=20L=20, t=100t=100, K=10K=10.

Competitors: We compare PairLS with 2 state-of-the-art MaxSMT solvers, namely OptiMathSAT(version 1.7.3) and νZ\nu Z(version 4.11.2). OptiMathSAT applies MaxRes as the MaxSAT engine, denoted as Opt_res, while the default configuration encodes the MaxSMT problem as an optimization problem, denoted as Opt_omt. νZ\nu Z also has 2 configurations based on the MaxSAT engines MaxRes and WMax, denoted as νZ\nu Z_res and νZ\nu Z_wmax, respectively. The binary code of OptiMathSAT and νZ\nu Z is downloaded from their websites.

Benchmarks: Our experiments are conducted on 3 benchmarks. Those instances where the hard constraints are unsatisfiable are excluded, as they do not have feasible solutions.

Benchmark MaxSMT-LIA: This benchmark consists of 5520 instances generated based on SMT(LIA) instances from SMT-LIB333 https://clc-gitlab.cs.uiowa.edu:2443/SMT-LIB-benchmarks/QF_LIA. The original SMT(LI
A) benchmark consists of 690 instances from 3 families, namely bofill, convert, and wisa444SMT(LIA) instances from other families are excluded because most of them are in the form of a conjunction of unit clauses, and thus the generation method is not applicable, since each produced soft assertion is also a hard assertion.. We adopt the same method to generate instances as in previous literature [15]: adding randomly chosen arithmetic atoms in the original problem with a certain proportion as unit soft assertions. 4 proportions of soft clauses (denoted as SRSR) are applied, namely 10%, 25%, 50% and 100%. 2 MaxSMT instances can be generated from each original SMT instance, based on different ways to associate soft clauses with weights: one associates each soft clause with a unit weight of 1, and the other associates each soft clause with a random weight between 1 and the total number of atoms. Instances with unit weights and random weights are not distinguished as in [15]. The total number of instances is 690×2×4=5520690\times 2\times 4=5520, where 690 denotes the number of original SMT(LIA) instances, 2 denotes 2 kinds of weights associated with soft clauses, and 4 denotes the 4 proportions of soft clauses. Note that the “bofill” family was adopted in [15], while the family of “convert” and “wisa” are new instances.

Benchmark MaxSMT-IDL: This benchmark contains 12888 new MaxSM-
T instances generated by the above method, based on 1611 SMT(IDL) instances including all families from SMT-LIB555 https://clc-gitlab.cs.uiowa.edu:2443/SMT-LIB-benchmarks/QF_IDL (similar to MaxSMT-LIA benchmark, the total number of instances is 1611×2×4=128881611\times 2\times 4=12888). Instances with unit weights and random weights are also not distinguished when reporting results.

Benchmark LL: The benchmark was proposed in [14]. Unsatisfiable instances and instances over linear real arithmetic are excluded, resulting in 114 instances in total. 56 instances contain soft clauses with unit weights of 1, and 58 instances contain soft clauses with random weights ranging from 1 to 100. Instances with Unit weights and Random weights are distinguished as in [14].

Experiment Setup: All experiments are conducted on a server with Intel Xeon Platinum 8153 2.00GHz and 2048G RAM under the system CentOS 7.7.1908. Each solver executes one run for each instance in these benchmarks, as they contain sufficient instances. The cutoff time is set to 300 seconds for the MaxSMT-LIA and MaxSMT-IDL benchmarks as previous work [15], and 1200 seconds for the LL benchmark as previous work [14].

For each family of instances, we report the number of instances where the corresponding solver can find the best solution with the smallest costcost among all solvers, denoted by #win\#win, and the average running time to yield those best solutions, denoted as timetime. Note that when multiple solvers find the best solution with the same costcost within the cutoff time, they are all considered to be winners. The solvers with the most #win\#win in the table are emphasized with bold value.

The solution found by solvers and the corresponding time are defined as follows: As for complete solvers, νZ\nu Z and OptiMathSAT, we take the best upper bound found within the cutoff time as their solution, and the time to find such upper bound is recorded by referring to the log file. Note that the proving time for complete solvers is excluded. As for PairLS, the best solution found so far within the cutoff time and the time to find such a solution are recorded.

7.2 Comparison to Other MaxSMT Solvers

Results on benchmark MaxSMT-LIA: As presented in Table 1, PairLS shows competitive and complementary performance on this benchmark. Regardless of the proportion of soft clauses SRSR, PairLS always leads in the total number of winning instances. On the “bofill” family, PairLS performs better on instances with larger SRSR, confirming that PairLS is good at solving hard instances. On the “convert” family, PairLS outperforms all competitors regardless of SRSR. On the “wisa” family, PairLS cannot rival its competitors. In Fig.3 of Appendix C, we also present the run time comparison between PairLS and the best configuration of competitors, namely νZ\nu Z_res and Opt_res. The run time comparison indicates that PairLS is more efficient than Opt_res and is complementary to νZ\nu Z_res.

Results on benchmark MaxSMT-IDL: As presented in Table 2, PairLS can significantly outperform all competitors regardless of the proportion of soft clauses. In the overall benchmark, PairLS can find a better solution than all competitors on 53.5% of total instances, and it can lead the best competitor by 1224 “winning” instances, confirming its dominating performance. In Fig.4 of Appendix C, we also present the run time comparison between PairLS and the best configuration of competitors, namely νZ\nu Z_res and Opt_omt, indicating that PairLS is more efficient than competitors in instances with small SRSR.

Results on LL benchmark: The results are shown in Table 3. PairLS shows comparable but overall poor performance compared to its competitors on this benchmark. One possible reason is that the front-end encoding for these benchmarks would generate many auxiliary Boolean variables, while PairLS cannot effectively explore the Boolean structure as LS-LIA [9]. Specifically, the average number of auxiliary variables in this benchmark is 1220, while the counterparts in MaxSMT-LIA and MaxSMT-IDL are 327 and 528.

Table 1: Results on benchmark MaxSMT-LIA. The results are classified according to the proportion of soft clauses, SRSR. SumSum presents the overall performance.
SRSR family #inst Opt_omt Opt_res νZ\ \ \ \nu Z_res νZ\ \ \nu Z_wmax     PairLS
#win\#win(timetime) #win\#win(timetime) #win\#win(timetime) #win\#win(timetime) #win\#win(timetime)
10% bofill 814 773(17.1) 777(7.1) 758(7.9) 797(7.6) 762(10.9)
convert 560 445(21.1) 495(1.2) 228(18.4) 8(103.1) 558(1.1)
wisa 6 4(27.4) 3 (33.3) 6 (11.3) 0(0) 0(0)
Total 1380 1222(18.6) 1275(4.9) 992(10.3) 805(8.5) 1320(6.7)
25% bofill 814 736(59.2) 720 (17.1) 677(21.9) 776(21.8) 641(35.4)
convert 560 415(16.3) 493(12.7) 205(13.3) 5(125.6) 558(1.4)
wisa 6 4(14.5) 1(11.3) 4(73.2) 0(0) 0(0)
Total 1380 1155(43.6) 1214(16.1) 886(20.1) 781(22.5) 1199(19.6)
50% bofill 814 82(231.0) 489(12.1) 515(33.1) 217(35.8) 542(66.7)
convert 560 405(22.3) 508(9.1) 177(19.8) 0(0) 558(1.2)
wisa 6 3(36.6) 1(11.3) 5(39.2) 0(0) 0(0)
Total 1380 490(57.3) 998(10.8) 697(29.8) 217(39.7) 1100(33.4)
100% bofill 814 0(0) 0(0) 402(75.6) 15(20.7) 601(128.8)
convert 560 399(27.3) 503(14.7) 185(19.3) 19(55.0) 558(1.2)
wisa 6 1(162.2) 1(193.3) 6(38.3) 0(0) 0(0)
Total 1380 400(27.7) 504(15.0) 593(57.6) 34(39.9) 1159(67.3)
SumSum 5520 3267(34.3) 3937(10.9) 3168(26.1) 1837(18.7) 4778(30.7)
Table 2: Results on MaxSMT-IDL benchmark. The results are classified according to the proportion of soft clauses, SRSR. SumSum presents the overall performance.
SRSR #inst     Opt_omt     Opt_res νZ\ \ \ \nu Z_res νZ\nu Z_wmax     PairLS
#win\#win(timetime) #win\#win(timetime) #win\#win(timetime) #win\#win(timetime) #win\#win(timetime)
10% 3222 1086(248.1) 873(201.6) 1151(238.4) 839(221.5) 1542(159.9)
25% 3222 1171(195.2) 934(178.6) 1502(192.7) 722(292.1) 1744(148.0)
50% 3222 1094(195.8) 890(183.2) 1461(198.2) 758(290.9) 1829(149.3)
100% 3222 1061(204.1) 880(198.3) 1559(201.6) 934(260.4) 1782(157.1)
SumSum 12888 4412(210.5) 3577(190.2) 5673(205.8) 3253(264.5) 6897(153.3)
Table 3: Results on LL benchmark. Instances with Unit weights and Random weights are distinguished. SumSum presents the overall performance.
Category #inst Opt_omt Opt_res νZ\nu Z_res νZ\nu Z_wmax PairLS
#win\#win(timetime) #win\#win(timetime) #win\#win(timetime) #win\#win(timetime) #win\#win(timetime)
Unit 56 41(117.3) 32(130.3) 49(183.2) 15(40.0) 23(0.4)
Random 58 45(117.9) 37(120.3) 53(100.1) 17(39.0) 22(0.4)
SumSum 114 86(117.6) 69(124.9) 102(140.0) 32(39.5) 45(0.4)

7.3 Evolution of Solution Quality

To be more informative in understanding how the solvers compare in practice, the evolution of the solution quality over time is presented. Specifically, we evaluate the overall performance on the MaxSMT-LIA and MaxSMT-IDL benchmark with 4 cutoff times, denoted as cutoff: 50, 100, 200, 300 seconds. Given an instance, the proportion of the costcost to the sum of soft clause weights is denoted as costPcost_{P} 666If no feasible solution is found, then costPcost_{P} is set as 1. Note that we present the average costPcost_{P} rather than the average costcost, since the costcost of certain instances can be quite large, dominating the average costcost.. The average costPcost_{P} over time is presented in Fig.LABEL:ev, showing that PairLS can efficiently find high-quality solutions within a short time. Moreover, we also report the “winning” instances over time. As shown in Table 7 in Appendix D, on each benchmark, PairLS leads the best competitor by at least 645 “winning” instances regardless of the cutoff time, confirming its dominating performance.

7.4 Effectiveness of Proposed Strategies

To analyze the effectiveness of our proposed strategies, two modified versions of PairLS are proposed as follows.

  • To analyze the effectiveness of pairwise operation, we modify PairLS by only using the critical move operator, leading to the version vno_pairv_{no\_pair}.

  • To analyze the effectiveness of two-level heuristic in compensation-based picking heuristic for picking a pairwise operation, PairLS is modified by selecting pairwise operation without distinguishing the fragile and safe compensated literals, leading to the version vone_levelv_{one\_level}.

We compare PairLS with these modified versions on 3 benchmarks. The results of this ablation experiment are presented in Table 4, confirming the effectiveness of the proposed strategies.

Moreover, we also analyze the extension for simultaneously operating on more variables. PairLS is modified by simultaneously modifying three variables, where the third variable is modified to compensate for the second one, leading to the version vtuplev_{tuple}. We conduct our experiments on MaxSMT-LIA. The results are in Apendix E. When N=3N=3, the number of possible operations increases from O(k2k^{2}) to O(k3k^{3}), where kk is the number of variables in unsatisfied clauses. This might significantly slow down the searching process, indicating that modifying 2 variables simultaneously is the best choice of trade-off between cost and effectiveness.

Table 4: Comparing PairLS with its modified versions. The number of instances where PairLS performs better and worse are presented, denoted as #better and #worse respectively. An algorithm is better than its competitor on a certain instance if it can find a solution with a lower costcost.
#inst vno_pairv_{no\_pair} vone_levelv_{one\_level}
#better\#better #worse\#worse #better\#better #worse\#worse
MaxSMT-LIA 5520 1834 65 705 457
MaxSMT-IDL 12888 3242 1962 3005 1826
LL 114 27 0 5 0

8 Discussion on the Extension of Pairwise Operation

Since pairwise operator can be adapted to SMT(LIA) instances without additional modifications, a potential extension is incorporating it into the local search algorithm for SMT(LIA). When there is no decreasing cm operation in the integer mode of LS-LIA (Algorithm 1 in Page 5), we apply pairwise operator to LS-LIA to enrich the search space as in PairLS, resulting in the corresponding version called LS-LIA-Pair. We compare LS-LIA-Pair with LS-LIA and other complete SMT solvers on SMT(LIA) instances, reporting the number of unsolved instances for each solver (Details are in Appendix F). Without any specific customization tailored for SMT, in both categories, LS-LIA-Pair can solve 20 more instances compared to LS-LIA, which demonstrates that pairwise operator is an extensible method and could be further explored to enhance the local search algorithm for SMT.

9 Conclusion and Future Work

In this paper, we propose the first local search algorithm for MaxSMT(LIA), called PairLS, based on the following components. A novel pairwise operator is proposed to enrich the search space. A compensation-based picking heuristic is proposed to determine and distinguish pairwise operations. Experiments show that PairLS is competitive with state-of-the-art MaxSMT solvers, and pairwise operator is a general method. Moreover, we also would like to develop a local search algorithm for MaxSMT on non-linear integer arithmetic and Optimization Modulo Theory problems. Lastly, we hope to combine PairLS with complete solvers, since PairLS can efficiently find a solution with promising costcost, serving as an upper bound for complete solvers to prune the search space.

Acknowledgements

This research is supported by NSFC Grant 62122078 and CAS Project for Young Scientists in Basic Research (Grant No.YSBR-040).

References

  • [1] Albert, E., Gordillo, P., Rubio, A., Schett, M.A.: Synthesis of super-optimized smart contracts using max-smt. In: International Conference on Computer Aided Verification. pp. 177–200. Springer (2020)
  • [2] Ansótegui, C., Bonet, M.L., Levy, J.: Sat-based maxsat algorithms. Artificial Intelligence 196, 77–105 (2013)
  • [3] Balint, A., Schöning, U.: Choosing probability distributions for stochastic local search and the role of make versus break. In: Proc. of SAT 2012. pp. 16–29 (2012)
  • [4] Biere, A.: Splatz, Lingeling, Plingeling, Treengeling, YalSAT entering the SAT competition 2016. Proc. of SAT Competition 2016 pp. 44–45 (2016)
  • [5] Bjørner, N.S., Phan, A.D.: ν\nuz-maximal satisfaction with z3. Scss 30,  1–9 (2014)
  • [6] Brockschmidt, M., Larra, D., Oliveras, A., Rodrıguez-Carbonell, E., Rubio, A.: Compositional safety verification with max-smt. In: 2015 Formal Methods in Computer-Aided Design (FMCAD). pp. 33–40. IEEE (2015)
  • [7] Cai, S.: Balance between complexity and quality: Local search for minimum vertex cover in massive graphs. In: Twenty-Fourth International Joint Conference on Artificial Intelligence. pp. 747–753 (2015)
  • [8] Cai, S., Lei, Z.: Old techniques in new ways: Clause weighting, unit propagation and hybridization for maximum satisfiability. Artificial Intelligence 287, 103354 (2020)
  • [9] Cai, S., Li, B., Zhang, X.: Local search for smt on linear integer arithmetic. In: International Conference on Computer Aided Verification. pp. 227–248. Springer (2022)
  • [10] Cai, S., Li, B., Zhang, X.: Local search for satisfiability modulo integer arithmetic theories. ACM Transactions on Computational Logic 24(4), 1–26 (2023)
  • [11] Cai, S., Luo, C., Su, K.: CCAnr: A configuration checking based local search solver for non-random satisfiability. In: Proc. of SAT 2015. pp. 1–8 (2015)
  • [12] Cai, S., Su, K.: Local search for boolean satisfiability with configuration checking and subscore. Artificial Intelligence 204, 75–98 (2013)
  • [13] Cimatti, A., Franzén, A., Griggio, A., Sebastiani, R., Stenico, C.: Satisfiability modulo the theory of costs: Foundations and applications. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems. pp. 99–113. Springer (2010)
  • [14] Cimatti, A., Griggio, A., Schaafsma, B.J., Sebastiani, R.: A modular approach to maxsat modulo theories. In: International conference on theory and applications of satisfiability testing. pp. 150–165. Springer (2013)
  • [15] Fazekas, K., Bacchus, F., Biere, A.: Implicit hitting set algorithms for maximum satisfiability modulo theories. In: International Joint Conference on Automated Reasoning. pp. 134–151. Springer (2018)
  • [16] Fröhlich, A., Biere, A., Wintersteiger, C., Hamadi, Y.: Stochastic local search for satisfiability modulo theories. In: Proc. of AAAI 2015. vol. 29 (2015)
  • [17] Ignatiev, A., Morgado, A., Marques-Silva, J.: Rc2: an efficient maxsat solver. Journal on Satisfiability, Boolean Modeling and Computation 11(1), 53–64 (2019)
  • [18] Larraz, D., Nimkar, K., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A.: Proving non-termination using max-smt. In: Computer Aided Verification: 26th International Conference, CAV 2014, Held as Part of the Vienna Summer of Logic, VSL 2014, Vienna, Austria, July 18-22, 2014. Proceedings 26. pp. 779–796. Springer (2014)
  • [19] Lei, Z., Cai, S.: Solving (weighted) partial maxsat by dynamic local search for sat. In: IJCAI. vol. 7, pp. 1346–52 (2018)
  • [20] Li, B., Cai, S.: Local search for smt on linear and multilinear real arithmetic. arXiv preprint arXiv:2303.06676 (2023)
  • [21] Li, C.M., Li, Y.: Satisfying versus falsifying in local search for satisfiability. In: Proc. of SAT 2012. pp. 477–478 (2012)
  • [22] Li, C.M., Manya, F.: Maxsat, hard and soft constraints. In: Handbook of satisfiability, pp. 903–927. IOS Press (2021)
  • [23] Li, C.M., Xu, Z., Coll, J., Manyà, F., Habet, D., He, K.: Combining clause learning and branch and bound for maxsat. In: 27th International Conference on Principles and Practice of Constraint Programming (CP 2021). Schloss Dagstuhl-Leibniz-Zentrum für Informatik (2021)
  • [24] Li, H., Xia, B., Zhao, T.: Local search for solving satisfiability of polynomial formulas. arXiv preprint arXiv:2303.09072 (2023)
  • [25] Martins, R., Manquinho, V., Lynce, I.: Open-wbo: A modular maxsat solver. In: Theory and Applications of Satisfiability Testing–SAT 2014: 17th International Conference, Held as Part of the Vienna Summer of Logic, VSL 2014, Vienna, Austria, July 14-17, 2014. Proceedings 17. pp. 438–445. Springer (2014)
  • [26] Niemetz, A., Preiner, M.: Ternary propagation-based local search for more bit-precise reasoning. In: # PLACEHOLDER_PARENT_METADATA_VALUE#. vol. 1, pp. 214–224. TU Wien Academic Press (2020)
  • [27] Niemetz, A., Preiner, M., Biere, A.: Precise and complete propagation based local search for satisfiability modulo theories. In: International Conference on Computer Aided Verification. pp. 199–217. Springer (2016)
  • [28] Niemetz, A., Preiner, M., Biere, A.: Propagation based local search for bit-precise reasoning. Formal Methods in System Design 51(3), 608–636 (2017)
  • [29] Nieuwenhuis, R., Oliveras, A.: On sat modulo theories and optimization problems. In: Theory and Applications of Satisfiability Testing-SAT 2006: 9th International Conference, Seattle, WA, USA, August 12-15, 2006. Proceedings 9. pp. 156–169. Springer (2006)
  • [30] Sebastiani, R., Tomasi, S.: Optimization in smt with (\mathbb{Q}) cost functions. In: International Joint Conference on Automated Reasoning. pp. 484–498. Springer (2012)
  • [31] Sebastiani, R., Tomasi, S.: Optimization modulo theories with linear rational costs. ACM Transactions on Computational Logic (TOCL) 16(2), 1–43 (2015)
  • [32] Sebastiani, R., Trentin, P.: Optimathsat: A tool for optimization modulo theories. Journal of Automated Reasoning 64(3), 423–460 (2020)
  • [33] Terra-Neves, M., Machado, N., Lynce, I., Manquinho, V.: Concurrency debugging with maxsmt. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 33, pp. 1608–1616 (2019)

Appendix 0.A Proof of Proposition 1

Proof.

The sets of clauses containing variables v1v_{1} and v2v_{2} are denoted as Cv1C_{v_{1}} and Cv2C_{v_{2}}, respectively. For simplicity, we denote the sets of clauses where only either variable v1v_{1} or v2v_{2} occur (but not both) as Cv1¯=Cv1(Cv1Cv2)C_{\bar{v_{1}}}=C_{v_{1}}\setminus(C_{v_{1}}\wedge C_{v_{2}}) and Cv2¯=Cv2(Cv1Cv2)C_{\bar{v_{2}}}=C_{v_{2}}\setminus(C_{v_{1}}\wedge C_{v_{2}}), respectively. If the pairwise operation op1op_{1} is decreasing, then the following inequality holds:

score(op1)=scoreCv1¯(op1)+scoreCv2¯(op1)+scoreCv1Cv2(op1)>0score(op_{1})=score_{C_{\bar{v_{1}}}}(op_{1})+score_{C_{\bar{v_{2}}}}(op_{1})+score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{1})>0 (1)

While individually operating op2op_{2} and op3op_{3} are not decreasing:

score(op2)=scoreCv1¯(op2)+scoreCv1Cv2(op2)0score(op_{2})=score_{C_{\bar{v_{1}}}}(op_{2})+score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{2})\leq 0 (2)
score(op3)=scoreCv2¯(op3)+scoreCv1Cv2(op3)0score(op_{3})=score_{C_{\bar{v_{2}}}}(op_{3})+score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{3})\leq 0 (3)

Note that, since Cv1¯C_{\bar{v_{1}}} and Cv2¯C_{\bar{v_{2}}} only either consist of v1v_{1} or v2v_{2} (but not both), scoreCv1¯(op1)=scoreCv1¯(op2)score_{C_{\bar{v_{1}}}}(op_{1})=score_{C_{\bar{v_{1}}}}(op_{2}) and scoreCv2¯(op1)=scoreCv2¯(op3)score_{C_{\bar{v_{2}}}}(op_{1})=score_{C_{\bar{v_{2}}}}(op_{3}). By (1)-(2)-(3), it can be inferred from the above inequality that:

scoreCv1Cv2(op1)>scoreCv1Cv2(op2)+scoreCv1Cv2(op3)score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{1})>score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{2})+score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{3}) (4)

Assumption: assume that there does not exist any clause cc containing both v1v1 and v2v2 (cCv1Cv2c\in C_{v_{1}}\wedge C_{v_{2}}), and score{c}(op1)>score{c}(op2)+score{c}(op3)score_{\{c\}}(op_{1})>score_{\{c\}}(op_{2})+score_{\{c\}}(op_{3}), the following inequality holds:

cCv1Cv2,score{c}(op1)score{c}(op2)+score{c}(op3)\forall c\in C_{v_{1}}\wedge C_{v_{2}},score_{\{c\}}(op_{1})\leq score_{\{c\}}(op_{2})+score_{\{c\}}(op_{3}) (5)

According to (5), by summing up the score{c}score_{\{c\}} on each clause cCv1Cv2c\in C_{v_{1}}\wedge C_{v_{2}} we can conclude that:

scoreCv1Cv2(op1)scoreCv1Cv2(op2)+scoreCv1Cv2(op3)score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{1})\leq score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{2})+score_{C_{v_{1}}\wedge C_{v_{2}}}(op_{3}) (6)

(4) and (6) contradicts, and thus our assumption is false. So we can conclude that there should be at least one clause cc containing both v1v_{1} and v2v_{2}, and on cc, score{c}(op1)>score{c}(op2)+score{c}(op3)score_{\{c\}}(op_{1})>score_{\{c\}}(op_{2})+score_{\{c\}}(op_{3}). \square

Appendix 0.B Compenstation-based pairwise operation can satisfy necessary condition of Proposition 1

Lemma 1.

The compensation-based pairwise operation can satisfy the necessary condition proposed in Proposition 1 to find a decreasing pairwise operation when there is no decreasing cmcm operation.

Proof.

A compensation-based pairwise op1=p(v1,v2,val1,val2)op_{1}=p(v_{1},v_{2},val_{1},val_{2}) is regarded as simultaneously performing a pair of operations modifying individual variables, op2op_{2} assigning v1v_{1} to val1val_{1} and op3op_{3} assigning v2v_{2} to val2val_{2}. According to the concept of compensation, there exists a true literal CL(op2)\ell\in CL(op_{2}) which is the only true literal for some clauses, but \ell would become false after individually performing op2op_{2}. Moreover, \ell remains true after performing op1op_{1}.

Let cc denote the satisfied clause containing such compensated literal CL(op2)\ell\in CL(op_{2}) as the only true literal in it. Since \ell contains both v1v_{1} and v2v_{2}, cc contains both v1v_{1} and v2v_{2}.

According to the definition of scorescore, given a satisfied clause cc, if it is falsified by an operation opop, then score{c}(op)<0score_{\{c\}}(op)<0. If cc remains satisfied after performing opop, then scorec(op)=0score_{c}(op)=0:

Since \ell is the only true literal in cc and \ell can be falsified by performing op2op_{2}, then cc will be falsified by op2op_{2}:

score{c}(op2)<0score_{\{c\}}(op_{2})<0 (7)

Since cc has already been a satisfied clause, it can only be falsified or remain true after performing op3op_{3}:

score{c}(op3)0score_{\{c\}}(op_{3})\leq 0 (8)

Adding (7) and (8), we can conclude:

score{c}(op2)+score{c}(op3)<0score_{\{c\}}(op_{2})+score_{\{c\}}(op_{3})<0 (9)

Since \ell remains true after performing op1op_{1}, then cc remains satisfied after performing op1op_{1}.

score{c}(op1)=0score_{\{c\}}(op_{1})=0 (10)

According to (9) and (10), we can conclude that cc is a common clause that contains both v1v_{1} and v2v_{2}, and score{c}(op1)>score{c}(op2)+score{c}(op3)score_{\{c\}}(op_{1})>score_{\{c\}}(op_{2})+score_{\{c\}}(op_{3}). Thus the compensation-based pairwise operation satisfies the necessary condition proposed in Proposition 1 to find a decreasing pairwise operation when there is no decreasing cmcm operation. \square

Appendix 0.C Experiment of Time

In the MaxSMT-LIA and MaxSMT-IDL benchmark, scatter plots are adopted to present the runtime comparison between PairLS and competitors with the best configuration, if both solvers can find a solution with the same costcost. The x-axis (resp. y-axis) denotes the runtime of PairLS (resp. competitor). Thus, nodes above the diagonal indicate instances that can be solved faster by PairLS.

Figure 7: Run time comparison on MaxSMT-LIA.
Figure 11: Run time comparison on MaxSMT-IDL

Appendix 0.D Experiment of Evolution of Solution Quality

Table 5: The evolution of solution quality with different cutoff times in MaxSMT-LIA benchmark (LIA for short) and MaxSMT-IDL benchmark (IDL for short).
cutoff #inst Opt_omt Opt_res νZ\ \ \ \nu Z_res νZ\ \ \nu Z_wmax      PairLS
#win\#win(timetime) #win\#win(timetime) #win\#win(timetime) #win\#win(timetime) #win\#win(timetime)
LIA 50 5520 2869(10.6) 3362(10.3) 2906(8.2) 1803(10.2) 4531(17.8)
100 5520 3102(20.0) 3712(10.5) 2980(14.0) 1802(18.9) 4717(25.3)
200 5520 3237(32.1) 3914(10.2) 3130(19.6) 1805(20.1) 4763(27.6)
300 5520 3267(34.3) 3937(10.9) 3168(26.1) 1837(18.7) 4778(30.7)
IDL 50 12888 5239(22.2) 4589(20.9) 6373(24.7) 4322(18.7) 7175(35.9)
100 12888 5220(42.1) 4489(39.6) 6369(47.2) 4075(34.8) 7014(70.1)
200 12888 5091(138.7) 4248(143.1) 6063(130.1) 3881(134.3) 6968(131.4)
300 12888 4412(210.5) 3577(190.2) 5673(205.8) 3253(264.5) 6897(153.3)

Appendix 0.E Experiment of Extended Neighborhood

We conduct our experiments on MaxSMT-LIA. The results are in Table 6. #Avergage Steps represents the number of iterations of the algorithm.

Table 6: Extend the number of compensated variables on MaxSMT-LIA.
      vno_pairv_{no\_pair}       PairLS       vtuplev_{tuple}
      #win       3686       5455       1029
      #Average Steps       1952354       356752       35850

Appendix 0.F Experiment of SMT-LIB

Competitors: We compare LS-LIA_Pair with LS-LIA and 4 state-of-the-art complete SMT solvers according to SMT-COMP 2023777https://smt-comp.github.io/2023, namely MathSAT5(version 5.6.6), CVC5(version 0.0.4), Yices2(version 2.6.2), and Z3(version 4.8.14). The binaries of all competitors are downloaded from their websites.

Benchmarks: This benchmark consists of SMT(LIA) instances from SMT-LIB888https://clc-gitlab.cs.uiowa.edu:2443/SMT-LIB-benchmarks/QF_LIA. UNSAT instances are excluded, resulting in a benchmark consisting of 6670 unknown and satisfiable instances. Cutoff time is set as 1200 seconds.

Table 7: Results on instances from SMTLIB.
Family Type #inst MathSAT5 CVC5 Yices2 Z3 LS-LIA LS-LIA-Pair
Without Boolean 20180326-Bromberger 631 123 206 273 99 50 50
bofill-scheduling 407 0 5 0 2 16 10(-6)
CAV_2009_benchmarks 506 0 8 110 0 0 0
check 0 0 0 0 0 0 0
convert 280 7 75 94 96 1 1
dillig 230 0 0 30 0 0 0
miplib2003 16 6 7 5 8 3 3
pb2010 41 27 36 20 8 13 6(-7)
prime-cone 19 0 0 0 0 0 0
RWS 20 9 7 9 6 8 8
slacks 231 1 0 70 1 0 0
wisa 3 0 0 0 0 0 0
SMPT(2022) 4285 85 84 65 65 101 94 (-7)
Total 6670 228 428 676 285 192 172(-20)
With Boolean 2019-cmodelsdiff 144 50 49 49 49 93 76 (-17)
2019-ezsmt 108 24 29 27 27 54 51 (-3)
20210219-Dartagnan 47 25 25 24 24 45 45
arctic-matrix 100 57 74 41 53 23 23
Averest 9 0 0 0 0 2 2
calypto 24 0 0 0 0 21 21
CIRC 18 0 0 0 0 15 15
fft 5 2 2 2 2 2 2
mathsat 21 0 0 0 0 8 8
nec-smt 1256 12 831 0 14 675 675
RTCL 2 0 0 0 0 0 0
tropical-matrix 108 53 66 37 56 10 10
Total 1842 223 766 180 225 930 910(-20)