Binary Decision Diagrams Part 1
description
Transcript of Binary Decision Diagrams Part 1
![Page 1: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/1.jpg)
© 2011 Carnegie Mellon University
Binary Decision Diagrams Part 1
15-414 Bug Catching: Automated Program Verification and Testing
Sagar ChakiSeptember 12, 2011
![Page 2: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/2.jpg)
2Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
BDDs in a nutshell
Typically mean Reduced Ordered Binary Decision Diagrams (ROBDDs)
Canonical representation of Boolean formulas
Often substantially more compact than a traditional normal form
Can be manipulated very efficiently• Conjunction, Disjunction, Negation, Existential Quantification
R. E. Bryant. Graph-based algorithms for boolean function manipulation. IEEE Transactions on Computers, C-35(8), 1986.
![Page 3: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/3.jpg)
3Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Running Example: Comparator
Comparator
a1 a2 b1 b2
f = 1 , a1 = b1 Æ a2 = b2
![Page 4: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/4.jpg)
4Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Conjunctive Normal Form
(: a1 Ç b1 ) Æ (: b1 Ç a1) Æ (: a2 Ç b2 ) Æ (: b2 Ç a2)
a1 = b1 Æ a2 = b2
a1 ) b1 Æ b1 ) a1 Æ a2 ) b2 Æ b2 ) a2
(: b1 Ç a1 ) Æ (: a1 Ç b1) Æ (: a2 Ç b2 ) Æ (: b2 Ç a2)
Not Canonical
f
![Page 5: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/5.jpg)
5Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Truth Table (1)a1 b1 a2 b2 f
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
Still Not Canonical
![Page 6: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/6.jpg)
6Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Truth Table (2)a1 a2 b1 b2 f
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 1
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
Canonical if you fix variable order.
But always exponential in # of variables. Let’s try to fix this.
![Page 7: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/7.jpg)
7Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Representing a Truth Table using a Graph
a1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0 0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
0
0
0
0 1
1
10
Binary Decision Tree (in this case ordered)
![Page 8: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/8.jpg)
8Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Binary Decision Tree: Formal Definition
Balanced binary tree. Length of each path = # of variables
Leaf nodes labeled with either 0 or 1
Internal node v labeled with a Boolean variable var(v)• Every node on a path labeled with a different variable
Internal node v has two children: low(v) and high(v)
Each path corresponds to a (partial) truth assignment to variables• Assign 0 to var(v) if low(v) is in the path, and 1 if high(v) is in the path
Value of a leaf is determined by:• Constructing the truth assignment for the path leading to it from the root• Looking up the truth table with this truth assignment
![Page 9: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/9.jpg)
9Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Binary Decision Tree
a1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0 0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
0
0
0
0 1
1
10
v
low(v)high(v)
var(v) = a1
![Page 10: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/10.jpg)
10Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Binary Decision Tree
a1
b1
a2
b2
0
0
1
0
The truth assignment corresponding to the path to this leaf is:a1 = ? b1 = ? a2 = ? b2 = ?
![Page 11: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/11.jpg)
11Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Binary Decision Tree
a1
b1
a2
b2
0
0
1
0
The truth assignment corresponding to the path to this leaf is:a1 = 0 b1 = 0 a2 = 1 b2 = 0
a1 b1 a2 b2 f
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
![Page 12: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/12.jpg)
12Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Binary Decision Tree
a1
b1
a2
b2
0
0
1
0
The truth assignment corresponding to the path to this leaf is:a1 = 0 b1 = 0 a2 = 1 b2 = 0
a1 b1 a2 b2 f
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
![Page 13: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/13.jpg)
13Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Binary Decision Tree
a1
b1
a2
b2
0
0
0
1
0
The truth assignment corresponding to the path to this leaf is:a1 = 0 b1 = 0 a2 = 1 b2 = 0
a1 b1 a2 b2 f
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
![Page 14: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/14.jpg)
14Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Binary Decision Tree (BDT)
a1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0 0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
0
0
0
0 1
1
10
Canonical if you fix variable order (i.e., use ordered BDT)
But still exponential in # of variables. Let’s try to fix this.
![Page 15: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/15.jpg)
15Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Reduced Ordered BDD
Conceptually, a ROBDD is obtained from an ordered BDT (OBDT) by eliminating redundant sub-diagrams and nodes
Start with OBDT and repeatedly apply the following two operations as long as possible:
1. Eliminate duplicate sub-diagrams. Keep a single copy. Redirect edges into the eliminated duplicates into this single copy.
2. Eliminate redundant nodes. Whenever low(v) = high(v), remove v and redirect edges into v to low(v).
• Why does this terminate?
ROBDD is often exponentially smaller than the corresponding OBDT
![Page 16: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/16.jpg)
16Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0 0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
![Page 17: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/17.jpg)
17Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0 0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
Duplicate sub-diagram
![Page 18: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/18.jpg)
18Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
![Page 19: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/19.jpg)
19Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
![Page 20: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/20.jpg)
20Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
![Page 21: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/21.jpg)
21Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0 0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
![Page 22: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/22.jpg)
22Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1 0 0 1
b2 b2
0
a2 a2
b2 b2
0 0 0 0
b2 b2
1 0 0 1
![Page 23: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/23.jpg)
23Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1
b2 b2
0
a2 a2
b2 b2 b2 b2
![Page 24: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/24.jpg)
24Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1
b2 b2
0
a2 a2
b2 b2 b2 b2
Redundant node
![Page 25: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/25.jpg)
25Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1
b2
0
a2 a2
b2 b2 b2 b2
![Page 26: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/26.jpg)
26Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
1
b2
0
a2 a2
b2 b2 b2 b2
![Page 27: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/27.jpg)
27Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
10
a2 a2
b2 b2 b2 b2
![Page 28: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/28.jpg)
28Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2 a2
b2 b2
10
a2 a2
b2 b2 b2 b2
![Page 29: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/29.jpg)
29Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2
b2 b2
10
a2 a2
b2 b2 b2 b2
If a1 = 0 and b1 = 1 then f = 0 irrespective of the values of a2
and b2
![Page 30: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/30.jpg)
30Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2
b2 b2
10
a2
b2 b2
![Page 31: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/31.jpg)
31Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2
b2 b2
10
a2
b2 b2
![Page 32: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/32.jpg)
32Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2
b2
10
a2
b2 b2
![Page 33: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/33.jpg)
33Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2
b2
10
a2
b2 b2
![Page 34: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/34.jpg)
34Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2
b2
10
a2
b2
![Page 35: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/35.jpg)
35Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
a2
b2
10
a2
b2
![Page 36: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/36.jpg)
36Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
b2
10
a2
b2
Let’s move things around a little bit so that the BDD looks
nicer.
![Page 37: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/37.jpg)
37Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
OBDT to ROBDDa1
b1 b1
b2
10
a2
b2
Bryant gave a linear-time algorithm (called Reduce) to convert OBDT to ROBDD.
In practice, BDD packages don’t use Reduce directly. They apply the two reductions on-the-fly as new BDDs are constructed from existing ones. Why?
![Page 38: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/38.jpg)
38Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD (a.k.a. BDD) Summary
BDDs are canonical representations of Boolean formulas• f1 = f2 , ?
![Page 39: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/39.jpg)
39Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD (a.k.a. BDD) Summary
BDDs are canonical representations of Boolean formulas• f1 = f2 , BDD(f1) and BDD(f2) are isomorphic• f is unsatisfiable , ?
![Page 40: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/40.jpg)
40Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD (a.k.a. BDD) Summary
BDDs are canonical representations of Boolean formulas• f1 = f2 , BDD(f1) and BDD(f2) are isomorphic• f is unsatisfiable , BDD(f) is the leaf node “0”• f is valid , ?
![Page 41: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/41.jpg)
41Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD (a.k.a. BDD) Summary
BDDs are canonical representations of Boolean formulas• f1 = f2 , BDD(f1) and BDD(f2) are isomorphic• f is unsatisfiable , BDD(f) is the leaf node “0”• f is valid , BDD(f) is the leaf node “1”• BDD packages do these operations in constant time
Logical operations can be performed efficiently on BDDs• Polynomial in argument size• More details in next lecture
BDD size depends critically on the variable ordering• Some formulas have exponentially large sizes for all ordering• Others are polynomial for some ordering and exponential for others
![Page 42: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/42.jpg)
42Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
a2 a2
b1 b1
b2 b2
1 0 0 0
b2 b2
0 1 0 0
b1 b1
b2 b2
0 0 1 0
b2 b2
0 0 0 1
![Page 43: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/43.jpg)
43Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
a2 a2
b1 b1
b2 b2 b2 b2
1 0
b1 b1
b2 b2 b2 b2
![Page 44: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/44.jpg)
44Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
a2 a2
b1 b1
b2 b2
1 0
b1 b1
b2 b2
![Page 45: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/45.jpg)
45Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
a2 a2
b1 b1
b2 b2
1 0
b1 b1
b2 b2
![Page 46: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/46.jpg)
46Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
a2 a2
b1 b1
b2
1 0
b1 b1
b2 b2
![Page 47: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/47.jpg)
47Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
a2 a2
b1 b1
b2
1 0
b1 b1
b2 b2
![Page 48: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/48.jpg)
48Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
a2 a2
b1 b1
b2
1 0
b1 b1
b2
Let’s move things around a little bit so that the BDD looks
nicer.
![Page 49: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/49.jpg)
49Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
a2 a2
b1 b1
b2
1 0
b1 b1
b2
a1
b1 b1
b2
10
a2
b2
11 nodes8 nodes
a1 < a2 < b1 < b2a1 < b1 < a2 < b2
![Page 50: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/50.jpg)
50Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
an an
b1 b1
bn
1 0
b1 b1
bn
a1
b1 b1
bn
10
an
bn
? £ 2n – 1 nodes
? £ n + 2 nodes
a1 < … < an < b1 < … < bna1 < b1 < … < an < bn
![Page 51: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/51.jpg)
51Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
ROBDD and variable orderinga1
an an
b1 b1
bn
1 0
b1 b1
bn
a1
b1 b1
bn
10
an
bn
3 £ 2n – 1 nodes
3 £ n + 2 nodes
a1 < … < an < b1 < … < bna1 < b1 < … < an < bn
![Page 52: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/52.jpg)
52Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Next Class
BDD recap
BDD operations
BDD applications
Next homework
See you then …
![Page 53: Binary Decision Diagrams Part 1](https://reader033.fdocuments.us/reader033/viewer/2022061617/56816122550346895dd07a16/html5/thumbnails/53.jpg)
53Binary Decision Diagrams – Part 1Sagar Chaki, Sep 12, 2011© 2011 Carnegie Mellon University
Questions?
Sagar ChakiSenior Member of Technical StaffRTSS ProgramTelephone: +1 412-268-1436Email: [email protected]
U.S. MailSoftware Engineering InstituteCustomer Relations4500 Fifth AvenuePittsburgh, PA 15213-2612USA
Webwww.sei.cmu.edu/staff/chaki
Customer RelationsEmail: [email protected]: +1 412-268-5800SEI Phone: +1 412-268-5800SEI Fax: +1 412-268-6257