unit-11: binary decision diagrams (bdds)sri/courses/mc2015/slides/... · in this unit: an...

81
Unit-11: Binary Decision Diagrams (BDDs) B. Srivathsan Chennai Mathematical Institute NPTEL-course July - November 2015 1/24

Upload: others

Post on 03-Aug-2020

2 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Unit-11: Binary Decision Diagrams (BDDs)

B. Srivathsan

Chennai Mathematical Institute

NPTEL-course

July - November 2015

1/24

Page 2: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Module 1:Introduction to BDDs

2/24

Page 3: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Model-checking

Transition Systems

+ Properties

+NuSMV

Automata

Unit: 4

BüchiAutomata

Unit: 5,6

LTL

properties

Unit: 7,8

CTL

properties

Unit: 9

State-spaceexplosion

Unit: 10

3/24

Page 4: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

In this unit: An efficient data structure for representing transitionsystems

É Module 1: Introduction to the data structure: Binary DecisionDiagrams (BDDs)

É Module 2: Operations on BDDs

É Module 3: Using BDDs in the model-checking process

Reference: Logic in Computer Science, 2nd edition, by Huth and Ryan,Section 6.1 - 6.3

4/24

Page 5: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

In this unit: An efficient data structure for representing transitionsystems

É Module 1: Introduction to the data structure: Binary DecisionDiagrams (BDDs)

É Module 2: Operations on BDDs

É Module 3: Using BDDs in the model-checking process

Reference: Logic in Computer Science, 2nd edition, by Huth and Ryan,Section 6.1 - 6.3

4/24

Page 6: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Boolean functions

5/24

Page 7: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x+ y

0+ 0 = 00+ 1 = 11+ 0 = 11+ 1 = 1

Logical OR

0 0 0

0 1 1

1 0 1

1 1 1

x y f (x,y)

Truth table

6/24

Page 8: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x+ y

0+ 0 = 00+ 1 = 11+ 0 = 11+ 1 = 1

Logical OR

0 0 0

0 1 1

1 0 1

1 1 1

x y f (x,y)

Truth table

6/24

Page 9: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x+ y

0+ 0 = 00+ 1 = 11+ 0 = 11+ 1 = 1

Logical OR

0 0 0

0 1 1

1 0 1

1 1 1

x y f (x,y)

Truth table

6/24

Page 10: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x+ y

0+ 0 = 00+ 1 = 11+ 0 = 11+ 1 = 1

Logical OR

0 0 0

0 1 1

1 0 1

1 1 1

x y f (x,y)

Truth table

6/24

Page 11: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x+ y

0+ 0 = 00+ 1 = 11+ 0 = 11+ 1 = 1

Logical OR

0 0 0

0 1 1

1 0 1

1 1 1

x y f (x,y)

Truth table

6/24

Page 12: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x · y

0 · 0 = 00 · 1 = 01 · 0 = 01 · 1 = 1

Logical AND

0 0 0

0 1 0

1 0 0

1 1 1

x y f (x,y)

Truth table

7/24

Page 13: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x · y

0 · 0 = 00 · 1 = 01 · 0 = 01 · 1 = 1

Logical AND

0 0 0

0 1 0

1 0 0

1 1 1

x y f (x,y)

Truth table

7/24

Page 14: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x · y

0 · 0 = 00 · 1 = 01 · 0 = 01 · 1 = 1

Logical AND

0 0 0

0 1 0

1 0 0

1 1 1

x y f (x,y)

Truth table

7/24

Page 15: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x · y

0 · 0 = 00 · 1 = 01 · 0 = 01 · 1 = 1

Logical AND

0 0 0

0 1 0

1 0 0

1 1 1

x y f (x,y)

Truth table

7/24

Page 16: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x,y : Boolean variables

Boolean functionf (x,y) = x · y

0 · 0 = 00 · 1 = 01 · 0 = 01 · 1 = 1

Logical AND

0 0 0

0 1 0

1 0 0

1 1 1

x y f (x,y)

Truth table

7/24

Page 17: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x : Boolean variable

Boolean functionf (x) = x

0 = 11 = 0

Logical NOT

0 1

1 0

x f (x)

Truth table

8/24

Page 18: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x : Boolean variable

Boolean functionf (x) = x

0 = 11 = 0

Logical NOT

0 1

1 0

x f (x)

Truth table

8/24

Page 19: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x : Boolean variable

Boolean functionf (x) = x

0 = 11 = 0

Logical NOT

0 1

1 0

x f (x)

Truth table

8/24

Page 20: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x : Boolean variable

Boolean functionf (x) = x

0 = 11 = 0

Logical NOT

0 1

1 0

x f (x)

Truth table

8/24

Page 21: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x : Boolean variable

Boolean functionf (x) = x

0 = 11 = 0

Logical NOT

0 1

1 0

x f (x)

Truth table

8/24

Page 22: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x1,x2, . . . ,xn: Boolean variables

f : {x1,x2, . . . ,xn} 7→ {0,1} Boolean function

+ · Boolean operations

Examples: f1(x,y) = x+ y, f2(x,y,z) = x · y+ y · z, f3(x,y,z) = x+ y · z

9/24

Page 23: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x1,x2, . . . ,xn: Boolean variables

f : {x1,x2, . . . ,xn} 7→ {0,1} Boolean function

+ · Boolean operations

Examples: f1(x,y) = x+ y, f2(x,y,z) = x · y+ y · z, f3(x,y,z) = x+ y · z

9/24

Page 24: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Representing boolean functions

10/24

Page 25: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x

y y

z z z z

0 1 0 0 0 1 1 1

Truth table

Binary Decision Tree

11/24

Page 26: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x

y y

z z z z

0 1 0 0 0 1 1 1

Truth table

Binary Decision Tree

11/24

Page 27: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x

y y

z z z z

0 1 0 0 0 1 1 1

Truth table Binary Decision Tree

11/24

Page 28: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Operations on truth tables

12/24

Page 29: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0

1

0 0 1

0

0 1 0

1

0 1 1

1

1 0 0

1

1 0 1

0

1 1 0

0

1 1 1

0

13/24

Page 30: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0

1

0 0 1

0

0 1 0

1

0 1 1

1

1 0 0

1

1 0 1

0

1 1 0

0

1 1 1

0

13/24

Page 31: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1

0

0 1 0

1

0 1 1

1

1 0 0

1

1 0 1

0

1 1 0

0

1 1 1

0

13/24

Page 32: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 0

0 1 0

1

0 1 1

1

1 0 0

1

1 0 1

0

1 1 0

0

1 1 1

0

13/24

Page 33: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1

1

1 0 0

1

1 0 1

0

1 1 0

0

1 1 1

0

13/24

Page 34: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0

1

1 0 1

0

1 1 0

0

1 1 1

0

13/24

Page 35: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 1

1 0 1

0

1 1 0

0

1 1 1

0

13/24

Page 36: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0

0

1 1 1

0

13/24

Page 37: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1

0

13/24

Page 38: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

g(x,y,z) = f (x,y,z) = x · y+ y · z

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1 0

13/24

Page 39: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z

h

0 0 0

1

0 0 1

1

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 40: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z

h

0 0 0

1

0 0 1

1

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 41: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z

h

0 0 0

1

0 0 1

1

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 42: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0

1

0 0 1

1

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 43: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0 1

0 0 1

1

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 44: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0 1

0 0 1 1

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 45: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0 1

0 0 1 1

0 1 0 0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 46: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 47: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1

1

1 1 0

1

1 1 1

1

14/24

Page 48: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0

1

1 1 1

1

14/24

Page 49: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1

1

14/24

Page 50: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0

f (x,y,z) = x · y+ y · zg(x,y,z) = x · y

h(x,y,z) = f (x,y,z)+ g(x,y,z)

x y z h0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

14/24

Page 51: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z

h

0 0 0

0

0 0 1

0

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 52: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z

h

0 0 0

0

0 0 1

0

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 53: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z

h

0 0 0

0

0 0 1

0

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 54: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0

0

0 0 1

0

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 55: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0 0

0 0 1

0

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 56: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0 0

0 0 1 0

0 1 0

0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 57: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0 0

0 0 1 0

0 1 0 0

0 1 1

0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 58: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0

0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 59: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1

1

1 1 0

1

1 1 1

1

15/24

Page 60: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0

1

1 1 1

1

15/24

Page 61: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1

1

15/24

Page 62: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x y z f

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

x y z g

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

f (x,y,z) = x · y+ y · zg(x,y,z) = x

h(x,y,z) = f (x,y,z) · g(x,y,z)

x y z h0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

15/24

Page 63: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Truth table representation for booleanfunctions

É Space: For n variables, needs to store 2n · (n+ 1) bits

É Operations: Visit each entry of truth table

É Sequential circuits can be modeled using boolean functions

If boolean functions are represented using truth tables, a circuit with100 variables needs more than 2100 bits!

16/24

Page 64: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Truth table representation for booleanfunctions

É Space: For n variables, needs to store 2n · (n+ 1) bits

É Operations: Visit each entry of truth table

É Sequential circuits can be modeled using boolean functions

If boolean functions are represented using truth tables, a circuit with100 variables needs more than 2100 bits!

16/24

Page 65: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Truth table representation for booleanfunctions

É Space: For n variables, needs to store 2n · (n+ 1) bits

É Operations: Visit each entry of truth table

É Sequential circuits can be modeled using boolean functions

If boolean functions are represented using truth tables, a circuit with100 variables needs more than 2100 bits!

16/24

Page 66: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Coming next: Efficient representation for Boolean formulas

17/24

Page 67: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

18/24

Page 68: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

18/24

Page 69: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

18/24

Page 70: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

18/24

Page 71: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

18/24

Page 72: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

19/24

Page 73: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

19/24

Page 74: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

19/24

Page 75: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

19/24

Page 76: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Binary Decision Diagramsx

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

5/5

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

5/5

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

4/5

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

4/5

Reduced BDDs

20/24

Page 77: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Binary Decision Diagramsx

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

5/5

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

5/5

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

4/5

x · yx

y y

1 0 0 0

x

y y

1 0

unnecessary

x

y

1 0

Binary Decision Diagram

4/5

Reduced BDDs

20/24

Page 78: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Reduction rules for BDDs

É C1: Removal of duplicate leaves

É C2: Removal of redundant tests

É C3: Removal of duplicate sub-trees

21/24

Page 79: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 1

x

y y

z z

0 1

x

y y

z

0 1

C1

C2

C3

22/24

Page 80: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

x · yx

y y

1 0 0 0

x

y y

1 0

x

y

1 0

C1

C2

23/24

Page 81: Unit-11: Binary Decision Diagrams (BDDs)sri/Courses/MC2015/Slides/... · In this unit: An efficient data structure for representing transition systems É Module 1: Introduction to

Representing boolean functions

BDDs

Reduced BDDs

24/24