Ordered Binary Decision Diagrams (OBDD) and Reduced Ordered BDD (ROBDD) by Naresh Shanbhag, Study notes of Electrical and Electronics Engineering

An in-depth exploration of ordered binary decision diagrams (obdd) and reduced ordered bdd (robdd) as presented by naresh shanbhag in his ece 598 sv course at the university of illinois at urbana-champaign. Topics such as the structure of obdd and robdd, variable ordering problem, efficient implementation of bdds, and the use of ite operator. It also includes examples and algorithms.

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-op0-1
koofers-user-op0-1 🇺🇸

10 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
1
Naresh Shanbhag, University of Illinois at Urbana-Champaign 1
ECE 598 SV
BDD
2
Naresh Shanbhag, University of Illinois at Urbana-Champaign 2
Ordered Binary Decision Trees
and Diagrams
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Ordered Binary Decision Diagrams (OBDD) and Reduced Ordered BDD (ROBDD) by Naresh Shanbhag and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Naresh Shanbhag, University of Illinois at Urbana-Champaign 1^1

ECE 598 SV

BDD

Naresh Shanbhag, University of Illinois at Urbana-Champaign 2^2

Ordered Binary Decision Trees

and Diagrams

Naresh Shanbhag, University of Illinois at Urbana-Champaign 3^3

From Binary Decision Trees to

Diagrams

Naresh Shanbhag, University of Illinois at Urbana-Champaign 4^4

OBDD for Comparator Example

Naresh Shanbhag, University of Illinois at Urbana-Champaign 7^7

Variable Ordering Problem (Cont.)

Naresh Shanbhag, University of Illinois at Urbana-Champaign 8^8

Variable Ordering

  • Static variable ordering
    • variable ordering is computed up-front based on the

problem structure

  • works very well for many combinational functions that

come from circuits we actually build

» general scheme: control variables first » DFS order is pretty good for most cases

  • work bad for unstructured problems » e.g., using BDDs to represent arbitrary sets
  • lots of research in ordering algorithms » simulated annealing, genetic algorithms » give better results but extremely costly

Naresh Shanbhag, University of Illinois at Urbana-Champaign 9^9

Efficient Implementation of BDD’s

Unique Table:

  • avoids duplication of existing nodes
    • Hash-Table: hash-function(key) = value
    • identical to the use of a hash-table in AND/INVERTER circuits

Computed Table:

  • avoids re-computation of existing results

hash value of key

collision chain

hash value of key No collision chain

Naresh Shanbhag, University of Illinois at Urbana-Champaign 10^10

Efficient Implementation of BDD’s

  • BDDs is a compressed Shannon co-factoring tree: » f = v fv + v fv » leafs are constants “0” and “1”
  • Three components make ROBDDs canonical (Proof: Bryant 1986):
    • unique nodes for constant “0” and “1”
    • identical order of case splitting variables along each paths
    • hash table that ensures: » (node(fv) = node(gv)) ∧ (node(fv) = node(gv)) ⇒ node(f) = node(g)
    • provides recursive argument that node(f) is unique when using the unique hash-table

v 0 1

f

fv fv

Naresh Shanbhag, University of Illinois at Urbana-Champaign 13^13

ITE Operator

ITE operator can implement any two variable logic function. There are 16 such functions corresponding to all subsets of vertices of B^2 : Table Subset Expression Equivalent Form 0000 0 0 0 0001 AND(f, g) fg ite(f, g, 0) 0010 f > g fg ite(f, g, 0) 0011 f f f 0100 f < g fg ite(f, 0, g) 0101 g g g 0110 XOR(f, g) f ⊕ g ite(f, g, g) 0111 OR(f, g) f + g ite(f, 1, g) 1000 NOR(f, g) f + g ite(f, 0, g) 1001 XNOR(f, g) f ⊕ g ite(f, g, g) 1010 NOT(g) g ite(g, 0, 1) 1011 f ≥ g f + g ite(f, 1, g) 1100 NOT(f) f ite(f, 0, 1) 1101 f ≤ g f + g ite(f, g, 1) 1110 NAND(f, g) fg ite(f, g, 1) 1111 1 1 1

ite( , f g h , ) = fg + f h

Naresh Shanbhag, University of Illinois at Urbana-Champaign 14^14

Unique Table - Hash Table

  • Before a node ( v, g, h ) is added to BDD data base, it is looked up in the “unique-table”. If it is there, then existing pointer to node is used to represent the logic function. Otherwise, a new node is added to the unique-table and the new pointer returned.
  • Thus a strong canonical form is maintained. The node for f = ( v, g, h ) exists iff( v, g, h ) is in the unique-table. There is only one pointer for ( v, g, h ) and that is the address to the unique-table entry.
  • Unique-table allows single multi-rooted DAG to represent all users’ functions:

hash index of key

collision chain

Naresh Shanbhag, University of Illinois at Urbana-Champaign 15^15

Recursive Formulation of ITE

v = top-most variable among the three BDDs f, g, h

Where A, B are pointers to results of ite(fv,gv,hv) and ite(fv’,gv’,hv’})

  • merged if equal

Naresh Shanbhag, University of Illinois at Urbana-Champaign 16^16

Recursive Formulation of ITE

Algorithm ITE (f, g, h) if (f == 1) return g if (f == 0) return h if (g == h) return g

if ((p = HASH_LOOKUP_COMPUTED_TABLE (f,g,h)) return p v = TOP_VARIABLE (f, g, h ) // top variable from f,g,h fn = ITE (fv,gv,hv) // recursive calls gn = ITE (fv,gv,hv) if (fn == gn) return gn // reduction if (!(p = HASH_LOOKUP_UNIQUE_TABLE (v,fn,gn)) { p = CREATE_NODE (v,fn,gn) // and insert into UNIQUE_TABLE } INSERT_COMPUTED_TABLE (p, HASH_KEY {f,g,h}) return p }

Naresh Shanbhag, University of Illinois at Urbana-Champaign 19^19

Use of Computed Table

  • Often BDD packaged use optimized implementations for special operations - e.g. ITE_Constant (check whether the result would be a constant) - AND_Exist (AND operation with existential quantification)
  • All operations need a cache for decent performance
    • local cache » for one operation only - cache will be thrown away after operation is finished (e.g. AND_Exist) » keep inter-operational (ITE, …)
    • special cache for each operation » does not need to store operation type
    • shared cache for all operations » better memory handling » needs to store operation type

Naresh Shanbhag, University of Illinois at Urbana-Champaign 20^20

Example: Tautology Checking

Algorithm ITE_CONSTANT (f,g,h) { // returns 0,1, or NC if ( TRIVIAL_CASE (f,g,h) return result (0,1, or NC) if ((res = HASH_LOOKUP_COMPUTED_TABLE (f,g,h))) return res v = TOP_VARIABLE (f,g,h) i = ITE_CONSTANT (fv,gv,hv) if (i == NC) { INSERT_COMPUTED_TABLE (NC, HASH_KEY {f,g,h}) //special table!! return NC } e = ITE_CONSTANT (fv,gv,hv) if (e == NC) { INSERT_COMPUTED_TABLE (NC, HASH_KEY {f,g,h}) return NC } if (e != i) { INSERT_COMPUTED_TABLE (NC, HASH_KEY {f,g,h}) return NC } INSERT_COMPUTED_TABLE (e, HASH_KEY {f,g,h}) return i; }

Naresh Shanbhag, University of Illinois at Urbana-Champaign 21^21

Compose

Compose( F , v , G ) : F ( v , x ) → F ( G ( x ), x ), means substitute v by G ( x )

Notes:

  1. F 1 is the 1-child of F , F 0 the 0-child.
  2. G , i , e are not functions of v
  3. If TOP_VARIABLE of F is v , then ite ( G , i , e ) does replacement of v by G.

Algorithm COMPOSE (F,v,G) { if ( TOP_VARIABLE (F) > v) return F // F does not depend on v if ( TOP_VARIABLE (F) == v) return ITE (G,F 1 ,F 0 ) i = COMPOSE (F 1 ,v,G) e = COMPOSE (F 0 ,v,G) return ITE ( TOP_VARIABLE (F),i,e) // Why not CREATE_NODE... }

Naresh Shanbhag, University of Illinois at Urbana-Champaign 22^22

Logical operations on OBDD’s

Naresh Shanbhag, University of Illinois at Urbana-Champaign 25^25

Symbolic Model Checking (cont.)

Naresh Shanbhag, University of Illinois at Urbana-Champaign 26^26

Symbolic Model Checking (cont.)

Naresh Shanbhag, University of Illinois at Urbana-Champaign 27^27

Symbolic Model Checking (cont.)

Naresh Shanbhag, University of Illinois at Urbana-Champaign 28^28

Symbolic Model Checking

Example: ABP sender

Naresh Shanbhag, University of Illinois at Urbana-Champaign 31^31

State space traversal

Naresh Shanbhag, University of Illinois at Urbana-Champaign 32^32

Binary Decision Tree (for I )

Naresh Shanbhag, University of Illinois at Urbana-Champaign 33^33

BDD (for I )

Variable ordering

With variable ordering

the BDD for the transition relation has 22 nodes.

F= F’=

Naresh Shanbhag, University of Illinois at Urbana-Champaign 34^34

Symbolic Verification

Function call Smc(ABP sender,EG (¬s^¬w))