Normal Forms for Boolean Expressions

Similar documents
SAT Solvers. Ranjit Jhala, UC San Diego. April 9, 2013

EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving. Sanjit A. Seshia EECS, UC Berkeley

EECS 219C: Formal Methods Boolean Satisfiability Solving. Sanjit A. Seshia EECS, UC Berkeley

Boolean Functions (Formulas) and Propositional Logic

Boolean Satisfiability: From Theoretical Hardness to Practical Success. Sharad Malik Princeton University

Constraint Satisfaction Problems

Boolean Satisfiability Solving Part II: DLL-based Solvers. Announcements

Boolean Representations and Combinatorial Equivalence

Solving 3-SAT. Radboud University Nijmegen. Bachelor Thesis. Supervisors: Henk Barendregt Alexandra Silva. Author: Peter Maandag s

Chaff: Engineering an Efficient SAT Solver

SAT Solvers: A Condensed History. Sharad Malik Princeton University COS 598d 3/1/2010

Chapter 2 PRELIMINARIES

Deductive Methods, Bounded Model Checking

Satisfiability. Michail G. Lagoudakis. Department of Computer Science Duke University Durham, NC SATISFIABILITY

Combinational Equivalence Checking

SAT/SMT Solvers and Applications

On Resolution Proofs for Combinational Equivalence Checking

An Introduction to SAT Solvers

PROPOSITIONAL LOGIC (2)

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Unrestricted Backtracking Algorithms for Satisfiability

SAT Solver Heuristics

Validating SAT Solvers Using an Independent Resolution-Based Checker: Practical Implementations and Other Applications

Heuristic Backtracking Algorithms for SAT

4.1 Review - the DPLL procedure

SEARCHING FOR TRUTH: TECHNIQUES FOR SATISFIABILITY OF BOOLEAN FORMULAS

Learning Techniques for Pseudo-Boolean Solving and Optimization

Planning as Search. Progression. Partial-Order causal link: UCPOP. Node. World State. Partial Plans World States. Regress Action.

On Proof Systems Behind Efficient SAT Solvers. DoRon B. Motter and Igor L. Markov University of Michigan, Ann Arbor

An Experimental Evaluation of Conflict Diagnosis and Recursive Learning in Boolean Satisfiability

Towards a Symmetric Treatment of Satisfaction and Conflicts in Quantified Boolean Formula Evaluation

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses

Satisfiability Solvers

ESE535: Electronic Design Automation CNF. Today CNF. 3-SAT Universal. Problem (A+B+/C)*(/B+D)*(C+/A+/E)

On Resolution Proofs for Combinational Equivalence

Zchaff: A fast SAT solver. Zchaff: A fast SAT solver

Symbolic Methods. The finite-state case. Martin Fränzle. Carl von Ossietzky Universität FK II, Dpt. Informatik Abt.

Multi Domain Logic and its Applications to SAT

Example: Map coloring

Massively Parallel Seesaw Search for MAX-SAT

Memory Efficient All-Solutions SAT Solver and its Application for Reachability Analysis

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

ON SOLVING OPTIMIZATION PROBLEMS USING BOOLEAN SATISFIABILITY

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman.

On the Relation between SAT and BDDs for Equivalence Checking

A Scalable Algorithm for Minimal Unsatisfiable Core Extraction

Satisfiability (SAT) Applications. Extensions/Related Problems. An Aside: Example Proof by Machine. Annual Competitions 12/3/2008

Study of efficient techniques for implementing a Pseudo-Boolean solver based on cutting planes

CS-E3220 Declarative Programming

Satisfiability-Based Algorithms for 0-1 Integer Programming

SAT Solver. CS 680 Formal Methods Jeremy Johnson

CS-E3200 Discrete Models and Search

Extracting (Easily) Checkable Proofs from a Satisfiability Solver that Employs both Preorder and Postorder Resolution

Random backtracking in backtrack search algorithms for satisfiability

Linear Time Unit Propagation, Horn-SAT and 2-SAT

Adding New Bi-Asserting Clauses for Faster Search in Modern SAT Solvers

Computer-Aided Program Design

Efficient satisfiability solver

Practical SAT Solving

Better test results for the graph coloring and the Pigeonhole Problems using DPLL with k-literal representation

CDCL SAT Solvers. Joao Marques-Silva. Theory and Practice of SAT Solving Dagstuhl Workshop. April INESC-ID, IST, ULisbon, Portugal

Checking Satisfiability of a Conjunction of BDDs

ABT with Clause Learning for Distributed SAT

Motivation. CS389L: Automated Logical Reasoning. Lecture 5: Binary Decision Diagrams. Historical Context. Binary Decision Trees

1 Model checking and equivalence checking

Search techniques for SAT-based Boolean optimization

Where Can We Draw The Line?

Unrestricted Nogood Recording in CSP search

DM841 DISCRETE OPTIMIZATION. Part 2 Heuristics. Satisfiability. Marco Chiarandini

Foundations of AI. 8. Satisfiability and Model Construction. Davis-Putnam, Phase Transitions, GSAT and GWSAT. Wolfram Burgard & Bernhard Nebel

Combinational Equivalence Checking Using Satisfiability and Recursive Learning

Binary Decision Diagrams

8.1 Polynomial-Time Reductions

"Systemized" Program Analyses A "Big Data" Perspective on Static Analysis Scalability. Harry Xu and Zhiqiang Zuo University of California, Irvine

Verification of Proofs of Unsatisfiability for CNF Formulas

A Satisfiability Procedure for Quantified Boolean Formulae

A Novel SAT All-Solutions Solver for Efficient Preimage Computation

Automated Theorem Proving: DPLL and Simplex

Using DPLL for Efficient OBDD Construction

An Overview of Backtrack Search Satisfiability Algorithms

ABSTRACT: This paper presents an integrated infrastructure

Generalizations of Watched Literals for Backtracking Search

The Satisfiability Problem [HMU06,Chp.10b] Satisfiability (SAT) Problem Cook s Theorem: An NP-Complete Problem Restricted SAT: CSAT, k-sat, 3SAT

NP-Complete Reductions 2

Symbolic Model Checking

W4231: Analysis of Algorithms

Seminar decision procedures: Certification of SAT and unsat proofs

SAT-Solving: Performance Analysis of Survey Propagation and DPLL

Circuit versus CNF Reasoning for Equivalence Checking

MajorSat: A SAT Solver to Majority Logic

SAT-CNF Is N P-complete

8 NP-complete problem Hard problems: demo

Polynomial SAT-Solver Algorithm Explanation

Heuristic-Based Backtracking for Propositional Satisfiability

Conflict Driven Learning and Non-chronological Backtracking

Master s Project Proposal: Enhancements of SAT-Solvers for Some Combinatorial NAE-SAT Problems

Adding a New Conflict Based Branching Heuristic in two Evolved DPLL SAT Solvers

Computability Theory

Boolean satisfiability

QuteSat. A Robust Circuit-Based SAT Solver for Complex Circuit Structure. Chung-Yang (Ric) Huang National Taiwan University

Transcription:

Normal Forms for Boolean Expressions A NORMAL FORM defines a class expressions s.t. a. Satisfy certain structural properties b. Are usually universal: able to express every boolean function 1. Disjunctive Normal Form (DNF) - Sum Of Products of literals, i.e., a variable or its negation Example: xy'z + yz + w 2. Conjunctive Normal Form (CNF) - Product of CLAUSES, i.e., sum of literals Example: (z+w).(x+y+z'+w), (x+y'+z).(y+z).w 3. Negation Normal Form (NNF): Negation appears only at leav Example: (x+yz).y Counter Example: (a.b) +c

Propositional Logic Decidability Complexity Theorem: Satisfiability of CNF formulas is NP-complete Theorem: Validity of DNF formulas is NP-complete Theorem: Satisfiability and Validity of arbitrary boolean formulas is NP-complete Intuition behind NP-completeness: Transformation b/w normal forms can have exponential blow-u

2SAT Satisfiability is Polynomial Time Implication Graph Notes: 1. Each clause is an implication e.g., x +y = x y 2. Vertex for each literal in claus 3. One edge for each implication For each variable Check if there is a path from X to X as well as from X to X Path checking on graph is Poly!!

Reduction of 3SAT CNF to Clique Problem on Grap Theorem: 3SAT and above is NP-comple Note: Clique is NP-comple

Are we doomed then? No, there are efficient methods that work VERY well for large classes of formulas We study two techniques that are the basis for widely used tools in practice ROBDD: A compact cannonical form for arbitrary boolean functions SAT solving: An efficient heuristic-based algorithm to check satisfiablity of CNF formulas

SAT Solver Handling Capacity Progress

Techniques underlying state-of-art SAT Solvers Motivation for SAT BDD is an overkill, especially if just want SAT (e.g., you don't want to do equivalence checking) BDDs often explode without good ordering Revolutionary heuristic-based improvements on CNF-based resolution/sat methods Isn't conversion to CNF itself a problem?? Tseitin Transformation: Can be done with linear increase in size provided you also allow for linear increase in variables Acknowledgements: Sharad Malik, Princeton, Daniel Kroening, Oxford University

Some Easy Situations for CNF SAT Every literal occurs with the same polarity e.g., (a+b )(c +d) Every clause has at least one literal that occurs with same polarity everywhere e.g., (a+b )(b+c ) Nontrivial cases: Every clause has at least one literal that occurs with both polarity everywhere e.g., (a+b )(c+d)(b+c +a )d

Resolution Rule Resolution of a pair of clauses with incompatible variables Pick EXACTLY one such pivot variable Resolvent, is union of rets of literals in the premise clauses a + b + c + f g + h + c + f a + b + g + h + f Completeness: It is complete or checking SAT/UNSAT, given a set of clauses Soundness: Resolvent EQUISAT Premise CNF a. Resolvent is true whenever premise CNF is true i.e., Resolvent is SAT iff premise CNF is SAT b. If premise CNF is UNSAT Resolvent is UNSAT e.g., {a} {a'} --> resolvent is empty

The Timeline 196: Davis Putnam Resolution Based 1 variables

Davis Putnam Algorithm M.Davis, H. Putnam, A computing procedure for quantification theory", J. of ACM, Vol. 7, pp. 21-214, 196 Existential abstraction using resolution Iteratively select a variable for resolution till no more variables are left. F = (a + b + c) (b + c + f ) (b + e) F = (a + b) (a + b ) (a + c) (a + c ) b F = (a + c + e) (c + e + f) b F = (a) (a + c) (a + c ) bc F = (a + e + f) ba F = (c) (c ) bcaef F = 1 bac F = ( ) SAT UNSAT Potential memory explosion problem!

The Timeline 1962 Davis Logemann Loveland Depth First Search 1 var 196 DP 1 var 1952 Quine 1 var

DLL Algorithm Davis, Logemann and Loveland M. Davis, G. Logemann and D. Loveland, A Machine Program for Theorem-Proving", Communications of ACM, Vol. 5, No. 7, pp. 394-397, 1962 Also known as DPLL for historical reasons Basic framework for many modern SAT solvers

What s the big deal? x 1 Conflict clause: x1 +x3+x5 x 2 x 3 x 3 x 5 x 4 x 5 x 5 x 4 x 5 Significantly prune the search space learned clause is useful forever! Useful in generating future conflict clauses.

Implications and Boolean Constraint Propagation Implication A variable is forced to be assigned to be True or False based on previous assignments. Unit clause rule (rule for elimination of one literal clauses) An unsatisfied clause is a unit clause if it has exactly one unassigned literal. (a +b + c)(b + c )(a + c ) Satisfied Literal Unsatisfied Literal a = T, b = T, c is unassigned Unassigned Literal The unassigned literal is implied because of the unit clause. Boolean Constraint Propagation (BCP) Iteratively apply the unit clause rule until there is no unit clause available. a.k.a. Unit Propagation Workhorse of DLL based algorithms.

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c)

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) a

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) a Decision

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) a b Decision

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) a b c Decision

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c b a Implication Graph a @1 c @3 b@2 (a + c + d) d@3 (a + c + d ) (a + c + d ) Conflict!

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c b a a @ (a + c + d) d@3 Implication Graph (a + c + d) c @3 (a + c + d ) Conflict! b@2

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c a b Backtrack

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) a b c 1 Forced Decision a @1 (a + c + d) d@3 Conflict! c@3 (a + c + d ) b@2

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) a b c Backtrack 1

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 Forced Decision

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b 1 c a Decision a @1 (a + c + d) d@3 Conflict! c @3 (a + c + d ) b@2

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b 1 c a Backtrack

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 Forced Decision a @1 (a + c + d) d@3 Conflict! c@3 (a + c + d ) b@2

Basic PProcedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 Backtrack

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 1 Forced Decision

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 1 b Decision

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 1 b a@1 (a + b + c) c@2 Conflict! b @2 (a + b + c )

Basic DPLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 1 b Backtrack

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 1 b 1 Forced Decision a@1 (a + b + c) c@2 b@2

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 1 b 1 a@1 (a + b + c) (b + c + d) c@2 d@2 b@2

Basic DLL Procedure - DFS (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) (b + c + d) (a + b + c ) (a + b + c) c 1 b a 1 c 1 1 b 1 SAT a@1 (a + b + c) (b + c + d) c@2 d@2 b@2

Features of DPLL Eliminates the exponential memory requirements of DP Exponential time is still a problem Limited practical applicability largest use seen in automatic theorem proving Very limited size of problems are allowed 32K word memory Problem size limited by total size of clauses (13 clauses)

The Timeline 1986 Binary Decision Diagrams (BDDs) 1 var 196 DP 1 var 1952 Quine 1 var 1962 DLL 1 var

Using BDDs to Solve SAT R. Bryant. Graph-based algorithms for Boolean function manipulation. IEEE Trans. on Computers, C-35, 8:677-691, 1986. Store the function in a Directed Acyclic Graph (DAG) representation. Compacted form of the function decision tree. Reduction rules guarantee canonicity under fixed variable order. Provides for efficient Boolean function manipulation. Overkill for SAT.

The Timeline 196 DP 1 var 1996 GRASP Conflict Driven Learning, Non-chornological Backtracking 1k var 1988 SOCRATES 3k var 1994 Hannibal 3k var 1952 Quine 1 var 1962 DLL 1 var 1986 BDDs 1 var 1992 GSAT 3 var 1996 Stålmarck 1k var

The Timeline 196 DP 1 var 1996 GRASP Conflict Driven Learning, Non-chornological Backtracking 1k var 1988 SOCRATES 3k var 1994 Hannibal 3k var 1952 Quine 1 var 1962 DLL 1 var 1986 BDDs 1 var 1992 GSAT 3 var 1996 Stålmarck 1k var

GRASP Marques-Silva and Sakallah [SS96,SS99] J. P. Marques-Silva and K. A. Sakallah, "GRASP -- A New Search Algorithm for Satisfiability, Proc. ICCAD 1996. J. P. Marques-Silva and Karem A. Sakallah, GRASP: A Search Algorithm for Propositional Satisfiability, IEEE Trans. Computers, C-48, 5:56-521, 1999. Incorporates conflict driven learning and non-chronological backtracking Practical SAT instances can be solved in reasonable time Bayardo and Schrag s RelSAT also proposed conflict driven learning [BS97] R. J. Bayardo Jr. and R. C. Schrag Using CSP look-back techniques to solve real world SAT instances. Proc. AAAI, pp. 23-28, 1997(144 citations)

What can we learn from the implication graph? The decisions causing conflicts are the roots. i.e., the sinks None of the other decisions, e.g., at levels 4,5, matter Learn you can t have assignment: (x1. x9. x1. x11 )

backtrack to the largest decision level in the conflict Clause!!

What constitutes a sufficient condition for conflict: 1. Make a cut to separate conflict side from reason side 2. Conjunction (C) of literals labeling the set of nodes on the reason side that have at least one edge to the conflict side Conflict Clause: Negation of C

What is a good conflict clause? Must be new!! An asserting clause that flips decision made at current level Backtracks to the lowest level? Shorter clauses