On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.

Slides:



Advertisements
Similar presentations
Model Checking Lecture 4. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Advertisements

Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
“Using Weighted MAX-SAT Engines to Solve MPE” -- by James D. Park Shuo (Olivia) Yang.
TOPIC : Reduced Ordered Binary Decision Diagrams UNIT 1: Modeling Digital Circuits Module 1 : Functional Modeling.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View SAT.
1/30 SAT Solver Changki PSWLAB SAT Solver Daniel Kroening, Ofer Strichman.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Reduction of Interpolants for Logic Synthesis John Backes Marc Riedel University of Minnesota Dept.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
Weizmann Institute Tuning SAT-checkers for Bounded Model-Checking A bounded guided tour Ofer Shtrichman Weizmann Institute & IBM (HRL)
Aiman El-Maleh, Ali Alsuwaiyan King Fahd University of Petroleum & Minerals, Dept. of Computer Eng., Saudi Arabia Aiman El-Maleh, Ali Alsuwaiyan King Fahd.
Willis Lemasters Grant Conklin. Searching a tree recursively one branch at a time, abandoning any branch which does not satisfy the search constraints.
CS21 Decidability and Tractability
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.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
08/1 Foundations of AI 8. Satisfiability and Model Construction Davis-Putnam, Phase Transitions, GSAT Wolfram Burgard and Bernhard Nebel.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
The Theory of NP-Completeness
Sanjit A. Seshia and Randal E. Bryant Computer Science Department
Efficient Reachability Checking using Sequential SAT G. Parthasarathy, M. K. Iyer, K.-T.Cheng, Li. C. Wang Department of ECE University of California –
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
SAT Algorithms in EDA Applications Mukul R. Prasad Dept. of Electrical Engineering & Computer Sciences University of California-Berkeley EE219B Seminar.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
IT University of Copenhagen Lecture 8: Binary Decision Diagrams 1. Classical Boolean expression representations 2. If-then-else Normal Form (INF) 3. Binary.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: BDD BDDs applied in equivalence checking.
Binary Decision Diagrams (BDDs)
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
On Bridging Simulation and Formal Verification Eugene Goldberg Cadence Research Labs (USA) VMCAI-2008, San Francisco, USA.
Boolean Satisfiability and SAT Solvers
MBSat Satisfiability Program and Heuristics Brief Overview VLSI Testing B Marc Boulé April 2001 McGill University Electrical and Computer Engineering.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: SAT SAT applied in equivalence checking.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
1 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Advanced Algorithm Design and Analysis (Lecture 14) SW5 fall 2004 Simonas Šaltenis E1-215b
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
SAT-Based Model Checking Without Unrolling Aaron R. Bradley.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Custom Computing Machines for the Set Covering Problem Paper Written By: Christian Plessl and Marco Platzner Swiss Federal Institute of Technology, 2002.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
1 Boolean Satisfiability (SAT) Class Presentation By Girish Paladugu.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
BDD-based Synthesis of Reversible Logic for Large Functions Robert Wille Rolf Drechsler DAC’09 Presenter: Meng-yen Li.
Hybrid BDD and All-SAT Method for Model Checking
Inference and search for the propositional satisfiability problem
Recovering and Exploiting Structural Knowledge from CNF Formulas
Hard Problems Introduction to NP
Simple Circuit-Based SAT Solver
Heuristics for Efficient SAT Solving
LPSAT: A Unified Approach to RTL Satisfiability
Canonical Computation without Canonical Data Structure
Binary Decision Diagrams
ECE 667 Synthesis and Verification of Digital Circuits
Canonical Computation Without Canonical Data Structure
Decision Procedures An Algorithmic Point of View
Research Status of Equivalence Checking at Zhejiang University
Canonical Computation without Canonical Data Structure
CS21 Decidability and Tractability
Canonical Computation without Canonical Data Structure
Presentation transcript:

On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University of California, San Diego Institute of Computer Science University of Bremen Computer Science & Engineering Dept. University of California, San Diego

Outline Introduction BDDs The Davis-Putnam (DP) Procedure Equivalence Checking BDD-DP Relation Characteristics of CNF Formulas of Logic Circuits Relation between BDD and the DP Dynamic Variable Ordering for the DP Procedure Experimental Results Conclusions Open questions

Introduction BDDs have been traditionally used in logic synthesis and verification New Boolean satisfiability (SAT) solvers have shown recent promise as efficient equivalence checkers It is essential to understand the relation between BDDs and SAT procedures and show how the techniques of one domain can be applied to the other

Binary Decision Diagrams ROBDDs are produced through the repeated application of  Redundant test elimination  Equivalent sub-graph sharing x1x1 x2x2 x2x2 x3x3 x4x

The Davis-Putnam Procedure a assign(sat_formula , literal v) begin a1. v = true; a2. simplify  ; a3. apply unit clause propagation; a4. if  has an empty clause then return false else return true; end DP(sat_formula  ) begin d1. choose literal v to split on; d2. if v = NULL then return true; d3. if assign( , v) then d4. if DP(  ) then return true; d5. undo v assignment; d6. if assign( ,  v) then d7. if DP(  ) then return true; d8. return false; end a b c d z  = (  a + d)  (  b + d)  (a + b +  d)  (c +  z)  (d +  z)  (  d +  c + z). 0 b 0 d z 0 By unit clause propagation 0 1 Consistent assignment achieved

The Davis-Putnam Procedure a a b c d z  = (  a + d)  (  b + d)  (a + b +  d)  (c +  z)  (d +  z)  (  d +  c + z). 0 b 0 d z d By unit clause propagation 1 c z assign(sat_formula , literal v) begin a1. v = true; a2. simplify  ; a3. apply unit clause propagation; a4. if  has an empty clause then return false else return true; end DP(sat_formula  ) begin d1. choose literal v to split on; d2. if v = NULL then return true; d3. if assign( , v) then d4. if DP(  ) then return true; d5. undo v assignment; d6. if assign( ,  v) then d7. if DP(  ) then return true; d8. return false; end

Equivalence Checking Core equivalence checking techniques  Using BDDs Build the BDD of each circuit under verification and check that the BDDs are isomorphic  Using SAT Check that the stuck-at-0 SAT formula of the miter circuit is unsatisfiable Circuit I Circuit II Miter output Primary Input

 Equivalence checking can be viewed as Equivalence Checking A search in the decision trees of the two circuits for a path that leads to the terminal 1(0) in one but leads to the 0(1) terminal in the other. Decision tree of Circuit I 0 1 Decision tree of Circuit II Minimization of the number of paths to be compared  Minimization of equivalence checking time

Characteristics of CNF Formulas of Logic Circuits It is possible to find a set of variables P(  )  V(  ) such that  can be satisfied by only splitting on the variables of P(  ) in the DP procedure. Let  be a CNF formula generated from a logic circuit Let V(  ) be the set of variables that  depends on P(  ) is the set of primary inputs Reducing the number of decision variables introduces an overall reduction in the decision tree size

Characteristics of CNF Formulas of Logic Circuits Let S denote the set of primary inputs currently assigned logic values under the assignment A s If A s is applied to , the resultant is the logic function f As If v  P(  ) but v  S then v is said to be redundant under A s if  f As /  v = 0 A CNF formula  is satisfied under a truth assignment A s of a set S  P(  ) if  v  (P(  )-S):  f As /  v = 0 If the primary output variable  is assigned a value under the current assignment then there is no point in further assignments

a b c d z Characteristics of CNF Formulas of Logic Circuits  = (  a + d)  (  b + d)  (a + b +  d)  (c +  z)  (d +  z)  (  d +  c + z) P(  ) = {a, b, c}  = z If S = {a} and B s ={a  1} then  = (d)  (  b + d)  (c +  z)  (d +  z)  (  d +  c + z) 1 a

a b c d z Characteristics of CNF Formulas of Logic Circuits  = (  a + d)  (  b + d)  (a + b +  d)  (c +  z)  (d +  z)  (  d +  c + z) P(  ) = {a, b, c}  = z If S = {a} and B s ={a  1} then  = (d)  (  b + d)  (c +  z)  (d +  z)  (  d +  c + z) 1 a Under B s  f Bs /  b = 0  b is redundant

a b c d z Characteristics of CNF Formulas of Logic Circuits  = (  a + d)  (  b + d)  (a + b +  d)  (c +  z)  (d +  z)  (  d +  c + z) P(  ) = {a, b, c}  = z If S = {c} and A s ={c  0} then z  0 and  = (  a + d)  (  b + d)  (a + b +  d). 0 0 c

a b c d z Characteristics of CNF Formulas of Logic Circuits  = (  a + d)  (  b + d)  (a + b +  d)  (c +  z)  (d +  z)  (  d +  c + z) P(  ) = {a, b, c}  = z Under A s both  f As /  a and  f As /  b = 0  a & b are redundant If S = {c} and A s ={c  0} then z  0 and  = (  a + d)  (  b + d)  (a + b +  d). 0 0 c

Characteristics of CNF Formulas of Logic Circuits Observation 1: DP decision space is reduced to be that of the primary inputs Observation 2: Redundant variables are not considered for decision in the DP procedure Observation 1 reduces the decision space to be like that of a BDD and observation 2 parallels the removal of redundant test in BDDs.

Given a BDD  and a CNF formula  for a logic circuit C, then under a variable ordering  and a truth assignment A  on a certain path of  to the terminal,  is satisfiable using the same variable ordering and truth assignment. Relation between BDD and DP The equivalence checking problem between two circuits can be viewed as a search in the decision trees of the two circuits for a path that leads to the terminal 1(0) in one but leads to the 0(1) terminal in the other. Decision tree of Circuit I Decision tree of Circuit II 0 1

Relation between BDD and DP BDD-DP Theorem For BDD  with P paths and a CNF formula  for a logic circuit C then if DP variable ordering strategy captures the same ordering for every path of , then DP proves the equivalence of C against an equivalent version in P-1 backtracks. x1x1 x2x2 x2x2 x3x3 x4x x1x1 x2x2 x2x2 x3x3 x4x Decision space of circuit IDecision space circuit II 9 paths in the BDD implies 8 backtracks in the CNF formula

Dynamic Variable Ordering for the DP Procedure  The variable ordering strategy should differ for every path of the decision tree DP dynamic variable ordering strategy should  No splitting on redundant variables  Minimum number of splittings to reach the terminals Assign a weight of 1.0 to the primary output For each circuit level from output to input:  Divide the weight of the unbounded gate output among its inputs  Accumulate the weight of the fan-out branches into the fan-out stem Return the PI with the largest weight Var_Choose(  )

Dynamic Variable Ordering for the DP Procedure The proposed dynamic variable ordering represent the structural impact of every primary input of the circuit  Assigns a weight of zero to redundant variables  Tries to minimize the number of assignments to the terminals by splitting on the primary input with the largest weight  The weights reflect structural properties of the circuit and should be considered as a heuristic to the optimal case

j i h f x1 x2 x3 x4 Dynamic Variable Ordering for the DP Procedure 1 1/2 1/12 1/3 x3 1/4 1/2 1/4

Dynamic Variable Ordering for the DP Procedure x3 1 j i h f x1 x2 x3 x /3 x1 x2 x

Dynamic Variable Ordering for the DP Procedure x3 x1 x2 x4 1 j i h f x1 x2 x3 x For this example, the variable ordering that minimizes the number of BDD nodes (4) also minimizes the number of paths (6) DP procedure proved the equivalence in an optimal number of 5 backtracks In this case, the proposed dynamic variable ordering strategy faithfully captured the variable ordering of the minimum size BDD

BDD number of nodes and number of paths Questions that need answering I. Is there a relation between the number of nodes and the number of paths in a BDD? II. Does the minimum size BDD have the minimum number of paths? The first question remains an open problem After numerous experiments, we concluded that the minimum size BDD does not necessarily have the minimum number of paths

Experimental Results Average 90% reduction in the backtracks for the 21 functions of the ISCAS’89 benchmark circuits The optimal is determined by picking the minimal path BDD resulting from sifting

Experimental Results Average 70% time reduction for the hard-SAT functions (13) of the ISCAS’ 89 benchmark circuits The multiplier c6288 number of paths does not significantly change for different variable orderings Experiments carried out using a Pentime 233Mhz with 64 MB RAM

Conclusions The relation between the search tree of the DP procedure and the BDD of the corresponding circuit was studied We established the relation between the number of paths in a BDD and the corresponding number of backtracks in the DP procedure, enabling the calculation of optimal lower bounds This relation enabled the inclusion of a modified BDD variable ordering heuristic in the splitting choice of the DP procedure Experimental results confirm the reported relation and demonstrate a dramatic decrease in the number of backtracks and time need to solve equivalence checking