· Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É...

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

Transcript of  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É...

Page 1:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Unit-11: Binary Decision Diagrams (BDDs)

B. Srivathsan

Chennai Mathematical Institute

NPTEL-course

July - November 2015

1/20

Page 2:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Module 2:Ordered BDDs

2/20

Page 3:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

f (x1,x2,x3,x4) =

(

1 if an even number of variables is 10 otherwise

Ordered BDD for f with order [x1,x2,x3,x4]

x1

x2 x2

x3 x3 x3 x3

x4 x4 x4 x4 x4 x4 x4 x4

0 1

3/20

Page 4:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

f (x1,x2,x3,x4) =

(

1 if an even number of variables is 10 otherwise

Ordered BDD for f with order [x1,x2,x3,x4]

x1

x2 x2

x3 x3 x3 x3

x4 x4 x4 x4 x4 x4 x4 x4

0 1

3/20

Page 5:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

f (x1,x2,x3,x4) =

(

1 if an even number of variables is 10 otherwise

Reduced Ordered BDD for f with order [x1,x2,x3,x4]

x1

x2 x2

x3 x3

x4 x4

0 1

4/20

Page 6:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

f (x1,x2,x3,x4) =

(

1 if an even number of variables is 10 otherwise

Ordered BDD for f with order [x3,x1,x4,x2]

x3

x1 x1

x4 x4 x4 x4

x2 x2 x2 x2 x2 x2 x2 x2

0 1

5/20

Page 7:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

f (x1,x2,x3,x4) =

(

1 if an even number of variables is 10 otherwise

Reduced Ordered BDD for f with order [x3,x1,x4,x2]

f is not sensitive

to ordering

x3

x1 x1

x4 x4

x2 x2

0 1

6/20

Page 8:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

f (x1,x2,x3,x4) =

(

1 if an even number of variables is 10 otherwise

Reduced Ordered BDD for f with order [x3,x1,x4,x2]

f is not sensitive

to ordering

x3

x1 x1

x4 x4

x2 x2

0 1

6/20

Page 9:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

g(x1,x2,x3,x4,x5,x6) = (x1 + x2) · (x3 + x4) · (x5 + x6)

Reduced Ordered BDD (ROBDD) for g with order [x1,x2,x3,x4,x5,x6]

x1

x2

x3

x4

x5

x6

0 1

7/20

Page 10:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

g(x1,x2,x3,x4,x5,x6) = (x1 + x2) · (x3 + x4) · (x5 + x6)

ROBDD for g with order [x1,x3,x5,x2,x4,x6]

g is sensitive

to ordering

x1

x3

x5 x5

x2 x2 x2 x2

x3

x5 x5

x4 x4

x6

0 1

8/20

Page 11:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

g(x1,x2,x3,x4,x5,x6) = (x1 + x2) · (x3 + x4) · (x5 + x6)

ROBDD for g with order [x1,x3,x5,x2,x4,x6]

g is sensitive

to ordering

x1

x3

x5 x5

x2 x2 x2 x2

x3

x5 x5

x4 x4

x6

0 1

8/20

Page 12:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Ordered BDDs

É BDDs with a specified ordering of variables

É For a given ordering, the reduced OBDD is unique

É Size of OBDD depends on the chosen ordering

É In practice, heuristics exist to find good orderings

Coming next: Operations on OBDDs

9/20

Page 13:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Ordered BDDs

É BDDs with a specified ordering of variables

É For a given ordering, the reduced OBDD is unique

É Size of OBDD depends on the chosen ordering

É In practice, heuristics exist to find good orderings

Coming next: Operations on OBDDs

9/20

Page 14:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm to reduce an OBDD

10/20

Page 15:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2 #2

#3 #2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 16:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2 #2

#3 #2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 17:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2

#2

#3 #2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 18:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2 #2

#3 #2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 19:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2 #2

#3

#2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 20:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2 #2

#3 #2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 21:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2 #2

#3 #2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 22:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2 #2

#3 #2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 23:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2 x2

x3 x3

0 1 0 1

#0 #1 #0 #1

#2 #2

#3 #2

#4

REDUCE

x1

x2

x3

0 1

#0 #1

#2

#3

#4

11/20

Page 24:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

#0 #1 #0 #0 #0 #1 #1 #1

#2 #0 #2 #1

#5

#3 #4REDUCE

x

y y

z

0 1

12/20

Page 25:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2 #0 #2 #1

#5

#3 #4REDUCE

x

y y

z

0 1

12/20

Page 26:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2

#0 #2 #1

#5

#3 #4REDUCE

x

y y

z

0 1

12/20

Page 27:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2 #0

#2 #1

#5

#3 #4REDUCE

x

y y

z

0 1

12/20

Page 28:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2 #0 #2

#1

#5

#3 #4REDUCE

x

y y

z

0 1

12/20

Page 29:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2 #0 #2 #1

#5

#3 #4REDUCE

x

y y

z

0 1

12/20

Page 30:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2 #0 #2 #1

#5

#3

#4REDUCE

x

y y

z

0 1

12/20

Page 31:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2 #0 #2 #1

#5

#3 #4

REDUCEx

y y

z

0 1

12/20

Page 32:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2 #0 #2 #1

#5

#3 #4

REDUCEx

y y

z

0 1

12/20

Page 33:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1#0 #1 #0 #0 #0 #1 #1 #1

#2 #0 #2 #1

#5

#3 #4REDUCE

x

y y

z

0 1

12/20

Page 34:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm to reduce OBDD

É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1

É Intermediate node n

É If 0-child and 1-child of n have same label, set label of n to bethat label

É If there is another node m such that m has the same variable xiand the children of n and m have same label, then set label of nto be the label of m

É Otherwise set label of n to be next unused integer

Reference: Logic in Computer Science, 2nd edition, by Huth and RyanSection 6.2.1

13/20

Page 35:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm to reduce OBDD

É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1

É Intermediate node n

É If 0-child and 1-child of n have same label, set label of n to bethat label

É If there is another node m such that m has the same variable xiand the children of n and m have same label, then set label of nto be the label of m

É Otherwise set label of n to be next unused integer

Reference: Logic in Computer Science, 2nd edition, by Huth and RyanSection 6.2.1

13/20

Page 36:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm to reduce OBDD

É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1

É Intermediate node n

É If 0-child and 1-child of n have same label, set label of n to bethat label

É If there is another node m such that m has the same variable xiand the children of n and m have same label, then set label of nto be the label of m

É Otherwise set label of n to be next unused integer

Reference: Logic in Computer Science, 2nd edition, by Huth and RyanSection 6.2.1

13/20

Page 37:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm to reduce OBDD

É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1

É Intermediate node n

É If 0-child and 1-child of n have same label, set label of n to bethat label

É If there is another node m such that m has the same variable xiand the children of n and m have same label, then set label of nto be the label of m

É Otherwise set label of n to be next unused integer

Reference: Logic in Computer Science, 2nd edition, by Huth and RyanSection 6.2.1

13/20

Page 38:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm to reduce OBDD

É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1

É Intermediate node n

É If 0-child and 1-child of n have same label, set label of n to bethat label

É If there is another node m such that m has the same variable xiand the children of n and m have same label, then set label of nto be the label of m

É Otherwise set label of n to be next unused integer

Reference: Logic in Computer Science, 2nd edition, by Huth and RyanSection 6.2.1

13/20

Page 39:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm to reduce OBDD

É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1

É Intermediate node n

É If 0-child and 1-child of n have same label, set label of n to bethat label

É If there is another node m such that m has the same variable xiand the children of n and m have same label, then set label of nto be the label of m

É Otherwise set label of n to be next unused integer

Reference: Logic in Computer Science, 2nd edition, by Huth and RyanSection 6.2.1

13/20

Page 40:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm to reduce OBDD

É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1

É Intermediate node n

É If 0-child and 1-child of n have same label, set label of n to bethat label

É If there is another node m such that m has the same variable xiand the children of n and m have same label, then set label of nto be the label of m

É Otherwise set label of n to be next unused integer

Reference: Logic in Computer Science, 2nd edition, by Huth and RyanSection 6.2.1

13/20

Page 41:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Coming next: Algorithm for OBDD1 + OBDD2

14/20

Page 42:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z z

0 1 1 1 0 1 1 1

+

15/20

Page 43:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z z

0 1 1 1 0 1 1 1

+

15/20

Page 44:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y

y

z z z z

0 1 1 1 0 1 1 1

+

15/20

Page 45:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z z

0 1 1 1 0 1 1 1

+

15/20

Page 46:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z

z z z

0 1 1 1 0 1 1 1

+

15/20

Page 47:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z

z z

0 1 1 1 0 1 1 1

+

15/20

Page 48:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z

z z

0

1 1 1 0 1 1 1

+

15/20

Page 49:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z

z z

0 1

1 1 0 1 1 1

+

15/20

Page 50:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z

z z

0 1 1

1 0 1 1 1

+

15/20

Page 51:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z

z z

0 1 1 1

0 1 1 1

+

15/20

Page 52:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z

z

0 1 1 1

0 1 1 1

+

15/20

Page 53:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z z

0 1 1 1

0 1 1 1

+

15/20

Page 54:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z z

0 1 1 1 0

1 1 1

+

15/20

Page 55:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z z

0 1 1 1 0 1

1 1

+

15/20

Page 56:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z z

0 1 1 1 0 1 1

1

+

15/20

Page 57:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

0 1 0 0 0 1 1 1

x

y y

z z z z

0 0 1 1 0 1 0 1

x

y y

z z z z

0 1 1 1 0 1 1 1

+

15/20

Page 58:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1 1 1

16/20

Page 59:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1 1 1

16/20

Page 60:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1 1 1

16/20

Page 61:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y

y

z z z z

(R1,S1)

(R2,S2)

(R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1 1 1

16/20

Page 62:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1 1 1

16/20

Page 63:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z

z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0)

(R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1 1 1

16/20

Page 64:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z

z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1)

(R6,S3) (R7,S3)

0 1 1 1 0 1 1 1

16/20

Page 65:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z

z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1)

(R6,S3) (R7,S3)

0

1 1 1 0 1 1 1

16/20

Page 66:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z

z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1)

(R6,S3) (R7,S3)

0 1

1 1 0 1 1 1

16/20

Page 67:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z

z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1)

(R6,S3) (R7,S3)

0 1 1

1 0 1 1 1

16/20

Page 68:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z

z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1)

(R6,S3) (R7,S3)

0 1 1 1

0 1 1 1

16/20

Page 69:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z

z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3)

(R7,S3)

0 1 1 1

0 1 1 1

16/20

Page 70:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1

0 1 1 1

16/20

Page 71:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0

1 1 1

16/20

Page 72:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1

1 1

16/20

Page 73:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1 1

1

16/20

Page 74:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x

y y

z z z z

R1

R2 R3

R4 R5 R6 R7

0 1 0 0 0 1 1 1

x

y z

S1

S2 S3

0 1

x

y y

z z z z

(R1,S1)

(R2,S2) (R3,S3)

(R4, 0) (R5, 1) (R6,S3) (R7,S3)

0 1 1 1 0 1 1 1

16/20

Page 75:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 76:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 77:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3)

(R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 78:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 79:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4

x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3)

(R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 80:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 81:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0

1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 82:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 83:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4

x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3)

(1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 84:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 85:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0

1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 86:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1

1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 87:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1

1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 88:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 89:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 90:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 91:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0

1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 92:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD

17/20

Page 93:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2

x3

x4

0 1

R1

R2

R3

R4

x1

x3

x4

0 1

S1

S3

S2

17/17

x1

x2 x3

x4 x3

x4 x4

x4

0 1

0 1 1 1

0 1

1

(R1 ,S1)

(R2 ,S3) (R3 ,S2)

(R4 ,S3) (R3 ,S3)

(R4 ,S3) (1,S3)

(R4 ,S3)

Reduce the resulting OBDD17/20

Page 94:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 95:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 96:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 97:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 98:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))

É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 99:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 100:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 101:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)

É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 102:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 103:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 104:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Algorithm for OBDD1 + OBDD2

apply(+, r, s)

É If both r and s are terminals, create a terminal node r + s

É If both r and s are xi nodes, create an xi node with:

É left child: apply(+,left(r),left(s))É right child: apply(+,right(r),right(s))

É If r is xi node and s is a terminal or an xj node with j > i, create an xi

node with:

É left child: apply(+,left(r), s)É right child: apply(+,right(r), s)

É If s is xi node and r is a terminal: similar to Case 3

OBDD1 +OBDD2: apply(+, root1, root2) and then reduce

18/20

Page 105:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

Operations on BDDs

É OR: apply(+ , root1, root2)

É AND: apply(· , root1, root2)

É XOR: apply(XOR ,root1, root2)

É NOT: Use the fact that f = f XOR 1

19/20

Page 106:  · Algorithm to reduce OBDD É Leaves: Label all 0 leaves with #0 and all 1 leaves with #1 É Intermediate node n É If 0-child and 1-child of n have same label, set label of n to

OBDDs

Reduction algorithm

Operations on OBDDs

20/20