Binary Decision Diagrams. Graphs. Boolean Functions

Size: px
Start display at page:

Download "Binary Decision Diagrams. Graphs. Boolean Functions"

Transcription

1 Binary Decision Diagrams Graphs Binary Decision Diagrams (BDDs) are a class of graphs that can be used as data structure for compactly representing boolean functions. BDDs were introduced by R. Bryant in 986. BDDs are used to solve equivalence problems between formulas of propositional logic. Recall some basic graph-theoretical concepts: directed graph node edge predecessor successor path cycle acyclic graph tree forest Very important in the areas of hardware design and hardware optimization. Boolean Functions A boolean function of arity n is a function {, } n {, }. Examples: { if x = or x 2 = or(x, x 2 ) = if x = or x 2 = { if x = if then else(x, x 2, x ) = x if x = Z.B.: if then else(,, ) =, if then else(,, ) = { if x + x 2 = x x 4 sum(x, x 2, x, x 4 ) = otherwise Z.B.: sum(,,, ) = (because + = ), sum(,,, ) = (because + = ).

2 Formulas and boolean functions if the majority of majority n (x,..., x n ) = x,..., x n has value otherwise Z.B.: majority 4 (,,, ) =, majority (,, ) = if the number of inputs x,..., x n parity n (x,..., x n ) = equal to is even otherwise Z.B.: parity (,, ) =, parity 2 (, ) = Let F be a formula, and let n be a number such that all atomic formulas occurring in F belong to {A,..., A n }. Example: F = A A 2, n = 2, but also n =! We define the boolean function f n F : {, }n {, }: f n F (x,..., x n ) = truth value of F under the assignment that sets A,..., A n to x,..., x n 5 Example: For F = A A 2 : ff 2 (, ) = value of = ff (,, ) = value of = Remark: If all of {A,..., A n } occur in F, then ff n is essentially the truth table of F. Convention: We write e.g. f(x, x 2, x ) = x (x 2 x ), meaning f = f F for the formula F = A (A 2 A ). Fact: Let F and F 2 be two formulas, and let n be a number such that all atomic formulas occurring in F or F 2 belong to {A,..., A n }. Then f n F = f n F 2 iff F F 2. Example: F = A, F 2 = A (A 2 A 2 ). f 2 F (, ) = = f 2 F 2 (, ) f 2 F (, ) = = f 2 F 2 (, ) f 2 F (, ) = = f 2 F 2 (, ) f 2 F (, ) = = f 2 F 2 (, ) Convention: The constants and represent the only two boolean functions of arity. 7

3 sum as binary decision tree Variable order A boolean function can be represented by a decision tree x A decision tree can use a variable order different from the order used in the function. x4 x4 x4 x4 x4 x4 x4 x4 x x4 x4 x4 x4 x 9 Binary decision trees A variable order is a bijection b: {,..., n} {x,..., x n } We say that b(), b(2), b(),..., b(n) are the first, second, third,..., n-th variable w.r.t. the order b. We denote the bijection b() = x i,..., b(n) = x in x i < x i2 <... < x in. by A decision tree for the variable order x i <... < x in is a tree satisfying the following conditions: () All leaves are labelled by or by. (2) All other nodes are labelled by a variable and have exactly two children, the -child and the -child. The edges leading to these children are labelled by resp. by. () If the root is not a leave, then it is labelled by x i. (4) If a node is labelled by x in then its two children are leaves. (5) If a node is labelled by x ij and j < n, then its two children are labelled by x ij+.

4 Binary Decision Diagrams (informally) Every path of a decision tree determines an assignment of the variables x i,... x in and vice versa. The boolean function f T represented by a decision tree T is defined as follows: f T (x,..., x n ) = label of the leaf reached by the path corresponding A BDD (multibdd) is a compact representation of a binary decision tree (decision forest). A BDD (multibdd) is obtained from a decision tree (forest) through repeated application of two compression rules (see example in the next slide): Rule : Sharing of identical subtrees. to the assignment x i x i2... x in A binary decision forest ist a forest of decision trees with the same variable order. A decision forest represents the set of functions represented by its elements. Rule 2: Elimination of nodes for which the -child and the -child coincide (redundant nodes). The rules are applied until all subtrees are different and there are no redundant nodes. Example: sharing of subtrees Example: sharing of subtrees x x x4 x4 x4 x4 x4 x4 x4 x4 x4 x4 x4 x4 x4 x4 x4 x4 All - und -leaves are merged. All - und -leaves are merged. 5

5 Example: sharing of subtrees Example: sharing of subtrees x x x4 x4 x4 x4 x4 x4 Identical x 4 -nodes are merged. Identical x -nodes are merged. 7 Example: removing redundant nodes Example: removing redundant nodes x x x4 x4 x4 x4 x4 Redundant x 4 -node is removed Redundant x 4 -node is removed 9 2

6 Formal Definition of BDDs MultiBDDs A BDD for a given variable order is an acyclic directed graph satisfying the following properties: () There is exactly one node without predecessors (the root) (2) There is one or two nodes without succesors, labelled by or (if there are two then they carry different labels). () All other nodes are labelled by a variable and have exactly two distinct children, the -child and the -child. The edges leading to these children are labelled by resp. by. (4) A child of a node is labelled by, by, or by a variable larger than the label of its parent w.r.t. the variable order. (5) All descendant-closed subgraphs of the graph are non-isomorphic. A multibdd is an acyclic graph satisfying (2)-(5) together a distinguished nonempty subset of nodes called the roots. Every node without predecessors is a root, but other nodes may also be roots. A multibdd represents a set of boolean functions, one for each root. 2 2 Remarks Relevance of variable orders Remark: A closed subgraph of a BDD is again a BDD. Remark: The function true n (x,..., x n ) given by true n (x,..., x n ) = for every x, x n {, } n is represented, for every n and for every variable order, by the BDD consisting of one single node labelled by. Similarly for false n (x,..., x n ) The variable order can have large impact on the size of the BDD. Example: f(x,..., x 2n ) = (x x n+ ) (x 2 x n+2 ) (x n x 2n ) Size grows exponentially in n for x < < x n < x n+ < < x 2n. Size grows linearly in n for x < x n+ < x 2 < x n+2 <... < x n < x 2n. Problem in practice: finding a good order. 2 2

7 Canonicity of BDDs The functions f[] und f[] Lemma I: Let f be a boolean function of arity n. There are exactly two boolean functions f[] und f[] of arity (n ) satisfying f(x,..., x n ) = ( x f[](x 2,..., x n )) (x f[](x 2,..., x n )) ( ) We show that for a given boolean function and a given variable order there is a unique BDD representing the function. More generally (but simpler to prove!), we show that for every set of boolean functions of the same arity and for every variable order there is a unique multibdd representing the set. Proof: The functions f[] and f[] defined by f[](x 2,..., x n ) = f(, x 2,..., x n ) and f[](x 2,..., x n ) = f(, x 2,..., x n ) satisfy (*). Let f and f be arbitrary functions satisfying (*). Then f(x,..., x n ) = ( x f (x 2,..., x n )) (x f (x 2,..., x n )) By the properties of and we have f(, x 2,..., x n ) = f (x 2,..., x n ) and together with f(, x 2,..., x n ) = f[](x 2,..., x n ) we get f = f[]. The proof that f = f[] holds is analogous Let f: {, } n {, } be a boolean function, let B be a BDD with variable order x < x 2 <... < x n, and let v be the root of B. Define the nodes v[] and v[] as follows: () If v is labelled by x, then v[] and v[] are the -child and the -child of v. (2) Otherwise, v[] = v = v[]. Lemma II: B represents the function f iff v[] and v[] represent the functions f[] and f[], respectively. Proof: Easy. Theorem: Let F be a nonempty set of boolean functions of arity n and let x i <... < x in be a variable order. There is exactly one multibdd that follows this order and represents F. Proof: We consider the order x < x 2 <... < x n, for other orders the proof is similar. Proof by induction on the arity n. Basis: n =. There are exactly two boolean functions with n =, namely the constants and, and two BDDs K, K consisting of one single node labelled by or by. The set {} is represented by K, the set {} by K, and the set {, } by the multibdd consisting of K and K. 27 2

8 Step: n >. Let F = {f,..., f k }. Define F = {f [], f [],..., f k [], f k []}, where f i [] and f i [] are as in Lemma I. By induction hypothesis there is exactly one multibdd B with roots v, v,..., v k, v k representing F. I.e., for every function f i [j] the root v ij represents f i [j]. Let B be the multibdd with roots v,... v n obtained from B after executing the following steps for i =, 2,..., k: If v i = v i then set v i := v i. (In this case v i represents f i.) If v i v i and B has a node v such with v i as -child and v i as -child then set v i := v. If v i v i and B contains no such node then add a new node v i having v i as -Kind and v i as -Kind. (So v i represents f i, see Lemma II.) Clearly, B represents F. We now show that B is the only multibdd representing F. 29 Computing BDDs from Formulas Let B be an arbitrary multibdd with roots ṽ,... ṽ n representing F. By Lemma II, B contains nodes ṽ [], ṽ [],..., ṽ k [], ṽ k [] representing the functions of F. By induction hypothesis, the multibdd containing these nodes and all its descendants is the multibdd B. In particular, we have v ij = ṽ i [j] for every i {,..., k} and j {, }. Let v i and ṽ i be the roots of B and B, representing f i. By Lemmas I und II, v i and ṽ i [] represent f[], and v i and ṽ i [] represent f[]. Since v i [] = ṽ i [] and v i [] = ṽ i [] we get v i = ṽ i. So B and B are equal. Goal: Given a formula F over the atomic formulas A,..., A n and a variable order for {x,..., x n }, compute a BDD representing f F (x,..., x n ). Naive procedure: Compute the decision tree of f F and reduce it using the compression rules. Problem: The decision tree is too large! Better procedure (idea): Compute recursively the multibdd representing {f F [Ai /], f F [Ai /]} for a suitable A i, and derive from it the BDD for f F, where F [A i /] bzw. F [A i /] are the formulas obtained by replacing every occurrence of A i by resp. by. In the next slides we formalize this idea.

9 The function multibdd(s) Let S = {F,..., F n } be a nonempty set of formulas. We define a procedure multibdd(s) that returns the roots of a multibdd representing the set {f F,..., f Fn }. K denotes the BDD with only one node labelled by. K denotes the BDD with only one node labelled by. A proper formula is a formula containing at least one occurrence of a variable (i.e., not only and ). An atomic formula A i is smaller than A j if x i appears before x j in the variable order. if S contains no proper formulas then if all formulas of S are equivalent to then return {K } else if all formulas in S are equivalent to then return {K } else return {K, K } else choose a proper formula F S. Let A i be the smallest atomic formula occurring in F. Let B = multibdd( (S \ {F }) {F [A i /], F [A i /]} ). Let v, v be the roots of B representing F [A i /], F [A i /]. if v = v then return B else add a new node v with v, v as - and -child (if such a node does not exist yet); return (B \ {v, v }) {v} Equivalence problems Operations on BDDs Given two formulas F, F 2, the following algorithm decides whether F F 2 holds: Choose a suitable variable order x <... < x n. Compute a multibdd for {F, F 2 }. Check whether the roots v F, v F2 are equal. For digital circuits: the BDDs are not derived from formulas, but directly from the circuits. Given: two formulas F, G over the atomic formulas A,..., A n, a variable order for {x,..., x n }, a multibdd with two roots v F, v G representing the functions f F (x,..., x n ) and f F (x,..., x n ), and a binary boolean operation (e.g.,,, ) Goal: compute a BDD for the function f F G (x,..., x n ). With our convention we have f F G = f F f G 5

10 Idea The function Or(v F, v G ) Lemma: (f F f G )[] = f F [] f G [] and (f F f G )[] = f F [] f G []. Proof: Exercise. Algorithm: (for the order x < x 2 <... < x n, similar for others) Compute a multibdd for {f F [] f G [], f F [] f G []}. (Recursively.) Use the Lemma to build a BDD for f F G (x,..., x n ). if v F = K or v F = K then return K else if v F = v G = K then return K else let v F, v G be the nodes for F [], G[] and let v F, v G be the nodes for F [], G[] v := Or(v F, v G ); v := Or(v F, v G ) if v = v then return v else add a new node v with v, v as - and -child (if such a node does not exist yet); return v Implementing BDDs 7 Data structures BDD-nodes coded as numbers,, 2,... with, for the end nodes. BDD-nodes are stored in a table T : u (i, l, h) Source: An introduction to Binary Decision Diagrams Prof. H.R. Andersen where i, l, h are the label, the -child and the -child of u. (Here l stands for low and h for high.) We maintain a second table so that following invarinat holds: H: (i, l, h) u T (u) = (i, l, h) iff H(i, l, h) = u 9 4

11 The function Make(i, l, h) Basic operations on T : init(t ): Initializes T with and add(t, i, l, h): Adds node with attributes (i, l, h) to T and returns it var(u), low(u), high(u): Returns the variable, -child, -child of u Basic operations on H: init(h): Initializes H as the empty table member(h, i, l, h): Checks whether (i, l, h) belongs to H lookup(h, i, l, h): Returns the node H(i, l, h) insert(h, i, l, h, u): Adds (i, l, h) u to H (if not yet there) Look in H for a node with atributes (i, l, h). If found, then return it. Otherwise create a new node and return it. Make(i, l, h) : if l = h then return l 2: else if member(h, i, l, h) then : return lookup(h, i, h, l) 4: else u := add(t, i, l, h) 5: insert(h, i, l, h, u) 6: return u 4 4 Implementing Or Problem: the function can be called many times with the same arguments. Solution: dynamic programming. The results of all calls are stored. Each call checks first if the result has already been computed earlier. Or(u, u 2 ) : init G 2: return Or (u, u 2 ) Or (u, u 2 ) : if G(u, u 2 ) empty then return G(u, u 2 ) 2: else if u = or u 2 = then return : else if u = and u 2 = then return 4: else if var(u ) = var(u 2 ) then 5: u := Make(var(u ), Or (low(u ), low(u 2 )), Or (high(u ), high(u 2 ))) 6: else if var(u ) < var(u 2 ) then 7: u := Make(var(u ), Or (low(u ), u 2 ), Or (high(u ), u 2 )) 8: else u := Make(var(u 2 ), Or (u, low(u 2 )), Or (u, high(u 2 ))) 9: G(u, u 2 ) = u : return u 4 4

Binary Decision Diagrams

Binary Decision Diagrams Binary Decision Diagrams Binary Decision Diagrams (BDDs) are a class of graphs that can be used as data structure for compactly representing boolean functions. BDDs were introduced by R. Bryant in 1986.

More information

Binary Decision Diagrams

Binary Decision Diagrams Binary Decision Diagrams Literature Some pointers: H.R. Andersen, An Introduction to Binary Decision Diagrams, Lecture notes, Department of Information Technology, IT University of Copenhagen Tools: URL:

More information

Binary Decision Diagrams Boolean Functions

Binary Decision Diagrams Boolean Functions Binary Decision Diagrams Representation of Boolean Functions BDDs, OBDDs, ROBDDs Operations Model-Checking over BDDs 72 Boolean functions:b = {0,1}, f :B B B Boolean Functions Boolean expressions: t ::=

More information

Model Checking for Propositions CS477 Formal Software Dev Methods

Model Checking for Propositions CS477 Formal Software Dev Methods S477 Formal Software Dev Methods Elsa L Gunter 2112 S, UIU egunter@illinois.edu http://courses.engr.illinois.edu/cs477 Slides based in part on previous lectures by Mahesh Vishwanathan, and by Gul gha January

More information

Basing Decisions on Sentences in Decision Diagrams

Basing Decisions on Sentences in Decision Diagrams Proceedings of the Twenty-Sixth AAAI Conference on Artificial Intelligence Basing Decisions on Sentences in Decision Diagrams Yexiang Xue Department of Computer Science Cornell University yexiang@cs.cornell.edu

More information

Reduced Ordered Binary Decision Diagrams

Reduced Ordered Binary Decision Diagrams Reduced Ordered Binary Decision Diagrams Lecture #13 of Advanced Model Checking Joost-Pieter Katoen Lehrstuhl 2: Software Modeling & Verification E-mail: katoen@cs.rwth-aachen.de June 5, 2012 c JPK Switching

More information

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

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30) Computational Logic Davide Martinenghi Free University of Bozen-Bolzano Spring 2010 Computational Logic Davide Martinenghi (1/30) Propositional Logic - sequent calculus To overcome the problems of natural

More information

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

CS6840: Advanced Complexity Theory Mar 29, Lecturer: Jayalal Sarma M.N. Scribe: Dinesh K. CS684: Advanced Complexity Theory Mar 29, 22 Lecture 46 : Size lower bounds for AC circuits computing Parity Lecturer: Jayalal Sarma M.N. Scribe: Dinesh K. Theme: Circuit Complexity Lecture Plan: Proof

More information

Symbolic Model Checking with ROBDDs

Symbolic Model Checking with ROBDDs Symbolic Model Checking with ROBDDs Lecture #13 of Advanced Model Checking Joost-Pieter Katoen Lehrstuhl 2: Software Modeling & Verification E-mail: katoen@cs.rwth-aachen.de December 14, 2016 c JPK Symbolic

More information

Binary Decision Diagrams

Binary Decision Diagrams Binary Decision Diagrams Logic Circuits Design Seminars WS2010/2011, Lecture 2 Ing. Petr Fišer, Ph.D. Department of Digital Design Faculty of Information Technology Czech Technical University in Prague

More information

An Algebraic View of the Relation between Largest Common Subtrees and Smallest Common Supertrees

An Algebraic View of the Relation between Largest Common Subtrees and Smallest Common Supertrees An Algebraic View of the Relation between Largest Common Subtrees and Smallest Common Supertrees Francesc Rosselló 1, Gabriel Valiente 2 1 Department of Mathematics and Computer Science, Research Institute

More information

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 CS17 Integrated Introduction to Computer Science Klein Contents Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 1 Tree definitions 1 2 Analysis of mergesort using a binary tree 1 3 Analysis of

More information

Chapter 4: Computation tree logic

Chapter 4: Computation tree logic INFOF412 Formal verification of computer systems Chapter 4: Computation tree logic Mickael Randour Formal Methods and Verification group Computer Science Department, ULB March 2017 1 CTL: a specification

More information

Part V. Intractable Problems

Part V. Intractable Problems Part V Intractable Problems 507 Chapter 16 N P-Completeness Up to now, we have focused on developing efficient algorithms for solving problems. The word efficient is somewhat subjective, and the degree

More information

First-Order Predicate Logic. Basics

First-Order Predicate Logic. Basics First-Order Predicate Logic Basics 1 Syntax of predicate logic: terms A variable is a symbol of the form x i where i = 1, 2, 3.... A function symbol is of the form fi k where i = 1, 2, 3... und k = 0,

More information

BDD Based Upon Shannon Expansion

BDD Based Upon Shannon Expansion 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

More information

Boolean decision diagrams and SAT-based representations

Boolean decision diagrams and SAT-based representations Boolean decision diagrams and SAT-based representations 4th July 200 So far we have seen Kripke Structures 2 Temporal logics (and their semantics over Kripke structures) 3 Model checking of these structures

More information

Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs

Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs Krishnendu Chatterjee Rasmus Ibsen-Jensen Andreas Pavlogiannis IST Austria Abstract. We consider graphs with n nodes together

More information

Decision Procedures for Satisfiability and Validity in Propositional Logic

Decision Procedures for Satisfiability and Validity in Propositional Logic Decision Procedures for Satisfiability and Validity in Propositional Logic Meghdad Ghari Institute for Research in Fundamental Sciences (IPM) School of Mathematics-Isfahan Branch Logic Group http://math.ipm.ac.ir/isfahan/logic-group.htm

More information

Propositional and Predicate Logic - IV

Propositional and Predicate Logic - IV Propositional and Predicate Logic - IV Petr Gregor KTIML MFF UK ZS 2015/2016 Petr Gregor (KTIML MFF UK) Propositional and Predicate Logic - IV ZS 2015/2016 1 / 19 Tableau method (from the previous lecture)

More information

Introduction to Automata

Introduction to Automata Introduction to Automata Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr 1 /

More information

Reduced Ordered Binary Decision Diagrams

Reduced Ordered Binary Decision Diagrams Reduced Ordered Binary Decision Diagrams Lecture #12 of Advanced Model Checking Joost-Pieter Katoen Lehrstuhl 2: Software Modeling & Verification E-mail: katoen@cs.rwth-aachen.de December 13, 2016 c JPK

More information

Binary Decision Diagrams

Binary Decision Diagrams Binary Decision Diagrams An Introduction and Some Applications Manas Thakur PACE Lab, IIT Madras Manas Thakur (IIT Madras) BDDs 1 / 25 Motivating Example Binary decision tree for a truth table Manas Thakur

More information

COMPRESSED STATE SPACE REPRESENTATIONS - BINARY DECISION DIAGRAMS

COMPRESSED STATE SPACE REPRESENTATIONS - BINARY DECISION DIAGRAMS QUALITATIVE ANALYIS METHODS, OVERVIEW NET REDUCTION STRUCTURAL PROPERTIES COMPRESSED STATE SPACE REPRESENTATIONS - BINARY DECISION DIAGRAMS LINEAR PROGRAMMING place / transition invariants state equation

More information

Binary Decision Diagrams

Binary Decision Diagrams Binary Decision Diagrams Sungho Kang Yonsei University Outline Representing Logic Function Design Considerations for a BDD package Algorithms 2 Why BDDs BDDs are Canonical (each Boolean function has its

More information

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

On the Relative Efficiency of DPLL and OBDDs with Axiom and Join On the Relative Efficiency of DPLL and OBDDs with Axiom and Join Matti Järvisalo University of Helsinki, Finland September 16, 2011 @ CP M. Järvisalo (U. Helsinki) DPLL and OBDDs September 16, 2011 @ CP

More information

Representations of All Solutions of Boolean Programming Problems

Representations of All Solutions of Boolean Programming Problems Representations of All Solutions of Boolean Programming Problems Utz-Uwe Haus and Carla Michini Institute for Operations Research Department of Mathematics ETH Zurich Rämistr. 101, 8092 Zürich, Switzerland

More information

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

EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving III & Binary Decision Diagrams. Sanjit A. Seshia EECS, UC Berkeley EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving III & Binary Decision Diagrams Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: Lintao Zhang Announcement Project proposals due

More information

Comp487/587 - Boolean Formulas

Comp487/587 - Boolean Formulas Comp487/587 - Boolean Formulas 1 Logic and SAT 1.1 What is a Boolean Formula Logic is a way through which we can analyze and reason about simple or complicated events. In particular, we are interested

More information

A note on monotone real circuits

A note on monotone real circuits A note on monotone real circuits Pavel Hrubeš and Pavel Pudlák March 14, 2017 Abstract We show that if a Boolean function f : {0, 1} n {0, 1} can be computed by a monotone real circuit of size s using

More information

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

Reduced Ordered Binary Decision Diagram with Implied Literals: A New knowledge Compilation Approach Reduced Ordered Binary Decision Diagram with Implied Literals: A New knowledge Compilation Approach Yong Lai, Dayou Liu, Shengsheng Wang College of Computer Science and Technology Jilin University, Changchun

More information

3 Propositional Logic

3 Propositional Logic 3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists

More information

Introduction to Theoretical Computer Science

Introduction to Theoretical Computer Science Introduction to Theoretical Computer Science Zdeněk Sawa Department of Computer Science, FEI, Technical University of Ostrava 17. listopadu 15, Ostrava-Poruba 708 33 Czech republic February 11, 2018 Z.

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

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

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for? Computer Engineering and Networks Overview Discrete Event Systems Verification of Finite Automata Lothar Thiele Introduction Binary Decision Diagrams Representation of Boolean Functions Comparing two circuits

More information

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic Introduction to EF-games Inexpressivity results for first-order logic Normal forms for first-order logic Algorithms and complexity for specific classes of structures General complexity bounds Preliminaries

More information

QuIDD-Optimised Quantum Algorithms

QuIDD-Optimised Quantum Algorithms QuIDD-Optimised Quantum Algorithms by S K University of York Computer science 3 rd year project Supervisor: Prof Susan Stepney 03/05/2004 1 Project Objectives Investigate the QuIDD optimisation techniques

More information

Herbrand Theorem, Equality, and Compactness

Herbrand Theorem, Equality, and Compactness CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Herbrand Theorem, Equality, and Compactness The Herbrand Theorem We now consider a complete method for proving the unsatisfiability of sets of first-order

More information

Propositional Calculus - Semantics (3/3) Moonzoo Kim CS Dept. KAIST

Propositional Calculus - Semantics (3/3) Moonzoo Kim CS Dept. KAIST Propositional Calculus - Semantics (3/3) Moonzoo Kim CS Dept. KAIST moonzoo@cs.kaist.ac.kr 1 Overview 2.1 Boolean operators 2.2 Propositional formulas 2.3 Interpretations 2.4 Logical Equivalence and substitution

More information

A New Look at BDDs for Pseudo-Boolean Constraints

A New Look at BDDs for Pseudo-Boolean Constraints Journal of Artificial Intelligence Research 45 (22) 443-48 Submitted 3/2; published /2 A New Look at BDDs for Pseudo-Boolean Constraints Ignasi Abío Robert Nieuwenhuis Albert Oliveras Enric Rodríguez-Carbonell

More information

Axioms for Set Theory

Axioms for Set Theory Axioms for Set Theory The following is a subset of the Zermelo-Fraenkel axioms for set theory. In this setting, all objects are sets which are denoted by letters, e.g. x, y, X, Y. Equality is logical identity:

More information

Propositional Logic: Models and Proofs

Propositional Logic: Models and Proofs Propositional Logic: Models and Proofs C. R. Ramakrishnan CSE 505 1 Syntax 2 Model Theory 3 Proof Theory and Resolution Compiled at 11:51 on 2016/11/02 Computing with Logic Propositional Logic CSE 505

More information

Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas

Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas Journal of Artificial Intelligence Research 1 (1993) 1-15 Submitted 6/91; published 9/91 Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas Enrico Giunchiglia Massimo

More information

Binary Decision Diagrams

Binary Decision Diagrams Binar Decision Diagrams Ma 3, 2004 1 Overview Boolean functions Possible representations Binar decision trees Binar decision diagrams Ordered binar decision diagrams Reduced ordered binar decision diagrams

More information

The Separation Problem for Binary Decision Diagrams

The Separation Problem for Binary Decision Diagrams The Separation Problem for Binary Decision Diagrams J. N. Hooker Joint work with André Ciré Carnegie Mellon University ISAIM 2014 Separation Problem in Optimization Given a relaxation of an optimization

More information

Search and Lookahead. Bernhard Nebel, Julien Hué, and Stefan Wölfl. June 4/6, 2012

Search and Lookahead. Bernhard Nebel, Julien Hué, and Stefan Wölfl. June 4/6, 2012 Search and Lookahead Bernhard Nebel, Julien Hué, and Stefan Wölfl Albert-Ludwigs-Universität Freiburg June 4/6, 2012 Search and Lookahead Enforcing consistency is one way of solving constraint networks:

More information

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007) Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007) Problem 1: Specify two different predicates P (x) and

More information

Assignment 5: Solutions

Assignment 5: Solutions Comp 21: Algorithms and Data Structures Assignment : Solutions 1. Heaps. (a) First we remove the minimum key 1 (which we know is located at the root of the heap). We then replace it by the key in the position

More information

Notes on induction proofs and recursive definitions

Notes on induction proofs and recursive definitions Notes on induction proofs and recursive definitions James Aspnes December 13, 2010 1 Simple induction Most of the proof techniques we ve talked about so far are only really useful for proving a property

More information

Lecture 7: Relations

Lecture 7: Relations Lecture 7: Relations 1 Relation Relation between two objects signify some connection between them. For example, relation of one person being biological parent of another. If we take any two people at random,

More information

Discrete Mathematics

Discrete Mathematics Discrete Mathematics Yi Li Software School Fudan University March 13, 2017 Yi Li (Fudan University) Discrete Mathematics March 13, 2017 1 / 1 Review of Lattice Ideal Special Lattice Boolean Algebra Yi

More information

Tribhuvan University Institute of Science and Technology Micro Syllabus

Tribhuvan University Institute of Science and Technology Micro Syllabus Tribhuvan University Institute of Science and Technology Micro Syllabus Course Title: Discrete Structure Course no: CSC-152 Full Marks: 80+20 Credit hours: 3 Pass Marks: 32+8 Nature of course: Theory (3

More information

k-protected VERTICES IN BINARY SEARCH TREES

k-protected VERTICES IN BINARY SEARCH TREES k-protected VERTICES IN BINARY SEARCH TREES MIKLÓS BÓNA Abstract. We show that for every k, the probability that a randomly selected vertex of a random binary search tree on n nodes is at distance k from

More information

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions CS 6743 Lecture 15 1 Fall 2007 1 Circuit Complexity 1.1 Definitions A Boolean circuit C on n inputs x 1,..., x n is a directed acyclic graph (DAG) with n nodes of in-degree 0 (the inputs x 1,..., x n ),

More information

Tree-width and algorithms

Tree-width and algorithms Tree-width and algorithms Zdeněk Dvořák September 14, 2015 1 Algorithmic applications of tree-width Many problems that are hard in general become easy on trees. For example, consider the problem of finding

More information

Infinitary Relations and Their Representation

Infinitary Relations and Their Representation Infinitary Relations and Their Representation DI, Laurent Mauborgne 1 École Normale Supérieure, 45 rue d Ulm, 75 23 Paris cedex 5, France Email: Laurent.Mauborgne@ens.fr WWW home page: http://www.di.ens.fr/~mauborgn/

More information

Pattern Logics and Auxiliary Relations

Pattern Logics and Auxiliary Relations Pattern Logics and Auxiliary Relations Diego Figueira Leonid Libkin University of Edinburgh Abstract A common theme in the study of logics over finite structures is adding auxiliary predicates to enhance

More information

CTL Model Checking. Wishnu Prasetya.

CTL Model Checking. Wishnu Prasetya. CTL Model Checking Wishnu Prasetya wishnu@cs.uu.nl www.cs.uu.nl/docs/vakken/pv Background Example: verification of web applications à e.g. to prove existence of a path from page A to page B. Use of CTL

More information

Exercises - Solutions

Exercises - Solutions Chapter 1 Exercises - Solutions Exercise 1.1. The first two definitions are equivalent, since we follow in both cases the unique path leading from v to a sink and using only a i -edges leaving x i -nodes.

More information

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO

More information

Lecture 7: Dynamic Programming I: Optimal BSTs

Lecture 7: Dynamic Programming I: Optimal BSTs 5-750: Graduate Algorithms February, 06 Lecture 7: Dynamic Programming I: Optimal BSTs Lecturer: David Witmer Scribes: Ellango Jothimurugesan, Ziqiang Feng Overview The basic idea of dynamic programming

More information

A Little Logic. Propositional Logic. Satisfiability Problems. Solving Sudokus. First Order Logic. Logic Programming

A Little Logic. Propositional Logic. Satisfiability Problems. Solving Sudokus. First Order Logic. Logic Programming A Little Logic International Center for Computational Logic Technische Universität Dresden Germany Propositional Logic Satisfiability Problems Solving Sudokus First Order Logic Logic Programming A Little

More information

Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events

Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events Massimo Franceschet Angelo Montanari Dipartimento di Matematica e Informatica, Università di Udine Via delle

More information

Exercises 1 - Solutions

Exercises 1 - Solutions Exercises 1 - Solutions SAV 2013 1 PL validity For each of the following propositional logic formulae determine whether it is valid or not. If it is valid prove it, otherwise give a counterexample. Note

More information

On improving matchings in trees, via bounded-length augmentations 1

On improving matchings in trees, via bounded-length augmentations 1 On improving matchings in trees, via bounded-length augmentations 1 Julien Bensmail a, Valentin Garnero a, Nicolas Nisse a a Université Côte d Azur, CNRS, Inria, I3S, France Abstract Due to a classical

More information

Propositional Logic. Methods & Tools for Software Engineering (MTSE) Fall Prof. Arie Gurfinkel

Propositional Logic. Methods & Tools for Software Engineering (MTSE) Fall Prof. Arie Gurfinkel Propositional Logic Methods & Tools for Software Engineering (MTSE) Fall 2017 Prof. Arie Gurfinkel References Chpater 1 of Logic for Computer Scientists http://www.springerlink.com/content/978-0-8176-4762-9/

More information

Each internal node v with d(v) children stores d 1 keys. k i 1 < key in i-th sub-tree k i, where we use k 0 = and k d =.

Each internal node v with d(v) children stores d 1 keys. k i 1 < key in i-th sub-tree k i, where we use k 0 = and k d =. 7.5 (a, b)-trees 7.5 (a, b)-trees Definition For b a an (a, b)-tree is a search tree with the following properties. all leaves have the same distance to the root. every internal non-root vertex v has at

More information

On the Sizes of Decision Diagrams Representing the Set of All Parse Trees of a Context-free Grammar

On the Sizes of Decision Diagrams Representing the Set of All Parse Trees of a Context-free Grammar Proceedings of Machine Learning Research vol 73:153-164, 2017 AMBN 2017 On the Sizes of Decision Diagrams Representing the Set of All Parse Trees of a Context-free Grammar Kei Amii Kyoto University Kyoto

More information

16. Binary Search Trees. [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap ]

16. Binary Search Trees. [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap ] 418 16. Binary Search Trees [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap. 12.1-12.3] 419 Dictionary implementation Hashing: implementation of dictionaries with expected very fast access times. Disadvantages

More information

Lecture 4 October 18th

Lecture 4 October 18th Directed and undirected graphical models Fall 2017 Lecture 4 October 18th Lecturer: Guillaume Obozinski Scribe: In this lecture, we will assume that all random variables are discrete, to keep notations

More information

On the Complexity of the Reflected Logic of Proofs

On the Complexity of the Reflected Logic of Proofs On the Complexity of the Reflected Logic of Proofs Nikolai V. Krupski Department of Math. Logic and the Theory of Algorithms, Faculty of Mechanics and Mathematics, Moscow State University, Moscow 119899,

More information

Introduction. Chapter 1

Introduction. Chapter 1 Chapter 1 Introduction Logic is concerned mainly with two concepts: truth and provability. These concepts have been investigated extensively for centuries, by philosophers, linguists, and mathematicians.

More information

Tree Automata with Generalized Transition Relations

Tree Automata with Generalized Transition Relations Technische Universität Dresden Faculty of Computer Science Institute of Theoretical Computer Science Chair for Automata Theory Master s Program in Computer Science Master s Thesis Tree Automata with Generalized

More information

DRAFT. Algebraic computation models. Chapter 14

DRAFT. Algebraic computation models. Chapter 14 Chapter 14 Algebraic computation models Somewhat rough We think of numerical algorithms root-finding, gaussian elimination etc. as operating over R or C, even though the underlying representation of the

More information

Realization Plans for Extensive Form Games without Perfect Recall

Realization Plans for Extensive Form Games without Perfect Recall Realization Plans for Extensive Form Games without Perfect Recall Richard E. Stearns Department of Computer Science University at Albany - SUNY Albany, NY 12222 April 13, 2015 Abstract Given a game in

More information

Reckhow s Theorem. Yuval Filmus. November 2010

Reckhow s Theorem. Yuval Filmus. November 2010 Reckhow s Theorem Yuval Filmus November 2010 1 Introduction In 5.3.1 of his thesis [2], Reckhow showed that any two Frege systems p-simulate each other. One of the difficulties involves translation of

More information

16. Binary Search Trees. [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap ]

16. Binary Search Trees. [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap ] 423 16. Binary Search Trees [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap. 12.1-12.3] Dictionary implementation 424 Hashing: implementation of dictionaries with expected very fast access times. Disadvantages

More information

Finite Universes. L is a fixed-length language if it has length n for some

Finite Universes. L is a fixed-length language if it has length n for some Finite Universes Finite Universes When the universe is finite (e.g., the interval 0, 2 1 ), all objects can be encoded by words of the same length. A language L has length n 0 if L =, or every word of

More information

Bounded Treewidth Graphs A Survey German Russian Winter School St. Petersburg, Russia

Bounded Treewidth Graphs A Survey German Russian Winter School St. Petersburg, Russia Bounded Treewidth Graphs A Survey German Russian Winter School St. Petersburg, Russia Andreas Krause krausea@cs.tum.edu Technical University of Munich February 12, 2003 This survey gives an introduction

More information

On the Isomorphism Problem for Decision Trees and Decision Lists

On the Isomorphism Problem for Decision Trees and Decision Lists On the Isomorphism Problem for Decision Trees and Decision Lists V. Arvind 1, Johannes Köbler 2, Sebastian Kuhnert 2, Gaurav Rattan 1, and Yadu Vasudev 1 1 The Institute of Mathematical Sciences, Chennai,

More information

i times p(p(... (p( n))...) = n ki.

i times p(p(... (p( n))...) = n ki. Chapter 7 NP Completeness Exercise 7.1 Show that an algorithm that makes at most a constant number of calls to polynomial-time subroutines runs in polynomial time, but that a polynomial number of calls

More information

Analysis of Algorithms. Outline 1 Introduction Basic Definitions Ordered Trees. Fibonacci Heaps. Andres Mendez-Vazquez. October 29, Notes.

Analysis of Algorithms. Outline 1 Introduction Basic Definitions Ordered Trees. Fibonacci Heaps. Andres Mendez-Vazquez. October 29, Notes. Analysis of Algorithms Fibonacci Heaps Andres Mendez-Vazquez October 29, 2015 1 / 119 Outline 1 Introduction Basic Definitions Ordered Trees 2 Binomial Trees Example 3 Fibonacci Heap Operations Fibonacci

More information

0.Axioms for the Integers 1

0.Axioms for the Integers 1 0.Axioms for the Integers 1 Number theory is the study of the arithmetical properties of the integers. You have been doing arithmetic with integers since you were a young child, but these mathematical

More information

Size-Depth Tradeoffs for Boolean Formulae

Size-Depth Tradeoffs for Boolean Formulae Size-Depth Tradeoffs for Boolean Formulae Maria Luisa Bonet Department of Mathematics Univ. of Pennsylvania, Philadelphia Samuel R. Buss Department of Mathematics Univ. of California, San Diego July 3,

More information

4.8 Huffman Codes. These lecture slides are supplied by Mathijs de Weerd

4.8 Huffman Codes. These lecture slides are supplied by Mathijs de Weerd 4.8 Huffman Codes These lecture slides are supplied by Mathijs de Weerd Data Compression Q. Given a text that uses 32 symbols (26 different letters, space, and some punctuation characters), how can we

More information

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

BOOLEAN ALGEBRA INTRODUCTION SUBSETS BOOLEAN ALGEBRA M. Ragheb 1/294/2018 INTRODUCTION Modern algebra is centered around the concept of an algebraic system: A, consisting of a set of elements: ai, i=1, 2,, which are combined by a set of operations

More information

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition.

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition. Lecture #14: 0.0.1 NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition. 0.0.2 Preliminaries: Definition 1 n abstract problem Q is a binary relations on a set I of

More information

Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events

Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events Massimo Franceschet Angelo Montanari Dipartimento di Matematica e Informatica, Università di Udine Via delle

More information

Matroid Secretary for Regular and Decomposable Matroids

Matroid Secretary for Regular and Decomposable Matroids Matroid Secretary for Regular and Decomposable Matroids Michael Dinitz Weizmann Institute of Science mdinitz@cs.cmu.edu Guy Kortsarz Rutgers University, Camden guyk@camden.rutgers.edu Abstract In the matroid

More information

Dynamic Programming on Trees. Example: Independent Set on T = (V, E) rooted at r V.

Dynamic Programming on Trees. Example: Independent Set on T = (V, E) rooted at r V. Dynamic Programming on Trees Example: Independent Set on T = (V, E) rooted at r V. For v V let T v denote the subtree rooted at v. Let f + (v) be the size of a maximum independent set for T v that contains

More information

About the relationship between formal logic and complexity classes

About the relationship between formal logic and complexity classes About the relationship between formal logic and complexity classes Working paper Comments welcome; my email: armandobcm@yahoo.com Armando B. Matos October 20, 2013 1 Introduction We analyze a particular

More information

The Strong Largeur d Arborescence

The Strong Largeur d Arborescence The Strong Largeur d Arborescence Rik Steenkamp (5887321) November 12, 2013 Master Thesis Supervisor: prof.dr. Monique Laurent Local Supervisor: prof.dr. Alexander Schrijver KdV Institute for Mathematics

More information

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

Title. Citation Information Processing Letters, 112(16): Issue Date Doc URLhttp://hdl.handle.net/2115/ Type. Title Counterexamples to the long-standing conjectur Author(s) Yoshinaka, Ryo; Kawahara, Jun; Denzumi, Shuhei Citation Information Processing Letters, 112(16): 636-6 Issue Date 2012-08-31 Doc URLhttp://hdl.handle.net/2115/50105

More information

Lecture 2: Proof of Switching Lemma

Lecture 2: Proof of Switching Lemma Lecture 2: oof of Switching Lemma Yuan Li June 25, 2014 1 Decision Tree Instead of bounding the probability that f can be written as some s-dnf, we estimate the probability that f can be computed by a

More information

Tableau-based decision procedures for the logics of subinterval structures over dense orderings

Tableau-based decision procedures for the logics of subinterval structures over dense orderings Tableau-based decision procedures for the logics of subinterval structures over dense orderings Davide Bresolin 1, Valentin Goranko 2, Angelo Montanari 3, and Pietro Sala 3 1 Department of Computer Science,

More information

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4 Do the following exercises from the text: Chapter (Section 3):, 1, 17(a)-(b), 3 Prove that 1 3 + 3 + + n 3 n (n + 1) for all n N Proof The proof is by induction on n For n N, let S(n) be the statement

More information

Outline. Complexity Theory. Introduction. What is abduction? Motivation. Reference VU , SS Logic-Based Abduction

Outline. Complexity Theory. Introduction. What is abduction? Motivation. Reference VU , SS Logic-Based Abduction Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 7. Logic-Based Abduction Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien

More information

5 Set Operations, Functions, and Counting

5 Set Operations, Functions, and Counting 5 Set Operations, Functions, and Counting Let N denote the positive integers, N 0 := N {0} be the non-negative integers and Z = N 0 ( N) the positive and negative integers including 0, Q the rational numbers,

More information

1. Prove: A full m- ary tree with i internal vertices contains n = mi + 1 vertices.

1. Prove: A full m- ary tree with i internal vertices contains n = mi + 1 vertices. 1. Prove: A full m- ary tree with i internal vertices contains n = mi + 1 vertices. Proof: Every vertex, except the root, is the child of an internal vertex. Since there are i internal vertices, each of

More information

Sums of Products. Pasi Rastas November 15, 2005

Sums of Products. Pasi Rastas November 15, 2005 Sums of Products Pasi Rastas November 15, 2005 1 Introduction This presentation is mainly based on 1. Bacchus, Dalmao and Pitassi : Algorithms and Complexity results for #SAT and Bayesian inference 2.

More information