Solving Non-clausal Formulas with DPLL search

Slides:



Advertisements
Similar presentations
The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
Advertisements

Exploiting SAT solvers in unbounded model checking
Automated Theorem Proving
Time-Space Tradeoffs in Resolution: Superpolynomial Lower Bounds for Superlinear Space Chris Beck Princeton University Joint work with Paul Beame & Russell.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Properties of SLUR Formulae Ondřej Čepek, Petr Kučera, Václav Vlček Charles University in Prague SOFSEM 2012 January 23, 2012.
Reduction of Interpolants for Logic Synthesis John Backes Marc Riedel University of Minnesota Dept.
ECE 667 Synthesis & Verification - SAT 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Boolean SAT CNF Representation Slides adopted (with.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
3/25  Monday 3/31 st 11:30AM BYENG 210 Talk by Dana Nau Planning for Interactions among Autonomous Agents.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Efficient SAT Solving for Non- clausal Formulas using DPLL, Graphs, and Watched-cuts Himanshu Jain Edmund M. Clarke.
1 Satisfiability Checking of Non-clausal Formulas using General Matings Himanshu Jain Constantinos Bartzis Edmund Clarke Carnegie Mellon University.
Methods of Proof Chapter 7, second half.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
A Compressed Breadth-First Search for Satisfiability DoRon B. Motter and Igor L. Markov University of Michigan, Ann Arbor.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
ENGG3190 Logic Synthesis “Boolean Satisfiability” Winter 2014 S. Areibi School of Engineering University of Guelph.
GRASP: A Search Algorithm for Propositional Satisfiability EE878C Homework #2 2002/11/1 KAIST, EECS ICS Lab Lee, Dongsoo.
SAT Solving Presented by Avi Yadgar. The SAT Problem Given a Boolean formula, look for assignment A for such that.  A is a solution for. A partial assignment.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Boolean Satisfiability and SAT Solvers
Quantified Formulas - Decision Procedure Daniel Kroening, Ofer Strichman Presented by Changki Hong 07 NOV 08.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
Non-clausal Reasoning Fahiem Bacchus, Christian Thiffault, Toronto Toby Walsh, UCC & Uppsala (soon UNSW, NICTA, Uppsala)
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Boolean Satisfiability Present and Future
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
REU 2007-ParSat: A Parallel SAT Solver Christopher Earl, Mentor: Dr. Hao Zheng Department of Computer Science & Engineering Introduction Results and Conclusions.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Hybrid BDD and All-SAT Method for Model Checking
Inference and search for the propositional satisfiability problem
As the last CC-list represents Maximum Compatible Classes we conclude:
Computability and Complexity
Recovering and Exploiting Structural Knowledge from CNF Formulas
Logical Inference: Through Proof to Truth
Logic Synthesis CNF Satisfiability.
Propositional Calculus: Boolean Algebra and Simplification
Fahiem Bacchus University of Toronto
Complexity 6-1 The Class P Complexity Andrei Bulatov.
ECE 667 Synthesis and Verification of Digital Circuits
Logics for Data and Knowledge Representation
Artificial Intelligence: Agents and Propositional Logic.
Resolution Proofs for Combinational Equivalence
Methods of Proof Chapter 7, second half.
Stronger learning and higher backjumping
Instructor: Aaron Roth
Instructor: Aaron Roth
GRASP-an efficient SAT solver
Presentation transcript:

Solving Non-clausal Formulas with DPLL search Christian Thiffault Fahiem Bacchus University of Toronto URL for the location of these slides. 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. 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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

Tseitin Encodings A → (C & D) V1 ≡ (C & D) (~V1, C) (~V1, D) (~V1, C), (~V1, D), (~C,~D,V1) (~V1, C) (~V1, D) (~C,~D,V1) 6/25/2019 NCDPLL SAT 2004

Tseitin Encodings A → (C & D) V1 ≡ (C & D) V2 ≡ (A → V1) (~V1, C) (~V1, C), (~V1, D), (~C,~D,V1) V2 ≡ (A → V1) (~V2, ~A,V1), (A,V2), (~V1,V2) (~V1, C) (~V1, D) (~C,~D,V1) 4. (~V2, ~A,V1) 5. (A,V2) 6. (~V1,V2) 6/25/2019 NCDPLL SAT 2004

Tseitin Encodings A → (C & D) V1 ≡ (C & D) V2 ≡ (A → V1) (~V1, C), (~V1, D), (~C,~D,V1) V2 ≡ (A → V1) (~V2, ~A,V1), (A,V2), (V1,V2) The formula must be true: (V2) (~V1, C) (~V1, D) (~C,~D,V1) 4. (~V2, ~A,V1) 5. (A,V2) 6. (V1,V2) 7. (V2) 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

Irrelevant Variables A=False. A → (C & D) Formula satisfied 6/25/2019 NCDPLL SAT 2004

Irrelevant Variables CNF A → (C & D) V1 ≡ (C & D) V2 ≡ (A → V1) Solver must still determine that the remaining clauses are SAT (~V1, C) (~V1, D) (~C,~D,V1) 4. (~V2, ~A,V1) 5. (A,V2) 6. (V1,V2) 7. (V2) 8. (~A) 6/25/2019 NCDPLL SAT 2004

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] 6/25/2019 NCDPLL SAT 2004

DPLL on formulas Convert formula to a dag. A → (C & D) \/ B → (C & D) 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

Example \/ → → B A & C D 6/25/2019 NCDPLL SAT 2004

Example \/ → → B A & C D 6/25/2019 NCDPLL SAT 2004

Example \/ → → B A & C D 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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). 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004

FVP-UNSAT-2.0 (Velev) Time 6/25/2019 NCDPLL SAT 2004

FVP-UNSAT-2.0 Decisions 6/25/2019 NCDPLL SAT 2004

FVP-UNSAT-2.0 Don’t Cares 6/25/2019 NCDPLL SAT 2004

FVP-UNSAT-2.0 Clause Reduction 6/25/2019 NCDPLL SAT 2004

Other Series 6/25/2019 NCDPLL SAT 2004

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. 6/25/2019 NCDPLL SAT 2004