Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University."— Presentation transcript:

1 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

2 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

3 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

4 Binary Decision Diagrams ROBDDs are produced through the repeated application of  Redundant test elimination  Equivalent sub-graph sharing x1x1 x2x2 x2x2 x3x3 x4x4 01 10 1 1 1 0 0 0 0 1

5 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

6 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 0 0 1 1 d By unit clause propagation 1 c z 1 1 1 1 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

7 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

8  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

9 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

10 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

11 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

12 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

13 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

14 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

15 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.

16 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

17 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 x4x4 01 10 1 1 1 0 0 0 0 1 x1x1 x2x2 x2x2 x3x3 x4x4 01 10 1 1 1 0 0 0 0 1 Decision space of circuit IDecision space circuit II 9 paths in the BDD implies 8 backtracks in the CNF formula

18 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(  )

19 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

20 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

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

22 Dynamic Variable Ordering for the DP Procedure x3 x1 x2 x4 1 j i h f x1 x2 x3 x4 1 1 1 0 1 1 1 1 0 0 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

23 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

24 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

25 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

26 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


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

Similar presentations


Ads by Google