Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chain Reduction for Binary and Zero-Suppressed Decision Diagrams

Similar presentations


Presentation on theme: "Chain Reduction for Binary and Zero-Suppressed Decision Diagrams"— Presentation transcript:

1 Chain Reduction for Binary and Zero-Suppressed Decision Diagrams
Randal E. Bryant Carnegie Mellon University

2 Overview Decision Diagrams BDDs (Bryant, 1986) vs ZDDs (Minato, 1992)
Representations of Boolean functions Here: over n variables Canonical in reduced form, totally ordered variables BDDs (Bryant, 1986) vs ZDDs (Minato, 1992) BDDs: General Boolean functions ZDDs: Encoding sparse sets Within n/2× of each other for any function Chain Reduction: Unify BDDs and ZDDs CBDDs: Within 3× of (C)ZDDs CZDDs: Within 2× of BDDs Implemented via modifications of standard DD algorithms

3 BDDs vs ZDDs How should level-skipping edges be interpreted?
Reduced Form x1 How should level-skipping edges be interpreted? x2 x3 1

4 Interpretations Reduced Form BDD Interpretation ZDD Interpretation x1
x2 x3 x1 x1 x2 x2 x3 x2 x2 x3 x3 x3 x3 x3 1 1 Level skipping Don’t care Level skipping One leads to zero

5 Interpretations Reduced Form BDD Interpretation ZDD Interpretation x1
1 1 1 Level skipping Don’t care Level skipping One leads to zero

6 Single Variable Function
f(x1, x2, x3, x4, x5) = x3 1 x3 x1 x2 x3 x5 x4 1 BDD: 3 nodes ZDD: n + 2 nodes

7 Single Minterm Function
f(x1, x2, x3, x4, x5) = x1 x2 x3 x4 x5 1 x3 x1 x2 x4 x5 1 x3 x2 ZDD: p + 2 nodes p = # positive literals BDD: n + 2 nodes

8 Encoding q-Queens Solutions
1-Hot Encoding Binary Encoding 0 1 1 1 0 0 1 0

9 q-Queens Complexity Variables Nodes to Encode Single Solution

10 q-Queens Node Counts

11 q-Queens Node Count Ratios

12 Size Ratio Bounds Knuth, TAOCP 4A (2011) BDD ZDD n/2

13 Chain Types t f t+1 b–1 b Zero-Chain (exploited by ZDDs) t f g t+1 b–1
Zero-Chain (exploited by ZDDs) t f g t+1 b–1 b Or-Chain

14 Chain BDD t f g t+1 b–1 b f g t : b Or-Chain
Every node has two variable levels

15  CBDD Reduction Rule Reduced Form General Form f g f g t : m t : b
m+1 : b f g t : b

16 CBDD Examples 1:1 Single Minterm: ≤ 2p + 3 nodes Single variable 2:2
1:1 2:2 3:3 4:5 1 3:3 Single Minterm: ≤ 2p + 3 nodes Single variable

17 Chain ZDD t f g t+1 b–1 b f g t : b Every node has two variable levels
Don’t Care-Chain Exploited by BDDs

18  CZDD Reduction Rule Reduced Form General Form f g t : m m+1 : b f g
t : b

19 CZDD Examples 1:3 4:5 2:2 3:3 Single variable ≤ 4 nodes Single Minterm
1 1:3 4:5 1 2:2 3:3 Single variable ≤ 4 nodes Single Minterm p + 2 nodes

20 Size Ratios From CZDD to CBDD From BDD to CZDD From CBDD to CZDD
CBDD node for each CZDD node + for each CZDD edge At most 3X larger From BDD to CZDD CZDD node for each BDD edge At most 2X larger From CBDD to CZDD No direct translation for general Or-chain

21 Worst Case for CZDD  CBDD
6k+2 nodes 2k+3 nodes

22 Worst Case for BDD  CZDD
4k+3 nodes 2k+3 nodes

23 Size Ratios BDD ZDD CBDD CZDD n/2 1 3 2

24 Implementation Modified versions of Apply and other algorithms
Next hash table entry High child Low child index Reference Count CUDD Node Representation Negation flags Next hash table entry High child Low child index Reference Count Negation flags Chain-CUDD Node Representation bindex Modified versions of Apply and other algorithms

25 q-Queens Node Counts

26 q-Queens Node Count Ratios

27 Utility CBDDs All advantages of BDDs + ability to represent sparse sets At most 3× larger than ZDD CZDDs Possible replacement for BDDs At most 2× larger Avoids risks of ZDDs Blow-up of intermediate results Often have functions that depend on only subset of variables Excessive operations due to long don’t-care chains

28 Related Work van Dijk, Wille, Mieolic, FMCAD 2017
Associate additional variable “tag” with each edge Allows single level-skipping edge to encode two intepretations Above tag: Implicit don’t care chain At and below tag: Implicit zero-chain

29 Tagged BDD Example Unreduced form Tagged BDD x3 x4 x2 x1 zero chain
x2 x1 zero chain don’t care x4 x2 1 x1

30 Possible Implementation of Tags
CUDD Node Representation Next hash table entry High child Low child index Reference Count Negation flags Tagged-CUDD Node Representation index Reference Count Next hash table entry High tag High child Negation flags Low tag Low child

31 Comparisons Traditional BDD/ZDD Chained DDs Tagged BDDs
Encode one variable in each node Possible n/2× size difference Chained DDs Encode two variables in each node Possible 2–3× size difference For CUDD: Minor change to API Tagged BDDs Encode three variables in each node Guaranteed 1× size difference For CUDD: Major change to API

32 Future Work Extending all of CUDD to Chaining
Dynamic variable ordering Quantification ... Extension to ADDs / MTBDDs Symbolic representation of hybrid systems Partially implemented Symbolic Model Checking of Sparse Systems Work with functions over disjoint sets of variables Present state / next state Lots of don’t-care variables


Download ppt "Chain Reduction for Binary and Zero-Suppressed Decision Diagrams"

Similar presentations


Ads by Google