Presentation is loading. Please wait.

Presentation is loading. Please wait.

Binary Decision Diagrams. ROBDDs Slide 2 Example Directed acyclic graph non-terminal node terminal node What function is represented by the graph?

Similar presentations


Presentation on theme: "Binary Decision Diagrams. ROBDDs Slide 2 Example Directed acyclic graph non-terminal node terminal node What function is represented by the graph?"— Presentation transcript:

1 Binary Decision Diagrams

2 ROBDDs Slide 2 Example Directed acyclic graph non-terminal node terminal node What function is represented by the graph?

3 ROBDDs Slide 3 Shannon Decomposition ABC +  A  C BC CC Apply the decomposition recursively high edge low edge

4 ROBDDs Slide 4 Ordered BDD ABC +  A  C

5 ROBDDs Slide 5 Reduced Ordered BDD Merge isomorphic subtrees

6 ROBDDs Slide 6 Reduced Ordered BDD Remove redundant nodes X X

7 ROBDDs Slide 7 ROBDD

8 ROBDDs Slide 8 ROBDD

9 ROBDDs Slide 9 BDD A Binary Decision Diagram (BDD) is a rooted, directed acyclic graph with one or two terminal nodes of out-degree zero labeled 0 or 1, and a set of variable nodes u of out-degree two. The two outgoing edges are given by two functions low(u) and high(u). (In pictures, these are shown as dotted and solid lines, respectively.) A variable var(u) is associated with each variable node.

10 ROBDDs Slide 10 ROBDD A BDD is Ordered (OBDD) if on all paths through the graph the variables respect a given linear order x 1 < x 2 < … < x n. An OBDD is Reduced (ROBDD) if 1.(uniqueness) no two distinct nodes u and v have the same variable name and low- and high- successor, i.e., var(u) = var(v); low(u) = low(v); high(u) = high(v) implies u = v; and 2.(non-redundant tests) no variable node u has identical low- and high-successor, i.e., low(u) = high(u)

11 ROBDDs Slide 11 Canonicity For any function f : B n  B there is exactly one ROBDD u with variable ordering x 1 < x 2 < … < x n such that f u = f(x 1, …, x n ). Proof:

12 ROBDDs Slide 12 Consequences of Canonicity How do you represent a tautology? (i.e. all variable assignments yield 1) How do you know that the function is satisfiable? (i.e. there is at least one assignment for the variables such that the function evaluates to 1)

13 ROBDDs Slide 13 Variable Order x1x2y1y2  x1x2y1y2  x1x2y1y2 x1x2y1y2x1x2y1y2  x1x2y1y2  x1x2y1y2 x1x2y1y2

14 ROBDDs Slide 14 Constructing and manipulating BDDs Nodes will be represented as numbers 0, 1, 2, … with 0 and 1 reserved for the terminal nodes. The variables in the ordering x 1 < x 2 < … < x n are represented by their indices 1, 2, …, n. The ROBDD is stored in a table T:u  (i, l, h) which maps a node u to its three attributes var(u) = i, low(u) = l, and high(u) = h.

15 ROBDDs Slide 15 Example

16 ROBDDs Slide 16 The H Table In order to ensure that the OBDD being constructed is reduced, it is necessary to determine from a triple (i, l, h) whether there exists a node u with var(u) = i, low(u) = l, and high(u) = h. For this purpose we assume the presence of a table H : (i, l, h)  u mapping triples (i, l, h) of variable indices i, and nodes l, h to nodes u. The table H is the “inverse" of the table T, i.e., for variable nodes u, T(u) = (i, l, h), if and only if, H(i, l, h) = u.

17 ROBDDs Slide 17 Operations on T and H

18 ROBDDs Slide 18 The Function Mk What is the complexity of Mk?

19 ROBDDs Slide 19 The Build Function

20 ROBDDs Slide 20 Example Show build Build(A  B  C) What is the running time of Build? Can it be improved? How?

21 ROBDDs Slide 21 Apply

22 ROBDDs Slide 22 The Function Apply Complexity?

23 ROBDDs Slide 23 The Function Apply Complexity? Dynamic programming

24 ROBDDs Slide 24 Example f = A  BCD add function g =  ABCD ivlh 05 15 2401 3302 4230 5104

25 ROBDDs Slide 25 Example f = A  BCD g =  ABCD ivlh 05 15 2401 3302 4230 5104 6203 7160

26 ROBDDs Slide 26 Example APPLY(f,g,+) ivlh 05 15 2401 3302 4230 5104 6203 7160 8164 How many nodes can a forest have? This is a forest (many trees)

27 ROBDDs Slide 27 Restrict x2 = 0

28 ROBDDs Slide 28 Restrict

29 ROBDDs Slide 29 SatCount Count the number of assignment for which the function is true

30 ROBDDs Slide 30 AnySat Find an assignment for which the function is true

31 ROBDDs Slide 31 AllSat Find all assignments for which the function is true

32 ROBDDs Slide 32 Simplify

33 ROBDDs Slide 33 Optimizations deleted nodes –memory management negated edges variable reordering –sifting


Download ppt "Binary Decision Diagrams. ROBDDs Slide 2 Example Directed acyclic graph non-terminal node terminal node What function is represented by the graph?"

Similar presentations


Ads by Google