BDDs1 Binary Tree Representation The recursive Shannon expansion corresponds to a binary tree Example: Each path from the root to a leaf corresponds to.

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

Introduction to Algorithms Quicksort
FUNCTION OPTIMIZATION Switching Function Representations can be Classified in Terms of Levels Number of Levels, k, is Number of Unique Boolean (binary)
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
Planning based on Model Checking Dept. of Information Systems and Applied CS Bamberg University Seminar Paper Svetlana Balinova.
TOPIC : Reduced Ordered Binary Decision Diagrams UNIT 1: Modeling Digital Circuits Module 1 : Functional Modeling.
CS357 Lecture: BDD basics David Dill 1. 2 BDDs (Boolean/binary decision diagrams) BDDs are a very successful representation for Boolean functions. A BDD.
The Volcano/Cascades Query Optimization Framework
MVI Function Review Input X is p -valued variable. Each Input can have Value in Set {0, 1, 2,..., p i-1 } literal over X corresponds to subset of values.
Binary Recursion Tree The recursive Shannon expansion corresponds to a binary recursion tree Example: Path (v) to node v corresponds to cube c(v) Example:
A balanced life is a prefect life.
© 2011 Carnegie Mellon University Binary Decision Diagrams Part Bug Catching: Automated Program Verification and Testing Sagar Chaki September.
© 2011 Carnegie Mellon University Binary Decision Diagrams Part Bug Catching: Automated Program Verification and Testing Sagar Chaki September.
ECE 667 Synthesis & Verification - Boolean Functions 1 ECE 667 Spring 2013 ECE 667 Spring 2013 Synthesis and Verification of Digital Circuits Boolean Functions.
Binary Decision Diagrams. ROBDDs Slide 2 Example Directed acyclic graph non-terminal node terminal node What function is represented by the graph?
1 ROBDD’s represents a logic function by a graph (DAG). (many logic functions can be represented compactly - usually better than SOP’s)represents a logic.
Spring 07, Feb 13 ELEC 7770: Advanced VLSI Design (Agrawal) 1 ELEC 7770 Advanced VLSI Design Spring 2007 Binary Decision Diagrams Vishwani D. Agrawal James.
DATE-2002TED1 Taylor Expansion Diagrams: A Compact Canonical Representation for Symbolic Verification M. Ciesielski, P. Kalla, Z. Zeng B. Rouzeyre Electrical.
Boolean Functions and their Representations
Rolf Drechlser’s slides used
ECE 665 – Computer Algorithms 1 ECE 665 Spring 2004 ECE 665 Spring 2004 Computer Algorithms Binary Decision Diagrams Implementation Issues Slides adopted.
COE 561 Digital System Design & Synthesis Logic Synthesis Background
ECE Synthesis & Verification - Lecture 9b 1 ECE 697B (667) Fall 2004 ECE 697B (667) Fall 2004 Synthesis and Verification of Digital Systems Boolean.
Taylor Expansion Diagrams (TED): Verification EC667: Synthesis and Verification of Digital Systems Spring 2011 Presented by: Sudhan.
Computation Engines: BDDs and SAT (part 1) 290N: The Unknown Component Problem Lecture 7.
ECE Synthesis & Verification - Lecture 10 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Binary.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
ECE 667 Synthesis & Verification - BDD 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Binary Decision Diagrams (BDD)
ENGG3190 Logic Synthesis “Binary Decision Diagrams” BDDs Winter 2014 S. Areibi School of Engineering University of Guelph.
ECE 667 Synthesis and Verification of Digital Systems
IT University of Copenhagen Lecture 8: Binary Decision Diagrams 1. Classical Boolean expression representations 2. If-then-else Normal Form (INF) 3. Binary.
1 ROBDD’s represents a logic function by a graph (DAG). (many logic functions can be represented compactly - usually better than SOP’s)represents a logic.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization I.
1 Binary Recursion Tree The recursive Shannon expansion corresponds to a binary recursion tree Example: Path  (v) to node v corresponds to cube c  (v)
Indexing. Goals: Store large files Support multiple search keys Support efficient insert, delete, and range queries.
ECOE 560 Design Methodologies and Tools for Software/Hardware Systems Spring 2006 Serdar Taşıran.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: BDD BDDs applied in equivalence checking.
B-Tree. B-Trees a specialized multi-way tree designed especially for use on disk In a B-tree each node may contain a large number of keys. The number.
Advanced Algorithms Analysis and Design Lecture 8 (Continue Lecture 7…..) Elementry Data Structures By Engr Huma Ayub Vine.
B. Alizadeh Advanced Logic Design (2008) 1 / 55 Decision Diagrams.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Binary Decision Diagrams.
Identifying Reversible Functions From an ROBDD Adam MacDonald.
Truth Table-Based Testing Generating test cases when the test model is a truth table Reading: Binder Chapter 6.
Binary Decision Diagrams (BDDs)
November,2000University of Southern California1 Introduction to Binary Decision Diagrams - Shesha Shayee K. Raghunathan.
Model Checking Lecture 4 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
ECE Synthesis & Verification - Lecture 11 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Binary.
Multiway Trees. Trees with possibly more than two branches at each node are know as Multiway trees. 1. Orchards, Trees, and Binary Trees 2. Lexicographic.
COE 561 Digital System Design & Synthesis Logic Synthesis Background Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum.
CS 267: Automated Verification Lecture 6: Binary Decision Diagrams Instructor: Tevfik Bultan.
The Volcano Query Optimization Framework S. Sudarshan (based on description in Prasan Roy’s thesis Chapter 2)
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Starting at Binary Trees
Notes on Sequence Binary Decision Diagrams: Relationship to Acyclic Automata and Complexities of Binary Set Operations Shuhei Denzumi1, Ryo Yoshinaka2,
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
3.1. Binary Search Trees   . Ordered Dictionaries Keys are assumed to come from a total order. Old operations: insert, delete, find, …
Binary-Decision-Diagram (BDD) Application on Pass-Transistor Logic Design Tao Lin School of EECS, Ohio University March 12, 1998.
Binary decision diagrams (BDD’s) Compact representation of a logic function ROBDD’s (reduced ordered BDD’s) are a canonical representation: equivalence.
LIMITATIONS OF ALGORITHM POWER
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
IT 60101: Lecture #121 Foundation of Computing Systems Lecture 13 Trees: Part VIII.
How CTL model checking works
Binary Decision Diagrams
Binary Decision Diagrams
Binary Decision Diagrams
A logic function f in n inputs x1, x2, ...xn and
Binary Decision Diagrams
Example: Verification
A logic function f in n inputs x1, x2, ...xn and
Presentation transcript:

BDDs1 Binary Tree Representation The recursive Shannon expansion corresponds to a binary tree Example: Each path from the root to a leaf corresponds to a minterm x y y

BDDs2 The root represents the original function f. The root represents the original function f. The two nodes immediately below the root represent the co-factors of f. The two nodes immediately below the root represent the co-factors of f. As you go deeper, each node represents a co-factor of the function represented by its parent. As you go deeper, each node represents a co-factor of the function represented by its parent. The leaves are the terminal cases representing 0 and 1 which have no co-factors. The leaves are the terminal cases representing 0 and 1 which have no co-factors.

BDDs3 Example a c b a bb cc Splitting variable

BDDs4 Implicit Enumeration - Branch and Bound Checking for tautology and many other theoretically intractable problems (co-NP complete) can be effectively solved using implicit enumeration: Checking for tautology and many other theoretically intractable problems (co-NP complete) can be effectively solved using implicit enumeration: use recursive Shannon expansion to explore B n. use recursive Shannon expansion to explore B n. In (hopefully) large subspaces of B n, prune the binary recursion tree by In (hopefully) large subspaces of B n, prune the binary recursion tree by exploiting properties of the node function f c  (v) exploiting properties of the node function f c  (v) exploiting heuristic bounding techniques exploiting heuristic bounding techniques Even though in the worst case the recursion tree may have 2 n nodes, in practice (in many cases), we typically encounter a linear number of nodes. Even though in the worst case the recursion tree may have 2 n nodes, in practice (in many cases), we typically encounter a linear number of nodes.

BDDs5 Implicit Enumeration - Branch and Bound Thus we say that the 2 n minterms of f have been implicitly enumerated Thus we say that the 2 n minterms of f have been implicitly enumerated BDD’s (Binary Decision Diagrams) are alternate representations in which implicit enumeration is performed statically, and nodes with identical path cofactors are identified BDD’s (Binary Decision Diagrams) are alternate representations in which implicit enumeration is performed statically, and nodes with identical path cofactors are identified

BDDs6 ROBDDs represents a logic function by a directed acyclic graph (DAG). (many logic functions can be represented compactly - usually better than SOP’s) represents a logic function by a directed acyclic graph (DAG). (many logic functions can be represented compactly - usually better than SOP’s) canonical form (important) (only canonical if an ordering of the variables is given) canonical form (important) (only canonical if an ordering of the variables is given) many logic operations can be performed efficiently on BDD’s (usually linear in size of result - tautology and complement are constant time) many logic operations can be performed efficiently on BDD’s (usually linear in size of result - tautology and complement are constant time) size of ROBDD critically dependent on variable ordering size of ROBDD critically dependent on variable ordering

BDDs7 ROBDDs one root node per function, two terminals 0, 1 each node, two children, and a variable Shannon co-factoring tree, except reduced and ordered (ROBDD) Reduced: any node with two identical children is removed two nodes with isomorphic BDD’s are merged Ordered: Co-factoring variables (splitting variables) always follow the same order from a root to a terminal x i 1 < x i 2 < x i 3 < … < x i n

BDDs8 OBDD Ordered BDD (OBDD) Input variables are ordered - each path from root to sink visits nodes with labels (variables) in ascending order. a cc b 0 1 ordered order = a,c,b a b c c 0 1 notordered b

BDDs9 ROBDD Reduced Ordered BDD - reduction rules: Reduced Ordered BDD - reduction rules: if the two children of a node are the same, the node is eliminated: f = cf + c’f if the two children of a node are the same, the node is eliminated: f = cf + c’f if two nodes have isomorphic graphs, they are replaced by one of them if two nodes have isomorphic graphs, they are replaced by one of them These two rules added to ordering mean each node represents a distinct logic function. These two rules added to ordering mean each node represents a distinct logic function.

BDDs10 By tracing paths to the 1 node, we get a cover of pairwise disjoint cubes. By tracing paths to the 1 node, we get a cover of pairwise disjoint cubes. The power of the BDD representation is that it does not explicitly enumerate all paths; rather it represents paths by a graph whose size is measures by its nodes and not paths. A DAG can represent an exponential number of paths with a linear number of nodes. A DAG can represent an exponential number of paths with a linear number of nodes. F = b’+a’c’ = ab’+a’cb’+a’c’ (all paths to the 1 node) a c b f f a = b’ f a = cb’+c’

BDDs11 Examples a b c d a b c d 01

BDDs12 EXOR a b c d 01 d c b a  b  c  d = a’b’c’d + a’b’cd’ + a’bc’d’ + ab’c’d’ + a’bcd + ab’cd + abc’d + abcd’ Terms in SOP = ??? Nodes in BDD = ???

BDDs13 The Ordering Effect Two different orderings, same function. a bb cc d 0 1 c+bd b rootnode c+d c d f = ab+a’c+bc’d a c d b 01 c+bd d+b b 1 0

BDDs14 Example f = ad + be + cf There are n! orderings – in this example 6! = 720 Try orderings: a,b,c,d,e,fa,d,b,e,c,f

BDDs15 Theorem Theorem 1 (Bryant – 1986 posted on course page) ROBDD’s are canonical Thus two functions are the same iff their ROBDD’s are equivalent graphs (isomorphic). Of course must use same order for variables.

BDDs16 Implementation Each node is a triple (v,g 0,g 1 ) representing a function Each node is a triple (v,g 0,g 1 ) representing a function g = v g 0 + v g 1 In most implementations, g 0 and g 1 are pointers to other nodes. In most implementations, g 0 and g 1 are pointers to other nodes.

BDDs17 ITE Operator TableSubset Expression Equivalent Form AND(f, g) fgite(f, g, 0) 0010f > g f  gite(f,  g, 0) 0011f ff 0100f < g  fgite(f, 0, g) 0101g gg 0110XOR(f, g) f  gite(f,  g, g) 0111OR(f, g) f + gite(f, 1, g) 1000NOR(f, g) f + gite(f, 0,  g) 1001 XNOR(f, g) f  gite(f, g,  g) 1010NOT(g)  gite(g, 0, 1) 1011f  g f +  gite(f, 1,  g) 1100NOT(f)  fite(f, 0, 1) 1101f  g  f + gite(f, g, 1) 1110NAND(f, g) fgite(f,  g, 1)

BDDs18 Efficient Implementation Strong canonical form: A “unique-id” is associated (through a hash table) uniquely with each element in a set. With BDD’s the set is the set of all logic functions. A BDD node is a function. Thus each function has a unique-id in memory. What is a good hash function? v 0 1 f fvfvfvfv fvfvfvfv

BDDs19 Unique Table - Hash Table Before a node (v, g, h ) is added to BDD data base, it is looked up in the “unique-table”. If it is there, then existing pointer to node is used to represent the logic function. Otherwise, a new node is added to the unique- table and the new pointer returned. Thus a strong canonical form is maintained. The node for f = (v, g, h ) exists iff(v, g, h ) is in the unique-table. There is only one pointer for (v, g, h ) and that is the address to the unique-table entry. Unique-table allows single multi-rooted DAG to represent all users’ functions: hash value of key collisionchain

BDDs20 Recursive Formulation of ITE v = top-most variable among the three BDD’s f, g, h

BDDs21 Recursive Formulation of ITE ite(f, g, h) ite(f, g, h) if(terminal case) { return result; return result; } else if(computed-table has entry (f, g, h )) { return result; return result; } else { let v be the top variable of (f, g, h ); let v be the top variable of (f, g, h ); f <- ite(f v, g v, h v ); f <- ite(f v, g v, h v ); g <- ite (f  v, g  v, h  v ); g <- ite (f  v, g  v, h  v ); if( f equals g ) return g; if( f equals g ) return g; R <- find_or_add_unique_table(v, f, g ); R <- find_or_add_unique_table(v, f, g ); insert_computed_table( {f, g, h }, R); insert_computed_table( {f, g, h }, R); return R; } } return R; } }

BDDs22 Terminal cases: Terminal cases: (0, f, g) = g (0, f, g) = g (1, f, g) = f (1, f, g) = f ite (f, g, g) = g ite (f, g, g) = g Unique table: Used to ensure one physical representation for any given function. Unique table: Used to ensure one physical representation for any given function. Computed table: Used to cache results to avoid recomputation. Computed table: Used to cache results to avoid recomputation.

BDDs23 Example I= ite (F, G, H) = (a, ite (F a, G a, H a ), ite (F  a, G  a, H  a )) = (a, ite (1, C, H ), ite(B, 0, H )) = (a, C, (b, ite (B b, 0 b, H b ), ite (B  b, 0  b, H  b )) = (a, C, (b, ite (1, 0, 1), ite (0, 0, D))) = (a, C, (b, 0, D)) = (a, C, J) F,G,H,I,J,B,C,D are pointers b 1 1 a F B 1 1 a G c 0 C 1 b H d D a I b J 1 C D

BDDs24 Computed Table Keep a record of (F, G, H ) triplets already computed by the ite operator in a hash-based cache ( “cache” table). This means that the collision chain is not used (if collision, old entry thrown away ). The above structure is wasteful since the BDD nodes and collision chain can be merged.

BDDs25 Better Implementation

BDDs26 Edge Complementation Can combine by making complement edges 01 G 01 two different DAGs 01 G G’ only one DAG using complement pointer G’

BDDs27 Extension - Complement Edges To maintain the strong canonical form, we need to resolve 4 equivalences: VV VV V V VV Solution: Always choose the one on the left, i.e. the “1” edge must not have a complement.

BDDs28 EXOR (revisited) a b c d 01 d c b a b c d 1