12.07.2015 Views

Efficient Conflict Driven Learning in a Boolean Satisfiability Solver

Efficient Conflict Driven Learning in a Boolean Satisfiability Solver

Efficient Conflict Driven Learning in a Boolean Satisfiability Solver

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Efficient</strong> <strong>Conflict</strong> <strong>Driven</strong> <strong>Learn<strong>in</strong>g</strong> <strong>in</strong> a<strong>Boolean</strong> <strong>Satisfiability</strong> <strong>Solver</strong>L<strong>in</strong>tao ZhangDept. of Electrical Eng<strong>in</strong>eer<strong>in</strong>gPr<strong>in</strong>ceton Universityl<strong>in</strong>taoz@ee.pr<strong>in</strong>ceton.eduConor F. MadiganDepartment of EECSMITcmadigan@mit.eduMatthew H. MoskewiczDepartment of EECSUC Berkeleymoskewcz@alumni.pr<strong>in</strong>ceton.eduSharad MalikDept. of Electrical Eng<strong>in</strong>eer<strong>in</strong>gPr<strong>in</strong>ceton Universitymalik@pr<strong>in</strong>ceton.eduABSTRACTOne of the most important features of current state-of-the-artSAT solvers is the use of conflict based backtrack<strong>in</strong>g andlearn<strong>in</strong>g techniques. In this paper, we generalize variousconflict driven learn<strong>in</strong>g strategies <strong>in</strong> terms of differentpartition<strong>in</strong>g schemes of the implication graph. We re-exam<strong>in</strong>ethe learn<strong>in</strong>g techniques used <strong>in</strong> various SAT solvers andpropose an array of new learn<strong>in</strong>g schemes. Extensiveexperiments with real world examples show that the bestperform<strong>in</strong>g new learn<strong>in</strong>g scheme has at least a 2X speedupcompared with learn<strong>in</strong>g schemes employed <strong>in</strong> state-of-the-artSAT solvers.1. INTRODUCTIONThe <strong>Boolean</strong> <strong>Satisfiability</strong> problem (SAT) is one of the moststudied NP-Complete problems because of its significance <strong>in</strong>both theoretical research and practical applications. Given a<strong>Boolean</strong> formula, the SAT problem asks for an assignment ofvariables so that the formula evaluates to true, or adeterm<strong>in</strong>ation that no such assignment exists. Various EDAapplications rang<strong>in</strong>g from formal verification [2][3] to ATPG[1] use efficient SAT solvers as the basis for reason<strong>in</strong>g andsearch<strong>in</strong>g. Many dedicated solvers (e.g. GRASP [6], POSIT[5], SATO [8], rel_sat [7], Walksat [4], Chaff [9]) based onvarious algorithms (e.g. Davis Putnam [10], local search [4],Stälmark’s algorithm [11]) have been proposed to solve theSAT problem efficiently for practical problem <strong>in</strong>stances.Most often, the <strong>Boolean</strong> formulae of SAT problems areexpressed <strong>in</strong> Conjunctive Normal Form (CNF). A CNFformula is a logical and of one or more clauses, where eachclause is a logical or of one or more literals. A literal is eitherthe positive or the negative form of a variable. To satisfy aCNF <strong>Boolean</strong> formula, each clause must be satisfied<strong>in</strong>dividually. For a certa<strong>in</strong> clause, if all but one of its literalshas been assigned the value 0, then the rema<strong>in</strong><strong>in</strong>g literal,referred to as a unit literal, must be assigned the value 1 <strong>in</strong>order to satisfy this clause. Such clauses are called unitclauses. The process of assign<strong>in</strong>g the value 1 to all unit literalsis called unit propagation. In the follow<strong>in</strong>g, we will alwaysassume that the discussed formulae are <strong>in</strong> CNF format.S<strong>in</strong>ce SAT is known to be NP-Complete, it is unlikely thatthere exists any SAT algorithm with polynomial timecomplexity. However, SAT problem <strong>in</strong>stances generated fromreal world applications seem to have some structure thatenables efficient solution. A large class of these <strong>in</strong>stances canactually be solved <strong>in</strong> reasonable compute time. Due to recentadvances <strong>in</strong> search prun<strong>in</strong>g techniques, several very efficientSAT algorithms for structured problems have been developed(i.e. GRASP [6], rel_sat [7], SATO [8], Chaff [9]). Suchsolvers can solve many <strong>in</strong>stances with tens of thousands ofvariables, which cannot be handled by other <strong>Boolean</strong>reason<strong>in</strong>g methods [2].Most of the more successful complete SAT solvers are basedon the branch and backtrack<strong>in</strong>g algorithm called the DavisPutnam Logemann Loveland (DPLL) algorithm [10]. Inaddition to DPLL, the algorithms mentioned earlier utilize aprun<strong>in</strong>g technique called learn<strong>in</strong>g. <strong>Learn<strong>in</strong>g</strong> extracts andmemorizes <strong>in</strong>formation from the previously searched space toprune the search <strong>in</strong> the future. <strong>Learn<strong>in</strong>g</strong> is achieved by add<strong>in</strong>gclauses to the exist<strong>in</strong>g clause database. S<strong>in</strong>ce learn<strong>in</strong>g plays avery important role <strong>in</strong> prun<strong>in</strong>g the search space for structuredSAT problems, it is very important to make it as efficient andeffective as possible. In this paper, we will exam<strong>in</strong>e thelearn<strong>in</strong>g schemes <strong>in</strong> more detail. Our specific focus is onlearn<strong>in</strong>g that occurs as a consequence of conflicts createddur<strong>in</strong>g the generation of implications. This is referred to asconflict driven learn<strong>in</strong>g. For the rest of the paper, we will usethe term learn<strong>in</strong>g <strong>in</strong> only this context, without necessarilyprefac<strong>in</strong>g it each time with the “conflict driven” adjective.1.1 DPLL with <strong>Learn<strong>in</strong>g</strong>The basic DPLL algorithm is the basis for most of the exist<strong>in</strong>gcomplete SAT solvers. In [6] and [7], the authors augmentedthe DPLL algorithm with learn<strong>in</strong>g and non-chronologicalbacktrack<strong>in</strong>g schemes to facilitate the prun<strong>in</strong>g of the searchspace. The pseudo-code of the DPLL algorithm with learn<strong>in</strong>gis illustrated <strong>in</strong> Figure 1.Function decide_next_branch()chooses the branch<strong>in</strong>gvariable based on various heuristics. Each decision has adecision level associated with it. The function deduce()propagates the effect of the decision variable be<strong>in</strong>g assigned.


After mak<strong>in</strong>g a decision, some clauses may become unitclauses. All the unit literals are assigned 1 and the assignmentis propagated until no unit clause exists. All variables assignedas a consequence of implications of a certa<strong>in</strong> decision willhave the same decision level as the decision variable. If aconflict is encountered (i.e. a clause, called conflict<strong>in</strong>g clause,has all its literals assigned value 0), then theanalyze_conflicts() function is called to analyze thereason for the conflict and to resolve it. It also ga<strong>in</strong>s someknowledge from the current conflict, and returns abacktrack<strong>in</strong>g level so as to resolve this conflict. The returnedbacktrack<strong>in</strong>g level <strong>in</strong>dicates the wrong branch decision madepreviously and back_track() will undo the bad branches<strong>in</strong> order to resolve the conflict. A zero backtrack<strong>in</strong>g levelmeans that a conflict exists even without any branch<strong>in</strong>g. This<strong>in</strong>dicates that the problem is unsatisfiable. Readers arereferred to [6] for a more detailed discussion of the DPLLalgorithm.There are a large number of different SAT solvers that differma<strong>in</strong>ly <strong>in</strong> how each of these functions is implemented us<strong>in</strong>gdifferent heuristics. A lot of effort has been spent on decisionmak<strong>in</strong>g(e.g. [13][14][9]), and significant progress has beenmade on how efficient deduction (e.g. [9][15][8]). However,to our knowledge, only [7] and [6] (and its variations) havediscussed implementation of conflict driven learn<strong>in</strong>g. Theauthors are not aware of any evaluation of different conflictdriven learn<strong>in</strong>g schemes and their <strong>in</strong>fluence on theperformance of SAT solvers.while(1) {if (decide_next_branch()) { //Branch<strong>in</strong>gwhile(deduce()==conflict) { //Deduc<strong>in</strong>gblevel = analyze_conflicts(); //<strong>Learn<strong>in</strong>g</strong>if (blevel == 0)return UNSATISFIABLE;else back_track(blevel); //Backtrack<strong>in</strong>g}}else //no branch means all variables got assigned.return SATISFIABLE;}Figure 1. DPLL with <strong>Learn<strong>in</strong>g</strong>1.2 Implication GraphThe implication relationships of variable assignments dur<strong>in</strong>gthe SAT solv<strong>in</strong>g process can be expressed as an implicationgraph. A typical implication graph is illustrated <strong>in</strong> Figure 2.An implication graph is a directed acyclic graph (DAG). Eachvertex represents a variable assignment. A positive variablemeans it is assigned 1; a negative variable means it is assigned0. The <strong>in</strong>cident edges of each vertex are the reasons that leadto the assignment. We will call the vertices that have directededges to a certa<strong>in</strong> vertex as its antecedent vertices. A decisionvertex has no <strong>in</strong>cident edge. Each variable has a decision levelassociated with it, denoted <strong>in</strong> the graph as a number with<strong>in</strong>parenthesis. In an implication graph with no conflict there is atmost one vertex for each variable. A conflict occurs whenthere is vertex for both the 0 and the 1 assignment of avariable. Such a variable is referred to as the conflict<strong>in</strong>gvariable. In Figure 2, the variable V 18 is the conflict<strong>in</strong>gvariable. In future discussion, when referr<strong>in</strong>g to an implicationgraph, we will only consider the connected component that hasthe conflict<strong>in</strong>g variable <strong>in</strong> it. The rest of the implication graphis not relevant for the conflict analysis.DecisionVariable-V 6 (1)V 11 (5)-V 13 (2)-V 12 (5)-V 2 (5)V 16 (5)V 4 (3)<strong>Conflict</strong><strong>in</strong>g Clause: (V 3 ’+V 19 ’+V 18 ’)-V 10 (5)UIPV 19 (3)V 8 (2)V 1 (5)V 3 (5)-V 5 (5)Figure 2. A typical implication graph-V 17 (1)V 18 (5)<strong>Conflict</strong><strong>in</strong>gVariable-V 18 (5)In an implication graph, vertex a is said to dom<strong>in</strong>ate vertex biff any path from the decision variable of the decision level ofa to b needs to go through a. A Unique Implication Po<strong>in</strong>t(UIP) [6] is a vertex at the current decision level thatdom<strong>in</strong>ates both vertices correspond<strong>in</strong>g to the conflict<strong>in</strong>gvariable. For example, <strong>in</strong> Figure 2, <strong>in</strong> the sub-graph of currentdecision level 5, V 10 dom<strong>in</strong>ates both vertices V 18 and -V 18 ,therefore, it is a UIP. The decision variable is always a UIP.Note that there may be more than one UIP for a certa<strong>in</strong>conflict. In the example, there are three UIPs, namely, V 11 , V 2and V 10 . Intuitively, a UIP is the s<strong>in</strong>gle reason that implies theconflict at current decision level. We will order the UIPsstart<strong>in</strong>g from the conflict. In the previous example, V 10 is thefirst UIP.In actual implementations, the implication graph is ma<strong>in</strong>ta<strong>in</strong>edby associat<strong>in</strong>g each assigned non-decision (i.e. implied)variable with a po<strong>in</strong>ter to its antecedent clause. Theantecedent clause of a non-decision variable is the clause thatwas unit at the time when the implication happened, andforced the variable to assume a certa<strong>in</strong> value. By follow<strong>in</strong>g theantecedent po<strong>in</strong>ters, the implication graph can be constructedwhen needed.1.3 <strong>Conflict</strong> Analysis and <strong>Learn<strong>in</strong>g</strong><strong>Conflict</strong> analysis is the procedure that f<strong>in</strong>ds the reason for aconflict and tries to resolve it. It tells the SAT solver that thereexists no solution for the problem <strong>in</strong> a certa<strong>in</strong> search space,and <strong>in</strong>dicates a new search space to cont<strong>in</strong>ue the search.


The orig<strong>in</strong>al DPLL algorithm proposed the simplest conflictanalysis method. For each decision variable, the solver keeps aflag <strong>in</strong>dicat<strong>in</strong>g whether it has been tried <strong>in</strong> both phases or not.When a conflict occurs, the conflict analysis procedure looksfor the decision variable with the highest decision level thathas not been flipped, marks it flipped, undoes all theassignments between that decision level and current decisionlevel, and then tries the other phase for the decision variable.This naïve conflict analysis method actually works well forrandomly generated problems, possibly because randomproblems do not have structure, and learn<strong>in</strong>g from a certa<strong>in</strong>part of the search space will generally not help searches <strong>in</strong>other parts.More advanced conflict analysis relies on the implicationgraph to determ<strong>in</strong>e the actual reasons for the conflict. Thisk<strong>in</strong>d of conflict directed backjump<strong>in</strong>g [7] could back up morethan one level of the decision stack. Thus, it is also called nonchronologicalbacktrack<strong>in</strong>g. At the same time, the conflictanalysis eng<strong>in</strong>e will also add some clauses to the database.This process is called learn<strong>in</strong>g. Such learned clauses arecalled conflict clauses as opposed to conflict<strong>in</strong>g clauses,which refer to clauses that cause the conflict. The conflictclauses record the reasons deduced from the conflict to avoidmak<strong>in</strong>g the same mistake <strong>in</strong> the future search. These clausesstate that certa<strong>in</strong> comb<strong>in</strong>ations of variable assignments are notvalid because they will force the conflict<strong>in</strong>g variable to assumeboth the value 0 and 1, thus lead<strong>in</strong>g to a conflict.-V 6 (1)V 11 (5)ReasonSide-V 13 (2)-V 12 (5)-V 2 (5)V 16 (5)Cut 3: cut does not<strong>in</strong>volve conflictV 4 (3)-V 10 (5)V 8 (2)V 1 (5)V 3 (5)-V 5 (5)-V 17 (1)V 18 (5)<strong>Conflict</strong>Side-V 18 (5)Cut 2 Cut 1V 19 (3)Figure 3. Cuts <strong>in</strong> the implication graph can be added as clausesA conflict clause is generated by a bipartition of theimplication graph. The partition has all the decision variableson one side (called reason side), and the conflict<strong>in</strong>g variable<strong>in</strong> the other side (the conflict side). All the vertices on thereason side that have at least one edge to the conflict sidecomprise the reason for the conflict. We will call such abipartition a cut. Different cuts correspond to differentlearn<strong>in</strong>g schemes. For example, <strong>in</strong> Figure 3, clause (V 1 ’+ V 3 ’+ V 5 + V 17 + V 19 ’) can be added as a conflict clause, whichcorresponds to cut 1. Similarly, cut 2 corresponds to clause(V 2 + V 4 ’ + V 8 ’ + V 17 + V 19 ’).We will generalize the UIP concept for decision levels otherthan the current level <strong>in</strong> the context of a partition. We will callvertex a at decision level dl a UIP iff any path from thedecision variable of dl to the conflict<strong>in</strong>g variable needs toeither go through a, or go through a vertex of decision levelhigher than dl that is on the reason side of the partition. Notethat <strong>in</strong> this def<strong>in</strong>ition, the UIP vertices for a certa<strong>in</strong> decisionlevel are determ<strong>in</strong>ed by the partition of the vertices <strong>in</strong> decisionlevels higher than it. This is unlike the UIPs for the current(i.e. highest) decision level. Also note that the decisionvariables are UIPs regardless of the partition taken. As <strong>in</strong> thecase of current decision level UIPs, we will order these UIPsstart<strong>in</strong>g from the conflict<strong>in</strong>g variable as well.As mentioned before, each non-decision variable has anantecedent clause that represents the reason for theassignment. The antecedent clause is represented <strong>in</strong> theimplication graph as the <strong>in</strong>com<strong>in</strong>g edges of a vertex. Forexample, <strong>in</strong> Figure 3, the vertex –V 2 has two <strong>in</strong>cident edges,from –V 12 and V 16 respectively. Therefore, the antecedentclause for V 2 is (V 16 ’ + V 12 + V 2 ’). This clause is alreadypresent <strong>in</strong> the clause database. We can construct additionalclauses that are consistent with the clause database byreplac<strong>in</strong>g certa<strong>in</strong> literals <strong>in</strong> the antecedent clause with all oftheir antecedent literals. For example, <strong>in</strong> the above mentionedclause, if we replace V 16 ’ and V 12 with their antecedentliterals, we get the clause (V 2 ’ + V 6 + V 11 ’ + V 13 ). In Figure 3,this corresponds to cut 3. We will call this k<strong>in</strong>d of replacementa cut not <strong>in</strong>volv<strong>in</strong>g conflicts. This clause can be used as alearned clause and be added to the database. However, for thisk<strong>in</strong>d of learn<strong>in</strong>g to be useful, there must exist somereconvergence <strong>in</strong> the part of the graph that is <strong>in</strong>volved <strong>in</strong> thelearn<strong>in</strong>g. Otherwise if the <strong>in</strong>volved part of the graph is a treestructure, then all the <strong>in</strong>formation <strong>in</strong> the learned clause willalready be present <strong>in</strong> the orig<strong>in</strong>al database, and the learnedclause will not be useful.The learn<strong>in</strong>g process plays a very important role <strong>in</strong> prun<strong>in</strong>gthe search space of SAT problems. Some state-of-the-art SATsolvers, (e.g. [9]), utilize a technique called random restarts[16] to help the solver from fall<strong>in</strong>g <strong>in</strong>to difficult search regionsbecause of bad decisions <strong>in</strong> the early decision stages. Randomrestart<strong>in</strong>g periodically undoes all the decisions and restarts thesearch from the very beg<strong>in</strong>n<strong>in</strong>g. As noted <strong>in</strong> [12], frequentrestart<strong>in</strong>g actually does not hurt the solv<strong>in</strong>g process even forthe unsatisfiable <strong>in</strong>stances. The knowledge of the searchedspace is already recorded <strong>in</strong> the learned clauses. Therefore,discard<strong>in</strong>g all the searched spaces and restart<strong>in</strong>g is not a wasteof the previous effort as long as the recorded clauses are stillpresent.2. Different <strong>Learn<strong>in</strong>g</strong> Schemes


In this section, we will take a look at different learn<strong>in</strong>gschemes employed <strong>in</strong> the exist<strong>in</strong>g SAT solvers, and proposesome new schemes based on different cuts of the implicationgraph.Rel_sat [7] is one of the first SAT solvers to <strong>in</strong>corporatelearn<strong>in</strong>g and non-chronological backtrack<strong>in</strong>g. The rel_satconflict analysis eng<strong>in</strong>e generates the conflict clause byrecursively resolv<strong>in</strong>g the conflict<strong>in</strong>g clause with its antecedent,until the resolved clause <strong>in</strong>cludes only decision variables ofthe current decision level and variables assigned at decisionlevels smaller than the current level.In the implication graph representation, the rel_sat eng<strong>in</strong>e willput all variables assigned at the current decision level, exceptfor the decision variable, on the conflict side; and put all thevariables assigned prior to the current level and the currentdecision variable on the reason side. In our example, theconflict clause added would be:(V 11 ’+ V 6 + V 13 + V 4 ’+ V 8 ’ + V 17 + V 19 ’)We will call this learn<strong>in</strong>g scheme rel_sat scheme.ReasonSide-V 6 (1)V 11 (5)-V 13 (2)-V 12 (5)V 16 (5)Cut 3: cut does not<strong>in</strong>volve conflictV 4 (3)V 8 (2)V 1 (5)V 3 (5)-V 2 (5) -V 10 (5)<strong>Conflict</strong>Side-V 5 (5)Figure 4. Different cuts-V 17 (1)V 18 (5)-V 18 (5)First UIP CutV 19 (3)Last UIP CutBy add<strong>in</strong>g a conflict clause, the reason for the conflict isstated. The maximum decision level of the variables (exceptthe current decision level variable) <strong>in</strong> this conflict clause is thedecision level to backtrack. After backtrack<strong>in</strong>g, the conflictclause will become a unit clause, and s<strong>in</strong>ce the currentdecision variable is the unit literal, it is forced to flip. Such aclause that causes a flip of the variable is called an assert<strong>in</strong>gclause. It is always desirable for a conflict clause to be anassert<strong>in</strong>g clause. The unit variable <strong>in</strong> the assert<strong>in</strong>g clause willbe forced to assume a value and take the search to a new spaceto resolve the current conflict. To make a conflict clause anassert<strong>in</strong>g clause, the partition needs to have one UIP of thecurrent decision level on the reason side, and all verticesassigned after this UIP on the conflict side. Thus, afterbacktrack<strong>in</strong>g, the UIP vertex will become a unit literal, andmake the clause an assert<strong>in</strong>g clause.Another learn<strong>in</strong>g scheme is implemented <strong>in</strong> GRASP [6].GRASP’s learn<strong>in</strong>g scheme is different from rel_sat’s <strong>in</strong> thesense that it tries to learn as much as possible from a conflict.There are two cases when a conflict occurs <strong>in</strong> GRASP’slearn<strong>in</strong>g eng<strong>in</strong>e. If the current decision variable is a realdecision variable (expla<strong>in</strong>ed later), the GRASP learn<strong>in</strong>geng<strong>in</strong>e will add each reconvergence between UIPs <strong>in</strong> currentdecision level as a learned clause. In our example, if V 11 is areal decision (i.e. it has no antecedent), when the conflictoccurs, the GRASP eng<strong>in</strong>e will add one clause <strong>in</strong>to thedatabase correspond<strong>in</strong>g to the UIP reconvergences shown <strong>in</strong>Figure 4. This corresponds to the clause (V 2 ’ + V 6 + V 11 ’ +V 13 ).Moreover, GRASP will also <strong>in</strong>clude a conflict clause thatcorresponds to the partition where all the variables assigned atthe current decision level after the first UIP will be put on theconflict side. The rest of the vertices will be put on the reasonside. This corresponds to the FirstUIP cut as shown <strong>in</strong> figure3. The clause added will be (V 10 + V 8 ’ + V 17 + V 19 ’).After backtrack<strong>in</strong>g, the conflict clause will be an assert<strong>in</strong>gclause, which forces V 10 to flip. Note that V 10 was not adecision variable before. In GRASP, such a decision is a fakedecision. The decision level of V 10 rema<strong>in</strong>s unchanged. Thisessentially means that we are not done at the current decisionlevel yet. We will call this mode of the analysis eng<strong>in</strong>e flipmode.If the deduction found that flipp<strong>in</strong>g the decision variable stillleads to a conflict, the GRASP conflict analysis eng<strong>in</strong>e willenter backtrack<strong>in</strong>g mode. Besides the clauses that have to beadded <strong>in</strong> the flip mode, it also adds another clause called theback clause. The cut for the back clause will put all thevertices at the current decision level (<strong>in</strong>clud<strong>in</strong>g the fakedecision variable) on the conflict side, and all other vertices onthe reason side. For our example, suppose the decisionvariable V 11 is actually a fake decision variable, withantecedent clause (V 21 + V 20 + V 11 ’). Then, besides the twoclauses added before, the GRASP eng<strong>in</strong>e will add anotherclause(V 21 + V 20 + V 6 + V 13 + V 4 ’ + V 8 ’ + V 17 + V 19 ’)This clause is a conflict<strong>in</strong>g clause, and it only <strong>in</strong>volvesvariables assigned before the current decision level. Theconflict analysis eng<strong>in</strong>e will cont<strong>in</strong>ue to resolve this conflict,and br<strong>in</strong>g the solver to an earlier decision level. We will callthis learn<strong>in</strong>g scheme the GRASP scheme.Besides these two learn<strong>in</strong>g schemes, many more options exist.One obvious learn<strong>in</strong>g scheme is to add only the decisionvariables <strong>in</strong>volved <strong>in</strong> the conflict to the conflict clause. In ourimplication graph representation, this corresponds to mak<strong>in</strong>gthe cut such that only the decision variables are <strong>in</strong> the reasonside, and all the other variables are <strong>in</strong> the conflict side. Wewill call this scheme Decision scheme. Note that it is no goodto <strong>in</strong>clude all the decision variables of the current search tree<strong>in</strong> the conflict clause, because such a comb<strong>in</strong>ation of decisions


DecisionStrategySDISVMicroprocessor Formal Verification[19] Bounded Model Check<strong>in</strong>g [18]fvp-unsat.1.0(4) sss.1.0(48) sss.1.0a(9) barrel (8) longmult(16) queue<strong>in</strong>var(10) satplan(20)1uip 532.8 24.56 10.63 1012.62 2887.11 6.58 39.342uip 746.87 27.32 16.96 641.64 2734.57 16.37 41.373uip 2151.26 69.12 47.66 656.56 2946.73 19.44 57.16alluip 0.68(3) 1746.27(2) 79.09 1081.57(1) 11160.25 18.07 71.86rel_sat 2034.09 193.93 82.51 292.33(1) 5719.73 14.4 96.61m<strong>in</strong>cut 1612.74(2) 2293.18 11.15 4119.34(1) 7321.69(5) 100.94 43.84grasp 2224.44 94.64 33.99 654.54 6196.82 97.82 309.03decision* 0(4) 1022.57(17) 227.37(3) 541.96(2) 1421.35(4) 334.39(4) 193.36(3)1uip_f 11.36(3) 15307.13(3) 2997.37 281.48(1) 3141.8 817.07(5) 18(2)2uip_f 23.07(3) 18844.51(3) 2646.99 344.34(1) 4279.07 777.2(5) 29.51(2)3uip_f 40.75(3) 3985.23(9) 4109.86 432.77(1) 4440.49 860.3(5) 37.62(2)alluip_f 0(4) 4063.44(25) 0.28(8) 699.42(1) 11375.32 2025.08(5) 1136.44(2)relsat_f 80.94(3) 3114.83(16) 4261.25(4) 293.09(1) 4396.73 478.37(6) 3323.71(3)m<strong>in</strong>cut_f 0(4) 5619.4(15) 590.79(4) 3408.28(1) 5232.69(5) 3206.36(4) 373.78(2)grasp_f 22.51(3) 6497.99(8) 3382.47 326.46(1) 5597.1 792.12(5) 149.8(2)decision_f* 0(4) 415.76(42) 40.57(8) 479.61(1) 1006.58(6) 1.27(8) 600.87(10)* timeout set to 600s <strong>in</strong>stead of 3600sDEXIFTable 1. Run time for different learn<strong>in</strong>g schemeswill never occur aga<strong>in</strong> <strong>in</strong> the future unless we restart. Thus thelearned clause will hardly help prune any search space at all.The decision variables are the last UIPs for each decisionlevel. A more careful study of the Decision scheme suggestsmak<strong>in</strong>g a partition not limited at decision variables, but afterany UIPs of each of the decision levels. One of the choices isto make a partition after the first UIP of each decision level.We will call this scheme the All UIP scheme. Because UIPs ofa lower level depend on the partition, we need to do thepartition from the current decision level up to decision level 1.More precisely, the solver needs to f<strong>in</strong>d the first UIP of thecurrent decision level, then all variables of current decisionlevel assigned after it that have a path to the conflict<strong>in</strong>gvariable will be on the conflict side; the rest will be on thereason side. Then the solver will proceed to the decision levelprior to current one, and so on, until reach<strong>in</strong>g decision level 1.Another learn<strong>in</strong>g scheme is to make the conflict clause assmall as possible. This corresponds to the problem that givenan implication graph, remove the smallest number of variables(may <strong>in</strong>clude decision variables, but not the conflict<strong>in</strong>gvariable) from the implication graph so that there exist no pathfrom the decision variables to the conflict<strong>in</strong>g variable. This isa typical vertex m<strong>in</strong>-cut problem, which can be transformed<strong>in</strong>to an edge m<strong>in</strong>-cut problem and solved with maxflowm<strong>in</strong>cutalgorithms.It may also be desirable to make the conflict clause as relevantto the current conflict as possible. Therefore, we may want tomake the partition closer to the conflict<strong>in</strong>g variable. As wementioned earlier, to make the conflict clause an assert<strong>in</strong>gclause, we need to put one UIP of the current decision level onthe reason side. Therefore, if we put all variables assignedafter the first UIP of current decision level that have paths tothe conflict<strong>in</strong>g variable on the conflict side, and everyth<strong>in</strong>gelse on the reason side, we get a partition that is as close to theconflict as possible. We will call this 1 UIP scheme.The 1 UIP scheme is different from the All UIP scheme <strong>in</strong> thatwe only require the current decision level have its first UIP atthe reason side just before the partition. We may also requirethat the immediately previous decision level have its first UIPon the reason side just before the partition. This will make theconflict have only one variable that was assigned at theimmediate previous decision level. We will call this the 2 UIPscheme, similarly, we can have 3 UIP scheme etc., up to AllUIP, which makes the conflict clause have only one variablefor any decision level <strong>in</strong>volved.Other than the m<strong>in</strong>-cut scheme, all the other above-mentionedlearn<strong>in</strong>g schemes can be implemented by a traversal of theimplication graph. The time complexity of the traversal isO(V+E). Here V and E are the number of vertices and edgesof the implication graph respectively. The time complexity forf<strong>in</strong>d<strong>in</strong>g a m<strong>in</strong>-cut of the implication graph can be implemented<strong>in</strong> O(VElg(V 2 /E)) time [17].A good learn<strong>in</strong>g scheme should reduce the number ofdecisions needed to solve certa<strong>in</strong> problems as much aspossible. The effectiveness of a learn<strong>in</strong>g scheme is very hardto determ<strong>in</strong>e a priori. Generally speak<strong>in</strong>g, a shorter clause


9vliw_bp_mc( unsat, 19148 vars )longmult10( unsat, 4852 vars )sat/bw_large.d.cnf( sat, 6325 vars )1UIP rel_sat GRASP 1UIP rel_sat GRASP 1UIP rel_sat GRASPBranches(x10e6) 1.91 4.71 1.07 0.13 0.19 0.12 0.019 0.046 0.027Added Clauses(x10e6) 0.18 0.76 1.06 0.11 0.17 0.36 0.011 0.030 0.071Added Literals (x10e6) 73.13 292.08 622.96 17.16 28.07 77.47 0.56 1.61 6.12Added lits/cls 405.08 384.31 587.41 150.17 162.96 213.43 50.87 52.94 86.19Num. Implications(x10e6) 69.85 266.21 78.49 71.72 108.00 74.83 7.23 17.84 16.81Runtime 522.26 1996.73 2173.14 339.99 612.64 762.94 23.44 52.64 124.13Table 2. Detailed <strong>in</strong>formation on three large test cases for three learn<strong>in</strong>g schemes us<strong>in</strong>g VSIDS branch<strong>in</strong>g heuristicconta<strong>in</strong>s more <strong>in</strong>formation than a longer clause. Therefore, acommon belief is that the shorter the learned clause, the moreeffective the learn<strong>in</strong>g scheme. However, SAT solv<strong>in</strong>g is adynamic process. It has complex <strong>in</strong>terplay between thelearn<strong>in</strong>g schemes and the search process. Therefore, theeffectiveness of certa<strong>in</strong> search<strong>in</strong>g schemes can only bedeterm<strong>in</strong>ed by empirical data for the entire solution process.3. Experimental Results and DiscussionsIn this section, we empirically compare the learn<strong>in</strong>g schemesdiscussed <strong>in</strong> previous sections. We have implemented all theabove-mentioned learn<strong>in</strong>g schemes <strong>in</strong> the SAT solver zChaff(an <strong>in</strong>dependent implementation that shares several featureswith the Chaff SAT solver [9]). zChaff utilizes the highlyoptimized Chaff <strong>Boolean</strong> Constra<strong>in</strong>t Propagation (BCP)eng<strong>in</strong>e and VSIDS decision heuristic, thus mak<strong>in</strong>g theevaluation more <strong>in</strong>terest<strong>in</strong>g because some large benchmarkscan be evaluated <strong>in</strong> reasonable amount of time.zChaff’s default branch<strong>in</strong>g scheme VSIDS depends on theadded conflict clauses and literal counts for mak<strong>in</strong>g branch<strong>in</strong>gdecisions. Therefore, different learn<strong>in</strong>g schemes may alsoaffect the decision strategy. To make a fair comparison, wealso implemented a fixed branch<strong>in</strong>g strategy, which willbranch on the first unassigned variable with the smallestvariable <strong>in</strong>dex. The variables <strong>in</strong>dices are predeterm<strong>in</strong>ed for agiven problem <strong>in</strong>stance. Default values are used for all othersett<strong>in</strong>gs.Our test suite consists of benchmarks from bounded modelcheck<strong>in</strong>g [18] and microprocessor formal verification [19].We also <strong>in</strong>cluded a benchmark from the AI plann<strong>in</strong>gcommunity to cover a wider range of applications. Theexperiments were conducted on dual Pentium III 833Mhzmach<strong>in</strong>es runn<strong>in</strong>g L<strong>in</strong>ux, with 2G bytes physical memory.Each CPU has 32k L1 cache and 256k L2 cache. The time outlimit for each SAT <strong>in</strong>stance is 3600 seconds. For the Decisionlearn<strong>in</strong>g scheme, because of the large number of aborts, thetime out limit was set to 600 seconds to reduce totalexperiment time.The run times of different learn<strong>in</strong>g schemes on thebenchmarks are shown <strong>in</strong> Table 1. Each benchmark class hasmultiple <strong>in</strong>stances, shown <strong>in</strong> the parentheses follow<strong>in</strong>g eachbenchmark name. In the result section, the times shown are thetotal time spent on the solved <strong>in</strong>stances only. The number ofaborted <strong>in</strong>stances is shown <strong>in</strong> the parentheses follow<strong>in</strong>g runtime. If there is no such number, all the <strong>in</strong>stances are solved.For example, fvp-unsat-1.0 has 4 <strong>in</strong>stances. Us<strong>in</strong>g the defaultVSIDS decision strategy, the m<strong>in</strong>-cut learn<strong>in</strong>g scheme took1612.74 seconds to solve two of them, and aborted on theother two.From the experiment data we can see that for both default andfixed branch<strong>in</strong>g heuristics, the 1UIP learn<strong>in</strong>g scheme clearlyoutperforms other learn<strong>in</strong>g schemes. Contrary to generalbelief, the decision schemes that generate small clauses, e.g.m<strong>in</strong>-cut, all UIP and Decision do not perform as well.We selected the best of our proposed schemes, i.e. the 1UIPscheme, and compared it with the learn<strong>in</strong>g schemes employed<strong>in</strong> other state-of-the-art SAT solvers, i.e. the GRASP schemeand the rel_sat scheme. We selected three difficult test casesfrom three classes of the benchmark suites. Detailed solverstatistics for these schemes are presented <strong>in</strong> Table 2. Thebranch<strong>in</strong>g heuristic employed was VSIDS. From this table wef<strong>in</strong>d that the results are quite <strong>in</strong>terest<strong>in</strong>g. As we mentionedbefore, the GRASP scheme tries to learn as much as possiblefrom conflicts. Actually, it will learn more than one clause foreach conflict. For a given conflict, the clause leaned by 1UIPscheme is actually also learned by the GRASP scheme.Therefore, <strong>in</strong> most of the cases, the GRASP scheme needs asmaller number of branches to solve the problem. However,because the GRASP scheme records more clauses, the BCPprocess is slowed down. Therefore, the total run time of theGRASP scheme is more than 1UIP scheme. On the other hand,though rel_sat and 1UIP both learn one clause for eachconflict, the learned clause of rel_sat scheme is not aseffective as 1UIP as it needs more branches.4. Conclusions and Future ResearchThis paper explores the conflict driven learn<strong>in</strong>g techniqueswidely used <strong>in</strong> current state-of-the-art <strong>Boolean</strong> satisfiabilitysolvers. We have exam<strong>in</strong>ed the strength and weaknesses ofcurrent learn<strong>in</strong>g schemes employed <strong>in</strong> various SAT solvers.


We have generalized conflict driven learn<strong>in</strong>g <strong>in</strong>to a problemof partition<strong>in</strong>g the implication graph, and have proposed somenew learn<strong>in</strong>g schemes. These learn<strong>in</strong>g schemes wereimplemented <strong>in</strong> the SAT solver zChaff and extensiveexperiments were conducted. We have found that differentlearn<strong>in</strong>g schemes can affect the behavior of the SAT solversignificantly. The learn<strong>in</strong>g scheme based on the first UniqueImplication Po<strong>in</strong>t of the implication graph has proved to bequite robust and effective <strong>in</strong> solv<strong>in</strong>g SAT problems <strong>in</strong>comparison with other schemes.For future research, it would be <strong>in</strong>terest<strong>in</strong>g to explore thepossibility of mix<strong>in</strong>g different learn<strong>in</strong>g schemes <strong>in</strong> a s<strong>in</strong>gle runof the SAT solv<strong>in</strong>g process. As the SAT solv<strong>in</strong>g processprogresses, the number of literals <strong>in</strong> the learned clauses growsquickly. For some of the problems, <strong>in</strong> the later stages of thesolv<strong>in</strong>g process each learned clause may have severalthousand literals. The clause database may become tens oftimes larger than the orig<strong>in</strong>al size; very quickly mak<strong>in</strong>g thesolv<strong>in</strong>g process memory limited. It would be <strong>in</strong>terest<strong>in</strong>g toexplore the possibility of us<strong>in</strong>g different learn<strong>in</strong>g schemesdur<strong>in</strong>g different stages of the solution process. This can lead tobetter control of the size of the learned clause.As po<strong>in</strong>ted out before, learn<strong>in</strong>g is very important to thesuccess of the SAT solvers, but there is still little work onlearn<strong>in</strong>g <strong>in</strong> current research of SAT solv<strong>in</strong>g algorithms. Infact, there is very little <strong>in</strong>sight about why learn<strong>in</strong>g is useful andwhat makes one learn<strong>in</strong>g scheme better than the other. Forexample, relevance based learn<strong>in</strong>g and clause length boundedlearn<strong>in</strong>g are common practices <strong>in</strong> current SAT algorithms, butnot much attention has been given to choos<strong>in</strong>g optimalparameters for different problems. As SAT based methodsbecomes more and more popular <strong>in</strong> a wide range ofapplications, it is <strong>in</strong>creas<strong>in</strong>gly important for us to answer thesequestions <strong>in</strong> a systematic way. This paper represents a step <strong>in</strong>that direction.5. REFERENCES[1] P. Stephan, R. K. Brayton, and A. Sangiovanni-V<strong>in</strong>centelli, “Comb<strong>in</strong>ational Test Generation Us<strong>in</strong>g<strong>Satisfiability</strong>,” IEEE Transactions on Computer-AidedDesign of Integrated Circuits and Systems, vol. 15, 1167-1176, 1996.[2] M. Velev, and R. Bryant, “Effective Use of <strong>Boolean</strong><strong>Satisfiability</strong> Procedures <strong>in</strong> the Formal Verification ofSuperscalar and VLIW Microprocessors,” Proceed<strong>in</strong>gs ofthe Design Automation Conference, July 2001.[3] A. Biere, A. Cimatti, E. M. Clarke, and Y. Zhu. “SymbolicModel Check<strong>in</strong>g without BDDs,” Tools and Algorithms forthe Analysis and Construction of Systems (TACAS'99),number 1579 <strong>in</strong> LNCS. Spr<strong>in</strong>ger-Verlag, 1999.)[4] B. Selman, H. Kautz, and B. Cohen. “Local SearchStrategies for <strong>Satisfiability</strong> Test<strong>in</strong>g.” DIMACS Series <strong>in</strong>Discrete Mathematics and Theoretical Computer Science,vol. 26, AMS, 1996.[5] J. W. Freeman, “Improvements to Propositional<strong>Satisfiability</strong> Search Algorithms,” Ph.D. Dissertation,Department of Computer and Information Science,University of Pennsylvania, May 1995.[6] J. P. Marques-Silva and K. A. Sakallah, “GRASP: ASearch Algorithm for Propositional <strong>Satisfiability</strong>,” IEEETransactions on Computers, vol. 48, 506-521, 1999.[7] R. Bayardo, and R. Schrag, “Us<strong>in</strong>g CSP look-backtechniques to solve real-world SAT <strong>in</strong>stances,” Proceed<strong>in</strong>gsof the 14th Nat. (US) Conf. on Artificial Intelligence (AAAI-97), AAAI Press/The MIT Press, 1997.[8] H. Zhang. “SATO: An efficient propositional prover,”Proceed<strong>in</strong>gs of the International Conference on AutomatedDeduction, July 1997.[9] M. Moskewicz, C. Madigan, Y. Zhao, L. Zhang, and S.Malik. “Chaff: Eng<strong>in</strong>eer<strong>in</strong>g an efficient SAT <strong>Solver</strong>,”Proceed<strong>in</strong>gs of the Design Automation Conference, July2001.[10] M. Davis, G. Logemann, and D. Loveland. “A mach<strong>in</strong>eprogram for theorem prov<strong>in</strong>g.,” Communications of theACM, (5):394-397, 1962.[11] G. Stalmarck, “A system for determ<strong>in</strong><strong>in</strong>g prepositionallogic theorems by apply<strong>in</strong>g values and rules to triplets thatare generated from a formula,” Technical report, EuropeanPatent N 0403 454 (1995), US Patent N 5 27689.[12] M. Moskewicz, L. Zhang, Y. Zhao, S. Malik and C.Madigan, “Chaff: A Fast SAT <strong>Solver</strong> for EDAApplications”, Presented at the Dagstuhl sem<strong>in</strong>ar on SATv.s. BDD, March 2001. Dagstuhl, Germany.[13] J. P. Marques-Silva, “The Impact of Branch<strong>in</strong>g Heuristics<strong>in</strong> Propositional <strong>Satisfiability</strong> Algorithms,” Proceed<strong>in</strong>gs ofthe 9th Portuguese Conference on Artificial Intelligence(EPIA), September 1999.[14] Chu M<strong>in</strong> Li and Anbulagan, “Heuristics based on unitpropagation for satisfiability problems,” Proceed<strong>in</strong>gs of thefifteenth International Jo<strong>in</strong>t Conference on ArtificialIntelligence (IJCAI’97), Pages 366-371, Nagoya (Japan),1997[15] Chu M<strong>in</strong> Li, “Integrat<strong>in</strong>g equivalency reason<strong>in</strong>g <strong>in</strong>toDavis-Putnam Procedure,” Proceed<strong>in</strong>gs of AAAI 2000,2000.[16] C. P. Gomes, B. Selman, and H. Kautz, “Boost<strong>in</strong>gComb<strong>in</strong>atorial Search Through Randomization”,Proceed<strong>in</strong>gs of AAAI-98, Madison, WI, 1998.[17] A. Goldberg, R. Tarjan. “A new approach to themaximum flow problem,” Proceed<strong>in</strong>gs of the eighteenthannual ACM Symposium on Theory of Comput<strong>in</strong>g, 1986.[18] Bounded Model Check<strong>in</strong>g benchmarks available athttp://www.cs.cmu.edu/~modelcheck/bmc/bmcbenchmarks.html[19] M. N. Velev, Microprocessor Formal VerificationBenchmarks, available at http://www.ece.cmu.edu/~mvelev

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!