Binary Decision Diagrams INF5140 1 Motivation Fig 1. Polynomial - - PowerPoint PPT Presentation

binary decision diagrams
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Binary Decision Diagrams

INF5140

1

slide-2
SLIDE 2

Motivation

  • Boolean functions

○ Extremely useful ○ Some areas of application: ■ Cryptography ■ Propositional logic ■ Verification/model checking

  • Hardware
  • Software

○ Often modelled with truth tables or polynomials ■ State space explosion

  • Symbolic model checking!

2

Fig 2. Binary decision tree and accompanying truth table Fig 3. Binary decision diagram Fig 1. Polynomial representation Fig 4. PDAG

slide-3
SLIDE 3

Differences between BDTs and BDDs

BDDs

  • Between 1 and 2 terminal nodes

○ (a boolean function can be such that it

  • nly maps to true or only maps to

false)

  • Can be a tree, usually isn’t
  • (more) Compact representation
  • NP-Hard to find a good

representation

3

BDTs

  • An arbitrary number of terminal

nodes depending on the function

  • Size scales with complexity of

function

  • Easy to make
slide-4
SLIDE 4

Binary Decision Diagrams 101

  • Decision nodes
  • Terminal nodes
  • Ordered (OBDD)
  • Reduced (RBDD)
  • (Well-) Ordered, reduced (ROBDD)
  • Satisfiability
  • Validity
  • Equivalence
  • Brief mention about notation:

○ hi(n) leads to 1, lo(n) leads to 0

4

slide-5
SLIDE 5

Binary Decision Diagrams: Ordering

  • Finding the “correct” ordering is a

difficult problem!

  • Big differences in OBDDs for the

same function

  • Necessary to choose an order to
  • btain a (unique) reduced
  • rdered BDD

5

slide-6
SLIDE 6

Binary Decision Diagram: Ordering, example 2

6

slide-7
SLIDE 7

Ordered Binary Decision Diagrams: Reduction

  • Starting with a BDT:

a. Remove all duplicate terminal nodes b. Remove all duplicate decision nodes c. Remove all redundant decision nodes

  • If you have two reduced BDDs, and order them the same, they will be

canonical/unique

  • Some boolean functions are exponential and cannot be reduced to a

linear form

7

slide-8
SLIDE 8

Algorithms: Reduce

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

slide-9
SLIDE 9

Boole’s expansion theorem

  • Example:

○ 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’

  • Used in the construction of the BDD data structure
  • A op B = x’ (A [0/x] op B[0/x]) + x(A [1/x] op B[1/x]

9

slide-10
SLIDE 10

Algorithms: Apply

  • Used to build an ROBDD from

two OBDDs Bpsi Bphi

  • Based on Boole’s expansion

theorem (Shannon’s expansion)

  • Recursive (roots down)

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

slide-11
SLIDE 11

Algorithms: Apply, example

11

slide-12
SLIDE 12

Algorithms: Restrict

  • Used to restrict a boolean

function Bf in a BDD by some variable, either to true or false.

  • For boolean quantification,

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)

slide-13
SLIDE 13

Algorithms: Restrict, example

13

slide-14
SLIDE 14

Algorithms: Exists

  • Boolean quantification
  • Combination of known algorithms

14

slide-15
SLIDE 15

Algorithms: Exists, example

15

slide-16
SLIDE 16

Sources

  • https://www.inf.unibz.it/~artale/FM/slide7.pdf
  • http://www.nptel.ac.in/courses/106103016/module4/lec3/1.html
  • An Investigation of the Laws of Thought: On which are Founded the

Mathematical Theories of Logic and Probabilities, George Boole (1854)

  • Images shamelessly stolen from Wikimedia

16