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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

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

Saved successfully!

Ooh no, something went wrong!