## Advances in Symmetry Breaking for SAT Modulo Theories

## Saket Dingliwal, Ronak Agarwal, Happy Mittal, Parag Singla

1 Indian Institute of Technology, Delhi

{ cs1150254, cs1150252, happy.mittal, parags } @cse.iitd.ac.in

## Abstract

Symmetry breaking is a popular technique to reduce the search space for SAT solving by exploiting the underlying symmetry over variables and clauses in a formula. The key idea is to first identify sets of assignments which fall in the same symmetry class, and then impose ordering constraints, called Symmetry Breaking Predicates (SBPs), such that only one (or a small subset) of these assignments is allowed to be a solution of the original SAT formula. While this technique has been exploited extensively in the SAT literature, there is little work on using symmetry breaking for SAT Modulo Theories (SMT). In SMT, logical constraints in SAT theories are combined with another set of theory operations defined over non-Boolean variables such as integers, reals etc. SMT solvers typically use a combination of SAT solving techniques augmented with calls to the theory solver. In this work, we take up the advances in SAT symmetry breaking, and apply them to the domain of SMT. Our key technical contribution is the formulation of symmetry breaking over the Boolean skeleton variables, which are placeholders for actual theory operations in SMT solving. These SBPs are then applied over the SAT solving part of the SMT solver. We implement our SBP ideas on top of CVC4, which is a state-ofthe-art SMT solver. Our approach can result in significantly faster solutions on several benchmark problems compared to the state-of-the-art. Our final solver is a hybrid of the original CVC4 solver, and an SBP based solver, and can solve up to 3.8% and 3.1% more problems in the QF NIA category of 2018 and 2019 SMT benchmarks, respectively, compared to CVC4, the top performer in this category.

an ordering constraint is imposed over them using what is referred to as, Symmetry Breaking Predicates (SBPs). These SBPs result in eliminating a large number of assignments which are identical to each other, often leaving one single assignment in each symmetry class, and therefore drastically pruning the search space. Use of SBPs for SAT solving has been shown to give significant computational advantages for a large class of problems and a number of advances in symmetry breaking have been proposed over time (Aloul, Sakallah, and Markov 2006; Devriendt and Bogaerts 2015).

## Introduction

A large class of AI problems can be reduced to the problem of SAT. One of the important advances in the theory of SAT solving is the notion of symmetry breaking (Crawford et al. 1996). In symmetry breaking, the key idea is to prune the search space by eliminating possible solutions (and non-solutions) which are symmetrical to each other. Symmetries are defined in terms of (logical) variable permutations which when applied to the theory result in an identity mapping. All the assignments belonging to the same symmetry class are first identified and then

Copyright c © 2020, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

Coming from the other direction, there has been a great interest in extending SAT to the class of problems which involve operations like addition, subtraction, comparison etc. over non-Boolean variables (referred to as theory variables ) such as integers, reals, arrays and uninterpreted functions. SAT Modulo Theories (SMT) is a framework for constructing decision problems by combining operations over these non-Boolean theory variables along with SAT style logical connectives (De Moura and Bjørner 2008). For example, consider a formula: ( x + y &gt; 2) ∧ ( y + z &gt; 2) ⇒ ( x + + y z &gt; 6) ∀ x, y, z ∈ Z . This is an SMT formula defined over integer variables and corresponding operations. SMT theories have a wide range of applications in hardware and software verification, extended static checking, constraint solving, planning, scheduling, test case generation, and computer security (de Moura, Dutertre, and Shankar 2007). SMT solvers typically work by first creating a Boolean Skeleton which is obtained by replacing atomic Boolean expressions in the theory by dummy Boolean variables. A solution to the Boolean skeleton is found and checked for consistency with theory variables. If the solution is found to be inconsistent, then negation of that solution is added to the SMT. The process is repeated until a consistent solution is found. A number of advances in SMT solving have been proposed in the recent literature (Barrett et al. 2018).

A natural question then arises: can we exploit existing techniques in SAT symmetry breaking to further improve the efficiency of existing state-of-the-art SMT solvers? Unfortunately, the prior work (D´ eharbe et al. 2011) in this direction is limited to the case where the form of symmetries are assumed to be exchangeable symmetries, i.e., when any two variables in a symmetric set can be interchanged with each other without changing the theory. However there may exist other kinds of symmetries which correspond to arbitrary variable permutations. In this work, we further explore the use of SBPs defined over these arbitrary permutations for SMT solving. For instance, in the example considered above, there is no exchangeable symmetry, but we have a symmetry which cyclically rotates the three variables x, y, z . Our key insight is to simultaneously find symmetries over the Boolean skeleton of the theory such that these symmetries also correspond to valid symmetries of the theory variables underlying the skeleton. One such symmetry would map the expressions ( x + y &gt; 2) to ( y + z &gt; 2) while at the same time map x → y → z → x . We refer to these as Boolean-Skeleton-cum-Theory (BST) symmetries. We formally define SBPs constructed over BST symmetries, and show that they are sound, i.e., adding them to the theory does not change the satisfiability of the original problem. We also design a number of heuristics to select variable ordering during SBP construction to achieve enhanced performance. Our approach can be seen as a wrapper and can be implemented over any given SMT solver.

We implement our symmetry based approach over the state-of-the-art CVC4-2018 (Barrett et al. 2018) and CVC42019 1 solvers. These were the top performers in several categories during 2018 2 and 2019 3 SMTcompetitions. Our algorithm results in competitive performance compared to the state-of-the-art but does not quite win over them. A careful analysis reveals that the original solver and the symmetry based solver perform better on a fairly different set of problems, leading us to design a simple hybrid solver: we run the original solver for a fraction of time, and if we do not reach the solution, we resort to the symmetry based solver. This results in the best performance with our hybrid approach solving close to 3 8% . and 3 1% . more problems on 2018 and 2019 benchmarks in the QF NIA category of the SMT competition.

## Contributions

The main contributions of our work are as follows:

- 1. Our work is the first attempt to exploit a general class of symmetries over the theory variables in SMT problems, as opposed to the earlier approaches which exploit only a subset of symmetries, for example, exchangeable symmetries (D´harbe et al. 2011). e
- 2. We propose the novel idea of exploiting SAT style symmetries over Boolean skeleton variables in tandem with symmetries over the theory variables in SMT problems.
- 3. We propose an ensemble/hybrid solver, which combines the power of existing non-symmetry based solvers, with our symmetry based solver.
- 4. We show that our hybrid solver beats the state-of-the-art solver on several benchmark problems solving close to 3 8% . and 3 1% . more problems in the QF NIA category

1 https://smt-comp.github.io/2019/system-descriptions/cvc4.pdf

2 http://smtcomp.sourceforge.net/2018/results-toc.shtml

3 https://smt-comp.github.io/2019/

of SMT benchmarks from 2018 and 2019 competitions, respectively.

The outline of this paper is as follows. First, we give some background on Symmetry breaking and SMT solving. We then review the existing literature on symmetry breaking, and advances in SMT solving. We then describe our framework for introducing SBPs in SMT including the proof of soundness. We then propose variable ordering heuristics to improve the efficiency of our method. This is followed by our experimental results on various benchmark problems. We conclude with the directions for future work.

## Background

## Symmetry Breaking

Consider a SAT theory T defined over a set of Boolean variables X = { X ,X ,X 1 2 3 · · · X n } . Let θ : X → X denote a permutation over the variables in the set X . Typically, permutations are denoted using the cyclic notation. For example, ( X X 1 2 · · · X k )( X k +1 X k +2 · · · X l ) . . . ( X , X j j +1 , · · · , X n ) denotes that X 1 maps to X 2 , X 2 to X 3 , and so on, until X k which maps to X 1 . This denotes one cycle in the permutation. Similar mapping holds for each cycle, i.e., variables enclosed between round brackets. These mappings should hold simultaneously.

Definition 1 A permutation θ is a symmetry of theory T if application of θ over T results back in T .

For example, consider a SAT theory: a ∨ b, a ∨ c, b ∨ d . Then the permutation θ = ( ab )( cd ) is a symmetry of this theory. It is easy to see that the set Θ of all symmetries of a theory form a group, i.e., they have an identity, each element has an inverse, and they are closed under composition.

Consider an assignment A : X → 2 n . Then the application of permutation θ on A , is defined as θ ( A ( v )) = A ( θ v ( )) , where v ∈ X . Given an assignment x , its orbit is defined as { x ′ |∃ θ, θ ( x ) = x ′ } where θ is a symmetry.

As shown in (Crawford et al. 1996), symmetry detection for SAT problems can be converted to an equivalent graph-isomorphism problem. SAUCY 3.0 (Katebi, Sakallah, and Markov 2012) is a common available tool used for finding the symmetry permutation given a SAT problem.

The goal of symmetry breaking is to introduce constraints such that only one of the assignments in any orbit is allowed to be a solution. Typically, the chosen assignment is the lexicographically smallest assignment in its orbit (under some variable ordering). This is done by adding a predicate of the following form to the theory:

$$\wedge _ { 1 \leq i \leq n } ( \wedge _ { 1 \leq j < i } X _ { j } = \theta ( X _ { j } ) ) \Rightarrow ( X _ { i } \Rightarrow \theta ( X _ { i } ) ) \quad ( 1 )$$

These are known as Symmetry Breaking Predicates (SBPs) (Crawford et al. 1996).

## Satisfiability Modulo Theories (SMT)

SMT problems are extension of SAT problems to allow operations over non-Boolean types such as integers, reals, bitvectors, and arrays etc. An SMT formula is constructed by defining operations over what are referred to as theory variables , and combining them with logical connectives. Each variable takes values from its domain, and operations over the variables include standard operations such as addition and subtraction over integers, and also include comparison, equality and inequality. The last three operations result in Boolean expressions which can be combined using logical connectives. Given an SMT formula Ω it is said to be satisfiable if ∃ an assignment to theory variables which satisfies the formula. For example, the SMT formula in the introduction is satisfiable under the assignment x = 3 , y = 3 , z = 3 .

In the theory of SMT solving, any given formula Ω can be thought of composed of two kinds of constraints (a) Logical constraints (denoted by Ψ ) over atomic Boolean expressions appearing in the formula (b) Consistency constraints (denoted by Φ ) capturing the definition of each atomic Boolean expression. Then, Ω = Ψ ∧ Φ Ψ . is referred to as the Boolean skeleton of the original formula Ω . This way of decomposing the constraints forms the basis of modern day SMT solvers. First, a solution x to the Boolean skeleton is found using a SAT solver, which is then checked for consistency in Φ using a theory solver. If a consistent solution u to the theory variables is found, it is returned and formula is declared SAT. If found inconsistent, a conflict clause C (forcing negation of x ) is added to Ω and process is repeated until a consistent solution is found. When no further repetition can be made, the formula is declared UNSAT. Algorithm 1 provides a high-level understanding of the SMT solving relevant to our technique. Most of the modern day SMT solvers Yices (Dutertre 2014), VeriT (Bouton et al. 2009), CVC4 (Barrett et al. 2011) use the same basic algorithm.

## Algorithm 1: SMT solving algorithm

Input:

SMT Ω

Result: Model M for Ω or UNSAT

1 Ψ ← Boolean-Skeleton ( Ω );

2 Φ ← Constraint-Set( Ω );

3 x ← SAT-Solve ( Ψ );

4

while

Ψ

is SAT

do

5

if

T-consistent(

Φ

, x

)

then

6

u

←

T-Model(

Φ

);

7

return

u

;

8

else

9

C

←

Conflict-Clause(

Φ

, x

);

10

Ψ

←

Ψ

∧

C

;

11

x

←

SAT-Solve (

Ψ

);

12

end

13

end

14 return UNSAT;

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00860v2-figure-7743b489-fc62-45cc-ad14-5b8a1c0ddae6.jpg)

## Related work

There is a vast existing literature on exploiting the symmetries for SAT problems. Building on the original work by Crawford (1996), there have been several attempts for using symmetry breaking to improve the the efficiency of SAT solvers. Torlak &amp; Jackson (Torlak and Jackson 2007)

adopted the approach of first finding the symmetries, and then adding the corresponding symmetry breaking clauses in the theory to reduce the search space. Sakallah (2009) proposed symmetry breaking techniques for propositional logic, which improved the performance of SAT solvers. The symmetries are generally detected by first converting the problem to graph automorphism problem, and then using the efficient graph automorphism detection tools like Saucy (Katebi, Sakallah, and Markov 2012) and Nauty (McKay and Piperno 2014). In the space of Constraint Satisfaction Problems (CSPs), Cohen et. al. (2005) identified two kinds of symmetries that can be exploited: (a) Solution symmetries, preserving the solutions of the problem, (b) Constraint symmeteries, preserving the constraints of the problem. Backofen &amp; Will (1999) proposed symmetry breaking techniques for CSPs. However, there has been limited work in the direction of exploiting symmetries in SMT problems. Deharbe et al. (D´ eharbe et al. 2011) exploit a limited class of symmetries, known as exchangeable symmetries over theory variables, i.e., where all the variables in a symmetric set of completely interchangeable with each other. SyMT (Areces et al. 2013) was developed as a tool to find symmetries over variables in an SMT problem. It is based on reduction of the problem to graph automorphism which is then solved by using existing solvers such as Saucy (Katebi, Sakallah, and Markov 2012). However, to the best of our knowledge, none of the existing techniques have exploited symmetry breaking in the SAT component of the SMT solver. In this paper, we present first such technique, which exploits symmetries breaking in the SAT module of the SMT solvers, resulting in significant gains over the state-of-the-art. There is also some existing work (Chaganty et al. 2013) which exploits symmetries in conjunction with an SMT solver for inference in Markov logic networks (Richardson and Domingos 2006), but they do not directly work on exploiting symmetries within an existing SMT problem, and their technique is limited to use of lifting (Kimmig, Mihalkova, and Getoor 2015), which is different from our usage of SBPs.

## Exploiting Symmetries in SMT

Let us first describe a formulation for constructing SBPs for a given SMT formula Ω .

## Preliminaries

Let the variables in SMT be given by the set { Y , Y 1 2 · · · , Y m } . Note that these variables could come from different types. We assume that given a variable type t , the values come from a domain D t = { v , v 1 2 , · · · v k } . We allow both finite domains as well as countably infinite domains, with the assumption that there is a natural (total) ordering between the values in the domain, e.g., for integer type, this is the natural ordering between integers. For finite valued domains, this could be arbitrarily imposed.

We will also assume that the variable set in the SMT is an ordered set, and without loss of generality, we will assume that there is some pre-defined ordering over types, and all the variables of a certain type t i appear before all the variables of another type t j in the variable ordering if type t i appears before type t j in the type ordering.

## Constructing SBPs: Basics

Next, we construct a colored graph automorphism problem for variables and constraints over them in Ω using the algorithm described in (Areces et al. 2013) (see Background Section). Let θ denote the symmetry. Then, an SBP can be constructed as follows:

$$\wedge _ { 1 \leq i \leq m } ( \wedge _ { 1 \leq j < i } Y _ { j } = \theta ( Y _ { j } ) ) \Rightarrow ( Y _ { i } \Rightarrow \theta ( Y _ { i } ) ) \ \ ( 2 ) \quad \text{                                                                                                                                                                                                        
                                                                                                                                                                                                        }                                                                                                                                                                                                       .$$

This is identical to the SBP described in the Background section with the difference that now we are dealing with non-Boolean variables. In the above equation, we say that Y i ⇒ Y k iff the value v i taken by the variable Y i and the value v k taken by the variable Y k (they should have identical domains) are such that v i ≤ v k . This ordering is well defined due to the assumption about ordering among the domain values of any given type. Correctness follows from the correctness of SBPs in the Boolean case.

Theorem 1 Let Ω be an SMT theory. Let θ be a symmetry over it. Consider the theory Ω = Ω ′ ∧ SBP θ ( ) . Ω is satisfiable iff Ω ′ is satisfiable.

The proof follows from the proof of correctness of SBPs in the logical case; since there is nothing in the proof which assumes operations over logical variables only.

## Exploiting Boolean Skeleton Variables

Intuition: Before we go to formal description of our approach for adding SBPs in an SMT formulation, let us get some intuition. Existing literature on SBPs already tells us howto exploit symmetries over purely logical formulas. Further, the tool SyMT extends the symmetries over Boolean formulas to the variables in an SMT formula (see section on related work). Then, one straight forward approach would be to define the SBP over symmetries discovered over these SMT formulas as described above. A similar approach has been taken by existing work (D´ eharbe et al. 2011), though they focus only on exchangeable variable symmetries (i.e., when all the variables in a symmetric set can be freely exchanged with each other). In addition to working only with a restricted symmetry class, this approach has another limitation: it has no way of exploiting symmetries over the Boolean skeleton variables. Since in any given SMT solver, a significant chunk of computation is taken by the SAT solver over the Boolean skeleton, the symmetries discovered in (D´ eharbe et al. 2011) does not help in any improvement over this component.

We take a slightly different approach to exploit symmetry breaking in SMT. Instead of discovering symmetries only for theory variables, we instead construct a graph automorphism problem to simultaneously discover symmetries over the Boolean skeleton variables as well as the theory variables. Since these symmetries are discovered jointly, this means that any such symmetric permutation can be applied to get a new configuration of the Boolean skeleton variables as well as the theory variables. Then, we exploit the symmetry over the Boolean skeleton variables to construct an SBP

over the corresponding logical formula. These symmetries can then be incorporated in the SAT component of the SMT solver. Next, we describe our approach in detail.

Algorithm: Consider an SMT theory Ω . Let Ω be decomposed as Ω = Ψ ∧ Φ , where Ψ and Φ denote the Boolean skeleton and theory constraints, respectively. Then, clearly, checking satisfiability over the original theory Ω is equivalent to checking satisfiability over the RHS above. Since we would like to work with SBPs formed over Boolean skeleton variables, we define the notion of a restricted SBP as follows:

Definition 2 Restricted SBPs: Let t be a variable type in an SMT formula. Let θ be a symmetry of SMT. We construct the restricted SBP for type t variables as follows: we order the types such that t appears first in the ordering. Correspondingly, the variables for type t appear first in the variable ordering. Let these variables be given by { Y , Y 1 2 , · · · , Y r } . Then, the restricted SBP is defined as:

$$\wedge _ { 1 \leq i \leq r } ( \wedge _ { 1 \leq j < i } Y _ { j } = \theta ( Y _ { j } ) ) \Rightarrow Y _ { i } \Rightarrow \theta ( Y _ { i } ) \quad ( 3 )$$

The only difference from the standard SBP formulation (Equation 2) is that now the ordering constraints over only variables from the type t are considered. Clearly, adding restricted SBPs to a theory still preserves satisfiability. Given this definition, we construct an SBP using the following steps:

- 1. Construct a colored graph automormphism problem corresponding to the SMT problem expressed by Ψ ∧ Φ . Let Θ denote the set of symmetries discovered by colored graph automorphism. Initially, we assign Ψ ′ ← Ψ .
- 2. For every symmetry θ ∈ Θ , construct the restricted SBP corresponding to Boolean skeleton variables. Add this SBP to the SMT theory: Ψ ′ ∧ SBP-form( θ ) ∧ Φ . Note we add the newly constructd SBP specifically to the Boolean skeleton part since these SBPs are defined only over the variables in the Boolean skeleton by construction.
- 3. Let the final SMT theory after adding SBPs be given as Ψ ′ ∧ Φ . Then, we now apply our SMT solver over the this newly developed theory. Note that SBPs have been added over the Boolean skeleton variables which will be exploited during the SAT computation phase of SMT. Consistency constraints have remained unchanged.

Algorithm 2 gives the pseudocode for the entire SMT solving using our SBP based approach.

Theorem 1 The SMT problem represented by (Ψ ′ ∧ Φ) and (Ψ ∧ Φ) are equi-satisfiable i.e., if one is satisfiable then other is also satisfiable, and vice-versa. Here, the notations are as used in Algorithm 2.

We note that it is a design choice to enforce SBPs only over the Boolean skeleton variables. We primarily motivated by the fact that most of the search (DPLL style) happens here, and therefore, adding SBPs to this phase is quite important in pruning the search space. This is also demonstrated by the gain obtained in our experimental results. We can of course, extend our SBPs to also be constructed over remaining theory variables, experimenting with them is a direction for future work.

Algorithm 2: SMT solving algorithm + Symmetry Breaking Technique

Input: SMT Ω

Result: Model M for Ω or UNSAT

- 1 Ψ ← Boolean-Skeleton ( Ω );
- 2 Φ ← Constraint-Set( Ω );
- 3 θ , θ 1 2 · · · θ n ← Symmetry-Permutations( Ψ ∧ Φ );
- 4 Ψ ′ ← Ψ ;
- 5 for i ← 0 to n do
- 6 Ψ ′ ← Ψ ′ ∧ SBP-Form( θ i ) ;

7

end

- 8 x ← SAT-Solve ( Ψ );
- 9 while Ψ ′ is SAT do

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00860v2-figure-a6515763-061f-4051-9850-e510bcf8f84c.jpg)

Example: Table 1 provides an example with a problem with linear integer theory. The SBP ( T ) in this example is Q ⇒ R , under the variable ordering P, Q, R, S, T . The second assignment is selected over the first one (with first one being pruned after SBP addition) and hence the solver do not have to explore both of them.

In order to maximize the impact of SBPs formed and reduce overheads we introduce various heuristics explained in the subsections below.

## Variable Ordering Heuristic

The symmetry breaking technique is invariant of any arbitrary variable ordering chosen. Also, once the ordering is chosen, it must remain consistent for all the symmetries detected. However, to maximize the effect of the process, we tried different heuristics on the variable ordering. The key idea here is to make the new clause added to play a significant role in deciding the truth assignment for the Boolean skeleton. We choose the variables appearing as positive unit variables in the clausal normal form of the Boolean skeleton to appear first in the variable ordering. The main intuition behind such a choice lies the fact that most SAT solvers first assign true values to these unit variables for unit propagation, and hence for the Symmetry Breaking Predicate of the form Y i ⇒ θ Y ( i ) , the value of θ Y ( i ) gets automatically decided. The SAT solver will now directly assign True value to the θ Y ( i ) and hence pruning the branch where it could have been assigned a False . This simple heuristic boosts the performance of the technique discussed here.

## Reduced Size Heuristic

The step mentioned in line 6 of the Algorithm 2 involve forming SBP from the found symmetry permutation. Although we mention the general form of SBP added in the theory section, but we are free to choose any subset of that SBP without breaking the soundness. As suggested by (Aloul, Markov, and Sakallah 2003) in the Symmetry Breaking for SAT solving, breaking all symmetries may not speed up the search because there are often exponentially many of them and may be redundant. We restrict to single symmetry generators given by graph-automorphism solver of (Areces et al. 2013). Further, it was seen that smaller generator cycles seems to be more effective. Therefore, we restrict the size of permutations larger than k bits to k, where k is a hyperparameter.

## Hybrid Technique

In our experiments, we found that there are a lot of nonoverlapping problems solved by algorithm 1 and Algorithm 2 in the SMT benchmarks. Particularly, for the 2018 QF NIA benchmarks, we saw that algorithm 2 is able to solve large number of benchmarks that algorithm 1 was not able to solve. However, there was another equally large chunk of problems in which algorithm 1 beat algorithm 2. Hence, the overall gain in the number of benchmarks solved was quite low. This means that for several problems adding SBPs resulted in significant speed-ups, whereas in other cases, it slowed down the original solver. We hypothesize this is because in the former case, unnecessary parts of the search space are pruned resulting in speed-up, whereas in the latter case, the SBPs might be pruning valid models, resulting in further delay in reaching a satisfying assignment.

Taking insight from this, we design a hybrid solver, where we first run the solver with SBPs added for a fixed time t , and if the solution is still not found, we resort to the original solver with SBPs removed. t is a hyperparameter. This results in significant boost in performance compared to CVC4 on a subset of SMT benchmarks.

## Experiments

## Goal

Our experiments are designed to help us answer two important questions about our algorithm. The first one is whether our algorithm, when implemented on top of an existing SMT solver, is able to improve its performance. And the second one is to check whether our solver can push the state-of-theart in solving benchmark SMT problems. Both of these goals are essential to show that our algorithm is effective as well as independent of the solver.

## Benchmarks

We use both 2018 4 and 2019 5 version of the benchmarks of the SMT-COMP. These benchmarks are categorized based on the underlying theory. We use the category QF NIA particularly because the theory is relatively complex and as per

4 http://smtcomp.sourceforge.net/2018/benchmarks.shtml

5 https://smt-comp.github.io/2019/benchmarks.html

## Table 1: Symmetry Breaking Technique

SMT Problem Ω

(( z &gt; 2) ∨ ( x &lt; 8)) ∧ (( z &gt; 2) ∨ ( y &lt; 8)) ∧ (( x + y &lt; 10) ∨ ( x + y &gt; ( P ∨ Q ) ∧ ( P ∨ R ) ∧ ( S ∨ T )

3))

Boolean Skeleton Ψ

Constraints Set Φ

( P ⇔ ( z &gt; 2)) ∧ ( Q ⇔ ( x &lt; 8)) ∧ ( R ⇔ ( y &lt; 8)) ∧ ( S ⇔ ( x + y &lt; 10)) ∧ ( T ⇔ ( x + y &gt; 3))

Satisfying Assignment

z = 3; x = 7; y = 9; P = True Q ; = True R ; = False S ; = False T ; = True

Symmetry Permut. θ

θ Q ( ) = R θ R ; ( ) = Q θ x ; ( ) = y θ y ; ( ) = x

Satisfying Assignment

z = 3; x = 9; y = 7; P = True Q ; = False R ; = True S ; = False T ; = True

(after applying θ )

SBP added

Q ⇒ R

New Skeleton Ψ ′

( P ∨ Q ) ∧ ( P ∨ R ) ∧ ( S ∨ T ) ∧ ¬ ( Q ∨ R )

Assignment chosen

z = 3; x = 9; y = 7; P = True Q ; = False R ; = True S ; = False T ; = True

(lexicographically smaller one)

our hypothesis, shows some promising results. These benchmarks have a mix of SAT and UNSAT problems.

## Solvers

| Solver Name      |   #Problems |
|------------------|-------------|
| CVC4-18          |       15662 |
| CVC4-SymBreak-18 |       16567 |
| Total Bechmarks  |       23876 |

We implemented all the symmetry breaking techniques, hybrid technique and heuristics discussed in this paper to build our solver CVC4-SymBreak. CVC4-SymBreak-18 and CVC4-SymBreak-19are two versions of our solver built on CVC4-18 (Barrett et al. 2018) and CVC4-19 6 respectively. We participated as a non-competing entry in SMTCOMP- 2019 (Barth et al. 2019) with our solver CVC4SymBreak-18. SMT-COMP is an annual competition of all the SMT solvers on a set of SMT problems called benchmarks which are updated every year. Although, the technique is invariant of the underlying solver, but we choose CVC4-18 (Barrett et al. 2018) here as it was winner in many categories in the SMT-COMP-2018 and is publicly available. For detecting the symmetries of the problem, we use the tool SyMT (Areces et al. 2013) and then added the corresponding predicates(SBPs) formed in the Boolean skeleton of the problem generated by CVC4. We compare our performance particularly with CVC4 to achieve our first goal. Also, participation in the competition helps us to know our position vs the sate-of-the-art.

## Methodology

We ran CVC4-18, CVC4-19 and our solvers on various benchmarks in different categories and sub-categories. All the experiments were conducted in the same setting as used by the SMT-COMP for the competition. Some of them are direct results from the SMT-COMP-19 while others were run separately. The wall-clock timeout was 1200 seconds and 2400 seconds for each individual problem in 2018 and 2019 benchmarks respectively. The memory was limited to 60 GB in both the experiments. All the experiments were run on the starexec cluster (Stump, Sutcliffe, and Tinelli 2014) with Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz and CentOS Linux release 7.4.1708.

## Results

The results are tabulated in tables 2 and 3 for 2018 and 2019 versions of benchmarks and solvers respectively. The aim

6 https://smt-comp.github.io/2019/system-descriptions/cvc4.pdf

Table 2: Number of solved problems on 2018 benchmarks

| Solver Name      | #Problems   | #Problems   | #Problems   |
|------------------|-------------|-------------|-------------|
|                  | SAT         | UNSAT       | ALL         |
| CVC4-18          | 5101        | 2286        | 7387        |
| CVC4-SymBreak-18 | 5542        | 2394        | 7936        |
| CVC4-19          | 5785        | 2504        | 8289        |
| CVC4-SymBreak-19 | 6093        | 2554        | 8647        |
| Total Benchmarks |             |             | 11494       |

Table 3: Number of solved problems on 2019 benchmarks

of the solver is to solve a problem in a given time constraint (the wall-clock timeout). As mentioned in the previous subsection, the time limits for each benchmark were set as per the rules of SMT-COMP. Therefore, metric used to evaluate performance of a solver is the number of benchmarks solved. Our solver with symmetry breaking was able to solve 905 ( 3 8% . of the total benchmarks) more problems than its counterpart in SAT-COMP-2018. Similarly, on SMT-COMP-2019 benchmarks, our solver was able to solve 549 and 358 ( 4 8% . and 3 1% . of the total benchmarks) more problems than its counterparts. Hence we see that we are able to answer positively to both the questions which we talked above. This shows that our technique is versatile and can build on improved performance of the underlying solvers. In other words, we believe that ideas proposed here are fundamental in nature, and have the capacity to benefit even new solvers that might be proposed in future. Further, both CVC4-2018 and CVC4-2019 are the state-of-the-art for the benchmarks of their respective year. Although, the winner of the latest SMT-COMP, solver Par4 7 is able to solve more problems than us in this category but it achieves so by using different solvers in parallel for solving the problem. In the sequential setting, our results are the new state-of-theart.

7 https://smt-comp.github.io/2019/participants/par4

## Conclusion

In this paper, we have presented an approach for incorporating symmetry breaking predicates (SBPs) in SMT problems. Our approach is based on jointly exploiting the symmetries over the Boolean skeleton as well as the theory consistency formulas in the SMT formulation. Our novelty lies in introducing the symmetry breaking predicates for Boolean skeleton variables of SMT, thus improving the SAT module of SMT solvers, which typically is a bottleneck. We prove that our SBP formulation is sound. Our experiments against the state of the art solvers show significant gains on the benchmarks from SMT Competitions of 2018 and 2019. Directions for future work include experimenting with additional benchmarks, and trying our approach with other solvers.

## Acknowledgements

We are thankful to Kuldeep Meel and Supratik Chakraborty for helpful discussions and inputs on the work. Happy Mittal was supported by the TCS Research Scholar Program. Parag Singla is supported by the DARPA Explainable Artificial Intelligence (XAI) Program #N66001-17-2-4032, IBM SUR award, and Visvesvaraya Young Faculty Fellowships by Govt. of India. Any opinions, findings, conclusions or recommendations expressed in this paper are those of the authors and do not necessarily reflect the views or official policies, either expressed or implied, of the funding agencies.

## References

[Aloul, Markov, and Sakallah 2003] Aloul, F. A.; Markov, I. L.; and Sakallah, K. A. 2003. Shatter: efficient symmetrybreaking for boolean satisfiability. In Proceedings of the 40th Design Automation Conference, DAC 2003, Anaheim, CA, USA, June 2-6, 2003 , 836-839.

[Aloul, Sakallah, and Markov 2006] Aloul, F. A.; Sakallah, K. A.; and Markov, I. L. 2006. Efficient symmetry breaking for boolean satisfiability. IEEE Trans. Computers 55(5):549-558.

[Areces et al. 2013] Areces, C.; D´ eharbe, D.; Fontaine, P.; and Orbe, E. 2013. Symt: finding symmetries in smt formulas. In SMT Workshop 2013 11th International Workshop on Satisfiability Modulo Theories .

[Backofen and Will 1999] Backofen, R., and Will, S. 1999. Excluding symmetries in constraint-based search. In International Conference on Principles and Practice of Constraint Programming , 73-87. Springer.

[Barrett et al. 2011] Barrett, C.; Conway, C. L.; Deters, M.; Hadarean, L.; Jovanovi´ c, D.; King, T.; Reynolds, A.; and Tinelli, C. 2011. Cvc4. In International Conference on Computer Aided Verification , 171-177. Springer.

[Barrett et al. 2018] Barrett, C.; Barbosa, H.; Brain, M.; Ibeling, D.; King, T.; Meng, P.; Niemetz, A.; N¨tzli, A.; Preiner, o M.; Reynolds, A.; et al. 2018. Cvc4 at the smt competition 2018. arXiv preprint arXiv:1806.08775 .

[Barth et al. 2019] Barth, M.; Dietsch, D.; Fichtner, L.; and Heizmann, M. 2019. Smt-comp 2019.

[Bouton et al. 2009] Bouton, T.; de Oliveira, D. C. B.; D´ eharbe, D.; and Fontaine, P. 2009. verit: an open, trustable and efficient smt-solver. In International Conference on Automated Deduction , 151-156. Springer.

- [Chaganty et al. 2013] Chaganty, A.; Lal, A.; Nori, A. V.; and Rajamani, S. K. 2013. Combining relational learning with smt solvers using cegar. In International Conference on Computer Aided Verification , 447-462. Springer.
- [Cohen et al. 2005] Cohen, D.; Jeavons, P.; Jefferson, C.; Petrie, K. E.; and Smith, B. M. 2005. Symmetry definitions for constraint satisfaction problems. In International Conference on Principles and Practice of Constraint Programming , 17-31. Springer.
- [Crawford et al. 1996] Crawford, J.; Ginsberg, M.; Luks, E.; and Roy, A. 1996. Symmetry-breaking predicates for search problems. KR 96:148-159.
- [De Moura and Bjørner 2008] De Moura, L., and Bjørner, N. 2008. Z3: An efficient smt solver. In International conference on Tools and Algorithms for the Construction and Analysis of Systems , 337-340. Springer.
- [de Moura, Dutertre, and Shankar 2007] de Moura, L.; Dutertre, B.; and Shankar, N. 2007. A tutorial on satisfiability modulo theories. In International Conference on Computer Aided Verification , 20-36. Springer.
- [D´ eharbe et al. 2011] D´ eharbe, D.; Fontaine, P.; Merz, S.; and Paleo, B. W. 2011. Exploiting symmetry in smt problems. In International Conference on Automated Deduction , 222-236. Springer.

[Devriendt and Bogaerts 2015] Devriendt, J., and Bogaerts, B. 2015. Breakid, a symmetry breaking preprocessor for sat solvers. bitbucket. org/krr/breakid .

[Dutertre 2014] Dutertre, B. 2014. Yices 2.2. 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 , 737744.

[Katebi, Sakallah, and Markov 2012] Katebi, H.; Sakallah, K. A.; and Markov, I. L. 2012. Conflict anticipation in the search for graph automorphisms. In Logic for Programming, Artificial Intelligence, and Reasoning - 18th International Conference, LPAR-18, Merida, Venezuela, March 1115, 2012. Proceedings , 243-257.

- [Kimmig, Mihalkova, and Getoor 2015] Kimmig, A.; Mihalkova, L.; and Getoor, L. 2015. Lifted graphical models: a survey. Machine Learning 99(1):1-45.
- [McKay and Piperno 2014] McKay, B. D., and Piperno, A. 2014. Practical graph isomorphism, II. J. Symb. Comput. 60:94-112.
- [Richardson and Domingos 2006] Richardson, M., and Domingos, P. 2006. Markov logic networks. Machine learning 62(1-2):107-136.
- [Sakallah 2009] Sakallah, K. A. 2009. Symmetry and satisfiability. In Handbook of Satisfiability . 289-338.

[Stump, Sutcliffe, and Tinelli 2014] Stump, A.; Sutcliffe, G.; and Tinelli, C. 2014. Starexec: a cross-community infras- tructure for logic solving. In International joint conference on automated reasoning , 367-373. Springer.

[Torlak and Jackson 2007] Torlak, E., and Jackson, D. 2007. Kodkod: A relational model finder. In Tools and Algorithms for the Construction and Analysis of Systems, 13th International Conference, TACAS 2007, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2007 Braga, Portugal, March 24 - April 1, 2007, Proceedings , 632-647.
Saket Dingliwal Ronak Agarwal Happy Mittal Parag Singla
Advances in Symmetry Breaking for SAT Modulo Theories
Symmetry breaking is a popular technique to reduce the search space for SAT
solving by exploiting the underlying symmetry over variables and clauses in a
formula. The key idea is to first identify sets of assignments which fall in
the same symmetry class, and then impose ordering constraints, called Symmetry
Breaking Predicates (SBPs), such that only one (or a small subset) of these
assignments is allowed to be a solution of the original SAT formula. While this
technique has been exploited extensively in the SAT literature, there is little
work on using symmetry breaking for SAT Modulo Theories (SMT). In SMT, logical
constraints in SAT theories are combined with another set of theory operations
defined over non-Boolean variables such as integers, reals, etc. SMT solvers
typically use a combination of SAT solving techniques augmented with calls to
the theory solver. In this work, we take up the advances in SAT symmetry
breaking and apply them to the domain of SMT. Our key technical contribution is
the formulation of symmetry breaking over the Boolean skeleton variables, which
are placeholders for actual theory operations in SMT solving. These SBPs are
then applied over the SAT solving part of the SMT solver. We implement our SBP
ideas on top of CVC4, which is a state-of-the-art SMT solver. Our approach can
result in significantly faster solutions on several benchmark problems compared
to the state-of-the-art. Our final solver is a hybrid of the original CVC4
solver, and an SBP based solver, and can solve up to 3.8% and 3.1% more
problems in the QF_NIA category of 2018 and 2019 SMT benchmarks, respectively,
compared to CVC4, the top performer in this category.