Binary Decision Diagrams
INF5140
1
Binary Decision Diagrams INF5140 1 Motivation Fig 1. Polynomial - - PowerPoint PPT Presentation
Binary Decision Diagrams INF5140 1 Motivation Fig 1. Polynomial representation Boolean functions Extremely useful Some areas of application: Cryptography Propositional logic Verification/model checking Fig
1
○ Extremely useful ○ Some areas of application: ■ Cryptography ■ Propositional logic ■ Verification/model checking
○ Often modelled with truth tables or polynomials ■ State space explosion
2
Fig 2. Binary decision tree and accompanying truth table Fig 3. Binary decision diagram Fig 1. Polynomial representation Fig 4. PDAG
BDDs
○ (a boolean function can be such that it
false)
representation
3
BDTs
nodes depending on the function
function
○ hi(n) leads to 1, lo(n) leads to 0
4
difficult problem!
same function
5
6
a. Remove all duplicate terminal nodes b. Remove all duplicate decision nodes c. Remove all redundant decision nodes
canonical/unique
linear form
7
Bottom up id(n) assigns an integer label to the node n 1. 0-terminals are assigned 0, 1-terminals are assigned 1
○ Given then a non-terminal node, integers are given based on the following:
2. If id(lo(n)) == id(hi(n)), then id(n) == id(lo(n)) 3. If nodes n and m exist such that id(lo(n)) == id(lo(m)) and id(hi(n)) == id(lo(m)) then id(n) == id(m) 4. Else id(n) is the next unused integer 5. Finally: Collapse nodes with the same label, redirect edges accordingly
8
○ f = xyz + xy’z + x’y’z + x’yz + x’y’z ○ f = x(yz + y’z) + x’(y’z + yz + y’z) ○ f = xgx + x’gx’
9
two OBDDs Bpsi Bphi
theorem (Shannon’s expansion)
10
apply(op, Bpsi, Bphi):
1. If rpsi, rphi are terminal nodes: ○ apply(op, Bpsi,Bphi) = B(rpsi op rphi) 2. If both roots are decision nodes, create a dashed line to apply(op, Blo(rpsi), Blo(rphi)) and a solid line to apply(op, Bhi(rpsi), Bhi(rphi)) 3. If rpsi is a decision node but rphi is a terminal node, or a node higher in the order, create a node with a dashed line to apply(op, Blo(rpsi), Bphi) 4. If rphi is a decision node but rpsii is a terminal node, it is handled in the same way as in 3
11
function Bf in a BDD by some variable, either to true or false.
creating exists function for generating ROBDDs
12
restrict(T, x, Bpsi): for each node n labelled with x: 1. Incoming edges are redirected to lo(n) 2. n is removed restrict(F, x, Bpsi): same as above, but redirect to hi(n)
13
14
15
Mathematical Theories of Logic and Probabilities, George Boole (1854)
16