Unit-11: Binary Decision Diagrams (BDDs) B. Srivathsan Chennai - - PowerPoint PPT Presentation

unit 11 binary decision diagrams bdds
SMART_READER_LITE
LIVE PREVIEW

Unit-11: Binary Decision Diagrams (BDDs) B. Srivathsan Chennai - - PowerPoint PPT Presentation

Unit-11: Binary Decision Diagrams (BDDs) B. Srivathsan Chennai Mathematical Institute NPTEL-course July - November 2015 1 / 24 Module 1: Introduction to BDDs 2 / 24 Model-checking Transition Systems + Properties + NuSMV State-space Bchi


slide-1
SLIDE 1

Unit-11: Binary Decision Diagrams (BDDs)

  • B. Srivathsan

Chennai Mathematical Institute

NPTEL-course July - November 2015

1/24

slide-2
SLIDE 2

Module 1: Introduction to BDDs

2/24

slide-3
SLIDE 3

Model-checking

Transition Systems + Properties + NuSMV

Automata

Unit: 4

Büchi Automata

Unit: 5,6

LTL properties

Unit: 7,8

CTL properties

Unit: 9

State-space explosion

Unit: 10

3/24

slide-4
SLIDE 4

In this unit: An efficient data structure for representing transition systems

◮ Module 1: Introduction to the data structure: Binary Decision

Diagrams (BDDs)

◮ Module 2: Operations on BDDs ◮ Module 3: Using BDDs in the model-checking process

4/24

slide-5
SLIDE 5

In this unit: An efficient data structure for representing transition systems

◮ Module 1: Introduction to the data structure: Binary Decision

Diagrams (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

slide-6
SLIDE 6

Boolean functions

5/24

slide-7
SLIDE 7

x,y : Boolean variables

6/24

slide-8
SLIDE 8

x,y : Boolean variables Boolean function f (x,y) = x + y

6/24

slide-9
SLIDE 9

x,y : Boolean variables Boolean function f (x,y) = x + y 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 1

6/24

slide-10
SLIDE 10

x,y : Boolean variables Boolean function f (x,y) = x + y 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 1 Logical OR

6/24

slide-11
SLIDE 11

x,y : Boolean variables Boolean function f (x,y) = x + y 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 1 Logical OR

1 1 1 1 1 1 1 x y f (x,y)

Truth table

6/24

slide-12
SLIDE 12

x,y : Boolean variables

7/24

slide-13
SLIDE 13

x,y : Boolean variables Boolean function f (x,y) = x · y

7/24

slide-14
SLIDE 14

x,y : Boolean variables Boolean function f (x,y) = x · y 0 · 0 = 0 0 · 1 = 0 1 · 0 = 0 1 · 1 = 1

7/24

slide-15
SLIDE 15

x,y : Boolean variables Boolean function f (x,y) = x · y 0 · 0 = 0 0 · 1 = 0 1 · 0 = 0 1 · 1 = 1 Logical AND

7/24

slide-16
SLIDE 16

x,y : Boolean variables Boolean function f (x,y) = x · y 0 · 0 = 0 0 · 1 = 0 1 · 0 = 0 1 · 1 = 1 Logical AND

1 1 1 1 1 x y f (x,y)

Truth table

7/24

slide-17
SLIDE 17

x : Boolean variable

8/24

slide-18
SLIDE 18

x : Boolean variable Boolean function f (x) = x

8/24

slide-19
SLIDE 19

x : Boolean variable Boolean function f (x) = x 0 = 1 1 = 0

8/24

slide-20
SLIDE 20

x : Boolean variable Boolean function f (x) = x 0 = 1 1 = 0 Logical NOT

8/24

slide-21
SLIDE 21

x : Boolean variable Boolean function f (x) = x 0 = 1 1 = 0 Logical NOT

1 1 x f (x)

Truth table

8/24

slide-22
SLIDE 22

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

+

· Boolean operations

9/24

slide-23
SLIDE 23

x1,x2,...,xn: Boolean variables f : {x1,x2,...,xn} → {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

slide-24
SLIDE 24

Representing boolean functions

10/24

slide-25
SLIDE 25

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Truth table

11/24

slide-26
SLIDE 26

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y y z z z z 1 1 1 1

Truth table

11/24

slide-27
SLIDE 27

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y y z z z z 1 1 1 1

Truth table Binary Decision Tree

11/24

slide-28
SLIDE 28

Operations on truth tables

12/24

slide-29
SLIDE 29

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-30
SLIDE 30

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-31
SLIDE 31

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-32
SLIDE 32

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-33
SLIDE 33

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-34
SLIDE 34

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-35
SLIDE 35

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-36
SLIDE 36

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-37
SLIDE 37

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-38
SLIDE 38

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

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 13/24

slide-39
SLIDE 39

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

14/24

slide-40
SLIDE 40

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

14/24

slide-41
SLIDE 41

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z

1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-42
SLIDE 42

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-43
SLIDE 43

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-44
SLIDE 44

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-45
SLIDE 45

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-46
SLIDE 46

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-47
SLIDE 47

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-48
SLIDE 48

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-49
SLIDE 49

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-50
SLIDE 50

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14/24

slide-51
SLIDE 51

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

15/24

slide-52
SLIDE 52

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

15/24

slide-53
SLIDE 53

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z

1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-54
SLIDE 54

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-55
SLIDE 55

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-56
SLIDE 56

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-57
SLIDE 57

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-58
SLIDE 58

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-59
SLIDE 59

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-60
SLIDE 60

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-61
SLIDE 61

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-62
SLIDE 62

x y z f

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x y z g

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

x y z h

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 15/24

slide-63
SLIDE 63

Truth table representation for boolean functions

◮ Space: For n variables, needs to store 2n · (n + 1) bits ◮ Operations: Visit each entry of truth table

16/24

slide-64
SLIDE 64

Truth table representation for boolean functions

◮ 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

16/24

slide-65
SLIDE 65

Truth table representation for boolean functions

◮ 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 with 100 variables needs more than 2100 bits!

16/24

slide-66
SLIDE 66

Coming next: Efficient representation for Boolean formulas

17/24

slide-67
SLIDE 67

x · y

x y y 1

18/24

slide-68
SLIDE 68

x · y

x y y 1 x y y 1

18/24

slide-69
SLIDE 69

x · y

x y y 1 x y y 1

unnecessary

18/24

slide-70
SLIDE 70

x · y

x y y 1 x y y 1

unnecessary

x y 1

18/24

slide-71
SLIDE 71

x · y

x y y 1 x y y 1

unnecessary

x y 1

Binary Decision Diagram

18/24

slide-72
SLIDE 72

x y y z z z z 1 1 1 1

19/24

slide-73
SLIDE 73

x y y z z z z 1 1 1 1 x y y z z z z 1

19/24

slide-74
SLIDE 74

x y y z z z z 1 1 1 1 x y y z z z z 1 x y y z z 1

19/24

slide-75
SLIDE 75

x y y z z z z 1 1 1 1 x y y z z z z 1 x y y z z 1 x y y z 1

19/24

slide-76
SLIDE 76

Binary Decision Diagrams

x y y z z z z 1 x y y z 1 x y y 1 x y 1

20/24

slide-77
SLIDE 77

Binary Decision Diagrams

x y y z z z z 1 x y y z 1 x y y 1 x y 1

Reduced BDDs

20/24

slide-78
SLIDE 78

Reduction rules for BDDs

◮ C1: Removal of duplicate leaves ◮ C2: Removal of redundant tests ◮ C3: Removal of duplicate sub-trees

21/24

slide-79
SLIDE 79

x y y z z z z 1 1 1 1 x y y z z z z 1 x y y z z 1 x y y z 1

C1 C2 C3

22/24

slide-80
SLIDE 80

x · y

x y y 1 x y y 1 x y 1

C1 C2

23/24

slide-81
SLIDE 81

Representing boolean functions

BDDs Reduced BDDs

24/24