BDD Based Upon Shannon Expansion

Similar documents
Binary Decision Diagrams

Binary Decision Diagrams

Binary Decision Diagrams Boolean Functions

Binary Decision Diagrams. Graphs. Boolean Functions

Polynomial Methods for Component Matching and Verification

Binary Decision Diagrams

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving III & Binary Decision Diagrams. Sanjit A. Seshia EECS, UC Berkeley

Binary Decision Diagrams

Boolean decision diagrams and SAT-based representations

Title. Citation Information Processing Letters, 112(16): Issue Date Doc URLhttp://hdl.handle.net/2115/ Type.

Computational Boolean Algebra. Pingqiang Zhou ShanghaiTech University

Circuits. Lecture 11 Uniform Circuit Complexity

COMPRESSED STATE SPACE REPRESENTATIONS - BINARY DECISION DIAGRAMS

Chapter 2 Combinational Logic Circuits

hexadecimal-to-decimal conversion

Symbolic Model Checking with ROBDDs

Reduced Ordered Binary Decision Diagrams

Bounds on the OBDD-Size of Integer Multiplication via Universal Hashing

Data Structures and Algorithms

Equivalence Checking of Sequential Circuits

COMP 382: Reasoning about algorithms

Exercises - Solutions

Anand Raghunathan MSEE 348

Reduced Ordered Binary Decision Diagrams

Basing Decisions on Sentences in Decision Diagrams

Binary Decision Diagrams

Analysis of Algorithm Efficiency. Dr. Yingwu Zhu

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

Multi-Terminal Multi-Valued Decision Diagrams for Characteristic Function Representing Cluster Decomposition

Counter Examples to the Conjecture on the Complexity of BDD Binary Operations

Representations of All Solutions of Boolean Programming Problems

EECS150 - Digital Design Lecture 10 - Combinational Logic Circuits Part 1

Geometric Steiner Trees

Lecture 4 October 18th

CSE140: Components and Design Techniques for Digital Systems. Logic minimization algorithm summary. Instructor: Mohsen Imani UC San Diego

1188 IEEE TRANSACTIONS ON COMPUTERS, VOL. 55, NO. 9, SEPTEMBER 2006

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

Decision Procedures for Satisfiability and Validity in Propositional Logic

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Design of Sequential Circuits

CTL Model Checking. Wishnu Prasetya.

The Separation Problem for Binary Decision Diagrams

ISSN (PRINT): , (ONLINE): , VOLUME-4, ISSUE-10,

A Lower Bound Technique for Nondeterministic Graph-Driven Read-Once-Branching Programs and its Applications

Stochastic Decision Diagrams

CHAPTER1: Digital Logic Circuits Combination Circuits

Optimization Bounds from Binary Decision Diagrams

Lecture 22: Counting

Cardinality Networks: a Theoretical and Empirical Study

Parallelism and Machine Models

Decision Diagrams for Discrete Optimization

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Subquadratic space complexity multiplier for a class of binary fields using Toeplitz matrix approach

Binary Decision Diagrams

Integer Linear Programming

WEEK 2.1 BOOLEAN ALGEBRA

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion

A Lower Bound Technique for Restricted Branching Programs and Applications

ACO Comprehensive Exam March 20 and 21, Computability, Complexity and Algorithms

Fault Collapsing in Digital Circuits Using Fast Fault Dominance and Equivalence Analysis with SSBDDs

Math 2: Algebra 2, Geometry and Statistics Ms. Sheppard-Brick Chapter 4 Test Review

Algorithms: COMP3121/3821/9101/9801

On the Relative Efficiency of DPLL and OBDDs with Axiom and Join

= = = = = =

ELCT201: DIGITAL LOGIC DESIGN

Chapter 7 Logic Circuits

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

Problem. Problem Given a dictionary and a word. Which page (if any) contains the given word? 3 / 26

CSC 2429 Approaches to the P vs. NP Question and Related Complexity Questions Lecture 2: Switching Lemma, AC 0 Circuit Lower Bounds

Adders, subtractors comparators, multipliers and other ALU elements

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162

Binary decision diagrams for security protocols

Combinational Logic. Review of Combinational Logic 1

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

CS6375: Machine Learning Gautam Kunapuli. Decision Trees

Partition of Integers into Distinct Summands with Upper Bounds. Partition of Integers into Even Summands. An Example

Reduced Ordered Binary Decision Diagram with Implied Literals: A New knowledge Compilation Approach

Unit 1A: Computational Complexity

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

CS6840: Advanced Complexity Theory Mar 29, Lecturer: Jayalal Sarma M.N. Scribe: Dinesh K.

CS226 Mid-Semester Examination (Spring 2016)

Combinatorial Enumeration. Jason Z. Gao Carleton University, Ottawa, Canada

Physical Mapping. Restriction Mapping. Lecture 12. A physical map of a DNA tells the location of precisely defined sequences along the molecule.

PATH BUNDLES ON n-cubes

Binary Decision Diagrams and Symbolic Model Checking

Algorithms and Data Structures 2016 Week 5 solutions (Tues 9th - Fri 12th February)

CS151 Complexity Theory

Antonina Kolokolova Memorial University of Newfoundland

Sequential Equivalence Checking - I

COL 730: Parallel Programming

FORMAL METHODS LECTURE VI BINARY DECISION DIAGRAMS (BDD S)

Lecture 2: Divide and conquer and Dynamic programming

QuIDD-Optimised Quantum Algorithms

1 The Low-Degree Testing Assumption

Adders, subtractors comparators, multipliers and other ALU elements

Allocation of multiple processors to lazy boolean function trees justification of the magic number 2/3

Ma/CS 117c Handout # 5 P vs. NP

Transcription:

Boolean Function Manipulation OBDD and more BDD Based Upon Shannon Expansion Notations f(x, x 2,, x n ) - n-input function, x i = or f xi=b (x,, x n ) = f(x,,x i-,b,x i+,,x n ), b= or Shannon Expansion fix a variable f = x i f xi= (x,, x n ) + x i f xi= (x,, x n )

Example f = x x2 + x4 + x x2 x5 f(x=) = x4 + x2 x5 f(x=) = x2 + x4 f = x ( x4 + x2 x5) + x (x2 + x4) Similarly f = x2 ( x4) + x2 (x + x4 + x x5) To represent f, we use a divide-and-conquer approach to represent f(xi=) and f(xi=) xi f(xi=) f(xi=) f = x x2 + Decision Tree f = x (x2 + ) + x () g = x2 () + x2 () g2 = x2 g g2 x x2 g2 f g In f, g2 appears twice, appears 3 times, and appears twice 2

OBDD From root (x) to a terminal vertex ( or ), the ordering of the splitting variables is the same Each sub-function appears only once two sub-functions are the same iff their OBDD graphs are the same canonical representation Also known as read-once branch program in comp. theory x x 2X+3=5 x2 x2 3 f 2n+ vertices Classical OBDD Example Variable ordering is not important... x x2 f = x x2... xn xn even s odd # of s 3

Classical OBDD Example To represent a symmetric function variable ordering is not important at level i, we need at most i vertices total nodes is < O(n 2 ) 2 2 3 3 3 4 4 4 4 no s s 2 s 3 s Ordering Example f = x x2 + x4 + x5 x6 ordering : x x2 x4 x5 x6 (linear result) If (x x2)=, f = no need to read further! Otherwise we can forget about x x2 The memoryless effect makes BDD small A node in a BDD is a memory cell to remember the intermediate results during the computation of the function ordering 2 : x x5 x2 x4 x6 (exponential result) If (x==x5=) we need to remember them all! Because nothing can be decided based upon the information we have 4

Ordering and OBDD Size A node in a function graph is a place to remember important information about the computation f = x x 2 + x 3 x 4 + + x (n-) x n proceed in this direction when reach x 2 need to remember the value of x when reach x 3 only when x x 2 = if x x 2 =, then x x 2 can be ignored and from x 3 the computation restarts fresh OBDD Size f = x x n/2+ + x 2 x n/2+2 + + x n/2 x n proceed ordering as x x 2 x 3 x 4 x (n-) x n when reach x n/2 all values in x x 2 x 3 x (n-)/2 will need to be remembered because a different assignment may lead to different result nothing can be ignored and nothing for sure to be said about the evaluation yet need a complete binary tree for (n-)/2 variables exponential result 5

Satisfiability Satisfy-one: find a path from to the root Satisfy-all : find all different paths from to the root Satisfy-count : count the # of satisfying assignments Computing OBDDs x xn Circuit Initialize all Pis Compute the result of a boolean operation as merging two OBDDs and, or, xor, etc. Use procedures Apply and Reduce Follow topological order until reaching all POs 6

Worst-Case Example Worst-case example - multiplication f = A*B for any input ordering, OBDD(f) requires an exponential number of nodes (a n a n- a ) * (b n b n- b ) π is an ordering Theorem: for any π, OBDD size 2 n/8 Potential solutions word-level BDD Binary moment diagram (BMD) Idea of Proof No matter how you order the input variables, you can always find a cut that The width is O(n) The information flow is O(n/8) Input set Input set 2 O(n/8) 7

Equivalent to Say Need to remember O(n/8) different states More Terminology Composition f(xi=g)(x xn) = f(x,, g(x xn),, xn) ex. f=xx2+x4 and g=x2+ f(x=g) = x2 + x2 + x4 = x2 + x4 Dependency Set I f = { i f(xi=) f(xi=) } f depends on xi f = x x2 + x x2 f is independent of x Satisfying Set S f = { (x xn) f(x xn) = } all assignments that made f = 8

OBDD Operation Complexity Reduce (make canonical, minimal form) - O(G log G) (DA) graphs isomorphism Apply (merge two OBDDs) - O(G G 2 ) Boolean operation = {Apply Reduce} Restrict {f(xi=b)} - O(G log G) Compose {f(xi=g)} - O(G 2 G 2 ) Satisfy-One - O(n) Satisfy-all - O(n S f ) Satisfy-Count - O(G) This is a #P-complete problem Apply and Reduce OBDD op OBDD2 The basic algorithms to do so are Apply(OBDD, OBDD2) -> BDD3 Reduce(BDD3) -> OBDD3 9

f op f 2 = Apply x i [ f (x i =) op f 2 (x i =) ] + x i [ f (x i =) op f 2 (x i =) ] op = T T2 T3 T4 T op T3 T2 op T4 Example 2 Apply = 3 3 F= X + X X3 2 Reduce 2 3 3 3

Complexity of Apply i nodes op j nodes = k nodes k i * j i nodes represent i different sub-functions the worst case - (each of i nodes) op (each of j nodes) are different Total complexity O(G G2) Hash table in Apply Apply ( ), T T2 a T3 T4 b Apply(T, T3) Apply(T2, T4) Apply(a,b) When doing Apply(T,T3), we have done Apply(a,b) Apply(a,b) should not be repeated Need a hash table to store results of from Apply of all sub-functions.

Reduce DA Graph Isomorphism we can do a pair-wise comparison for all nodes but that is too slow instead: by labeling bottom-up = = 6 (4,5) 4 (3,2) 5 (,2) 3 (,2) () (2) Each graph has a unique labeling scheme same label at the root = same graph Labeling Scheme i i... i i+ i+ i+... i+2 i+2... i+2 i = i a b c d iff a=c && b=d Why working bottom-up? So that when working at level i, each node below already points to a unique graph already 2

Redundant Nodes Removal i+ i i i = i+ i+ i i i- i- i+ i+ i+ = At each level, how do we know how many nodes are identical in the labeling scheme? by sorting the labels at that level O(n log n) time complexity An Example (4,3) (,3) 2 2 (3,3) 2 3 (,2) 3 (,2) 3 () (2) () (2) 3

Other BDDs Function Decomposition Rules OBDD f = x f(x=) + x f(x=) Reed-Muller Decomposition f = f(x=) x [ f(x=) f(x=) ] f = f(x=) x [ f(x=) f(x=) ] Ordered Functional Decision Diagram x f(x=) f(x=) f(x=) 4

F = (x x2) F(=) = F(=) = x x2 difference D3 = x x2 D3(x2=) = x D3(x2=) = x difference D2 = OFDD x2 x OFDD requires a different Reduction rule For some functions, OFDD can be exponentially smaller than OBDD and vice verse Evaluation of the graph is different from OBDD Can no longer be simply tracing from root to s or s Free BDD The ordering along each path can be different Main issues Deciding that two trees are representing the same functions can not be done by graph isomorphism. It can only be done via a probabilistic algorithms Free BDD give flexibility in the representation but sacrifice in the complexity of manipulate the BDD date structures 5

Represent Numeric-Valued Functions eg. f=x +2x +4x 2 Arithmetic Decision Diagram (ADD) Associate more values as terminal nodes Edge-Valued BDD (EVBDD) Bring values from the terminal nodes to edges Binary Moment Diagram (BMD) Decomposition : f = f(x=) + x (δf/δx) Linearly Inductive BDD Linearly Inductive Function Recursively Defined X i : the inputs to the i-instance function F i : the i-instance function B i : an arbitrary boolean function F = B (x ) and F i = B i (X i, G i- ) B i = B j for all i,j Example - Adder Sum = a b c_in Sum i = ai bi Carry i- Carry = a b + (a+b) c_in Carry i = ai bi + (ai+bi) Carry i- 6

LIBDD Require different rules for Apply and Reduce Applicable to special case when good sequentiality can be captured Function definition has to be known in advance Inspiration Zero-Suppressed BDD To represent a collection of bit vectors eg. () () () Such a representation is often encountered in some combinatorial problems Usually, the s in the bit vectors is sparse ZBDD Change the Reduction rule A node can be removed iff the -edge points to x 7

x2 ZBDD Interpretation x x x x In ZBDD sense A = {, } and B = {,, } ZBDD is good for sets manipulation ZBDD can be used to represent a function as a collection of cube sets x,x2,={-,-,-} => {,,} To ensure sparse => :, :, -: 8