Solving non clausal formulas with dpll search
Download
1 / 35

Solving Non-clausal Formulas with DPLL search - PowerPoint PPT Presentation


  • 125 Views
  • Uploaded on

Solving Non-clausal Formulas with DPLL search. Christian Thiffault Fahiem Bacchus University of Toronto. Toby Walsh UNSW. CNF. The classical DPLL algorithm (most modern SAT solvers) work with Conjunctive Normal Form (CNF) However, CNF is not the most natural representation.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Solving Non-clausal Formulas with DPLL search' - kadeem-head


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Solving non clausal formulas with dpll search

Solving Non-clausal Formulas with DPLL search

Christian Thiffault Fahiem Bacchus

University of Toronto

Toby Walsh

UNSW


Solving non clausal formulas with dpll search
CNF

  • The classical DPLL algorithm (most modern SAT solvers) work with Conjunctive Normal Form (CNF)

  • However, CNF is not the most natural representation.

  • Hence, to use modern SAT solver technology problems must be converted to CNF

  • In this work we demonstrate that such a conversion is unnecessary.

  • For a number of reasons such a conversion is also undesirable.

    • We demonstrate that original structure lost in conversion can be utilized to significantly improve the performance of SAT solvers.

NCDPLL SAT 2004


Tseitin encodings
Tseitin Encodings

  • The most commonly used CNF encoding is the Tseitin encoding [Tseitin 1970].

  • This encoding converts a propositional formula recursively by adding a new variable for every subformula.

NCDPLL SAT 2004


Tseitin encodings1
Tseitin Encodings

A → (C & D)

  • V1 ≡ (C & D)

    • (~V1, C), (~V1, D), (~C,~D,V1)

NCDPLL SAT 2004


Tseitin encodings2
Tseitin Encodings

A → (C & D)

  • V1 ≡ (C & D)

    • (~V1, C), (~V1, D), (~C,~D,V1)

  • V2 ≡ (A → V1)

    • (~V2, ~A,V1), (A,V2), (~V1,V2)

NCDPLL SAT 2004


Tseitin encodings3
Tseitin Encodings

A → (C & D)

  • V1 ≡ (C & D)

    • (~V1, C), (~V1, D), (~C,~D,V1)

  • V2 ≡ (A → V1)

    • (~V2, ~A,V1), (A,V2), (V1,V2)

  • The formula must be true: (V2)

NCDPLL SAT 2004


Converting to cnf is undesirable
Converting to CNF is Undesirable

  • There are two obvious problems arising from this conversion.

  • Structural information is lost

    • The fact that a particular group of clauses were generated from the same subformula is lost.

    • The global interconnections between the various subformulas are lost.

  • Additional variables are added. This potentially increases the size of the DPLL search.

NCDPLL SAT 2004


Structural information
Structural Information

  • Some of this information could be recovered from the CNF encoding, but not all of it [Lang & Marquis, 1989].

  • There is good empirical evidence that recovering structural information can yield considerable benefits in solving performance. [EqSatZ, LSAT].

  • But why lose this information in the first place?

    • We will show conversion to CNF is not necessary.

    • We also develop techniques which confirm the benefits of retaining the original structure.

NCDPLL SAT 2004


Extra variables
Extra Variables

  • Various works have noted the potential difficulty of introducing new variables.

  • Some have suggested restricting the DPLL search so that it cannot branch on any on the newly introduced “subformula” variables.

  • However, it is not difficult to show that restricting branching in this manner causes an exponential slowdown on some problems [Jarvisalo et al. 2004]

  • Solvers that attempt to restrict their branching in this manner can perform very poorly on many problems.

NCDPLL SAT 2004


Extra variables1
Extra Variables

  • The alternative is unrestricted branching.

  • However, with unrestricted branching a CNF solver can waste a lot of time branching on variables that have dynamically become irrelevant.

NCDPLL SAT 2004


Irrelevant variables
Irrelevant Variables

A → (C & D)

A=False.

Formula satisfied

NCDPLL SAT 2004


Irrelevant variables cnf
Irrelevant Variables CNF

A → (C & D)

  • V1 ≡ (C & D)

  • V2 ≡ (A → V1)

Solver must still determine that the remaining clauses are SAT

NCDPLL SAT 2004


Converting to cnf is unnecessary
Converting to CNF is Unnecessary

  • DPLL search can be performed on the original formula.

    • This has been noted in previous work on circuit based solvers [Ganai et al. 2002]

NCDPLL SAT 2004


Dpll on formulas
DPLL on formulas

  • Convert formula to a dag.

    A → (C & D) \/ B → (C & D)

\/

B

A

&

C

D

NCDPLL SAT 2004


Dpll on formulas1
DPLL on formulas

  • Associate a truth value (True/ False/ Unassigned) with every node of the DAG.

  • Now perform DPLL search by splitting on the truth value of an unassigned node.

  • Use the logic of the boolean operators to propagate truth values to neighboring nodes.

  • A solution is found when all nodes have been labeled with consistent truth values (i.e., the parent and child values are consistent with the logic of the parent’s operator.)

  • A contradiction occurs when True and False are propagated to the same node.

NCDPLL SAT 2004


Example
Example

\/

B

A

&

C

D

NCDPLL SAT 2004


Example1
Example

\/

B

A

&

C

D

NCDPLL SAT 2004


Example2
Example

\/

B

A

&

C

D

NCDPLL SAT 2004


Comparison
Comparison

  • Assigning a truth value to a node in the DAG is equivalent to assigning a truth value to the corresponding variable in the CNF encoding.

  • Propagation in the DAG is equivalent to unit propagation in the CNF encoding.

NCDPLL SAT 2004


Comparison1
Comparison

  • The rule that propagated a truth value can be recorded. Once a contradiction is detected a conflict clause can be learned (a set of impossible node assignments). This clause can be made equivalent to the 1-UIP clauses learned by CNF solvers.

  • The learned clauses can be stored and used to unit propagate node truth values in the rest of the search.

NCDPLL SAT 2004


Comparison2
Comparison

  • Complex gates, e.g., n-ary XOR can be more efficiently propagated in the DAG representation (these gates require a number of clauses exponential in the number of their inputs).

NCDPLL SAT 2004


Efficient propagation
Efficient Propagation

  • Efficient Unit Propagation via lazy data structures is a key element of modern SAT solvers.

  • One new feature of our circuit based solver over previous circuit solvers is that it utilizes similar lazy data structures to make its propagation as efficient as CNF solvers.

NCDPLL SAT 2004


Efficient propagation1
Efficient Propagation

  • E.g., an AND gate becomes true only when all of its children become true.

    • Assign one child as a true watch, and don’t check for true propagating to the AND gate node unless its true watch becomes true.

    • Some benchmarks have AND gates with thousands of children.

    • Previous “table-lookup” circuit solvers required some computation each time a child became true.

  • Using these techniques there is no intrinsic loss of efficiency in using the DAG over CNF.

NCDPLL SAT 2004


Structure based optimizations
Structure Based Optimizations

  • Since no penalty is being paid for using the original formula, we can turn to exploiting the extra structural information it provides.

  • We implemented two structure based optimizations.

    • Don’t care propagation to deal with irrelevant variables.

    • Conflict Clause reduction.

NCDPLL SAT 2004


Don t care propagation
Don’t Care Propagation

  • We propagate a third “truth” value through the DAG: don’t cares.

  • A node C is don’t care wrt a particular parent P

    • if its truth value can no longer affect the truth value of P nor any of its P siblings.

    • or P is don’t care.

  • A node C is don’t care if it is don’t care wrt to all of its parents.

NCDPLL SAT 2004


Don t care propagation1
Don’t Care Propagation

  • Assign a don’t care watch parent for each node.

  • C becoming don’t care wrt to its watch parent P can be detected when truth values are propagated to P.

  • If C becomes don’t care wrt to its don’t care watch we look for another watch.

  • If we can’t find one we know that C has become don’t care.

  • Finally, we stop the search from branching on don’t care nodes. This eliminates branching of irrelevant values.

NCDPLL SAT 2004


Conflict clause reductions
Conflict Clause Reductions

  • If one learns a conflict clause (L1,L2,...) and one has L1 → L2, then we can reduce the conflict clause by a resolution step:

    • (-L1,L2) (L1,L2,...)  (L2,...)

    • The resolvant subsumes the original conflict clause.

  • In a CNF encoding one would have to search the clauses to detect this situation—probably not going to be effective.

  • In the DAG one can examine the neighbors of each node assignment in the conflict clause to see if any of the other assignments in the clause are implied by it.

  • If so we can remove the implying node assignment.

  • If this is done with discrimination it can yield a significant decrease in the size of the learned clauses with little overhead.

NCDPLL SAT 2004


Empirical results
Empirical Results.

  • We compared with Zchaff.

  • Tried to make the two solvers as close as possible, same magic numbers (e.g., clause database cleanup criteria, restart intervals etc.), same branching heuristics.

  • Hence, we tried to isolate the impact of the non-clausal representation and the structure based optimizations.

  • We believe that the same improvements could be obtained with others CNF solvers via this technique.

NCDPLL SAT 2004


Empirical results caveats
Empirical Results caveats

  • Our experiments were hampered by a lack of non-clausal benchmarks.

  • The performance of our solver was also limited by the fact that the benchmarks we did obtain has already been transformed into simpler formulas, e.g., no complex XOR of IFF gates were present in the benchmarks.

NCDPLL SAT 2004



Fvp unsat 2 0 decisions
FVP-UNSAT-2.0 Decisions

NCDPLL SAT 2004




Other series
Other Series

NCDPLL SAT 2004


Conclusions
Conclusions

  • No intrinsic reason to convert to CNF.

  • Many other structure based optimizations remain to be investigated, e.g.

    • better branching

    • non-clausal representation of conflicts

    • more complex gates.

NCDPLL SAT 2004