An Introduction to Binary Decision Diagrams

Size: px
Start display at page:

Download "An Introduction to Binary Decision Diagrams"

Transcription

1 An Introduction to Binary Decision Diagrams Henrik Reif Andersen x y y z 1 0 Lecture notes for Efficient Algorithms and Programs, Fall hra@itudk Web: The IT University of Copenhagen Glentevej Copenhagen NV

2 1

3 2 Preface This note is a short introduction to Binary Decision Diagrams It provides some background knowledge and describes the core algorithms More details can be found in Bryant s original paper on Reduced rdered Binary Decision Diagrams [Bry86] and the survey paper [Bry92] A recent extension called Boolean Expression Diagrams is described in [AH97] This note is a revision of an earlier version from fall 1996 (based on versions from 1995 and 1994) The major differences are as follows: Firstly, RBDDs are now viewed as nodes of one global graph with one fixed ordering to reflect state-of-the-art of efficient BDD packages The algorithms have been changed (and simplified) to reflect this fact Secondly, a proof of the canonicity lemma has been added Thirdly, the sections presenting the algorithms have been completely restructured Finally, the project proposal has been revised Acknowledgements Thanks to the students on the courses of fall 1994, 1995, and 1996 for helping me debug and improve the notes Thanks are also due to Hans Rischel, Morten Ulrik Sørensen, Niels Maretti, Jørgen Staunstrup, Kim Skak Larsen, Henrik Hulgaard, and various people on the Internet who found typos and suggested improvements

4 3

5 CNTENTS 4 Contents 1 Boolean Expressions 6 2 Normal Forms 7 3 Binary Decision Diagrams 8 4 Constructing and Manipulating RBDDs MK BUILD APPLY RESTRICT SATCUNT, ANYSAT, ALLSAT SIMPLIFY Existential Quantification and Substitution 25 5 Implementing the RBDD operations 26 6 Examples of problem solving with RBDDs The 8 Queens problem Correctness of Combinational Circuits Equivalence of Combinational Circuits 28 7 Verification with RBDDs Knights tour 32 8 Project: An RBDD Package 34 References 35

6 CNTENTS 5

7 1 BLEAN EXPRESSINS 6 ( 1 Boolean Expressions The classical calculus for dealing with truth values consists of Boolean variables, the constants true and false, the operators of conjunction, disjunction, negation, implication, and bi-implication which together form the Boolean expressions Sometimes the variables are called propositional variables or propositional letters and the Boolean expressions are then known as Propositional Logic Formally, Boolean expressions are generated from the following grammar: where ranges over a set of Boolean variables This is called the abstract syntax of Boolean expressions The concrete syntax includes parentheses to solve ambiguities Moreover, as a common convention it is assumed that the operators bind according to their relative priority The priorities are, with the highest first:,,,, Hence, for example!"!# $# $# % A Boolean expression with variables & '!( denotes for each assignment of truth values to the variables itself a truth value according to the standard truth tables, see figure 1 Truth assignments are written as sequences of assignments of values to variables, eg, )*,+- +/,+ +&0 which assigns to and, to and With this particular truth assignment the above expression has value, whereas )*1+- +,+2,+ 0 yields Figure 1: Truth tables 54 The set of truth values is often denoted 3 76 If we fix an ordering of the variables of a Boolean expression we can view as defining a function from 3 to 3 where 8 is the number of variables Notice, that the particular ordering chosen for the variables is essential for what function is defined Consider for example the expression If we choose the ordering :9; then this is the function! =#, true if the first argument implies the second, but if we choose the ordering >9? then it is the true if the second argument implies the first When we later consider compact representations of Boolean expressions, such variable orderings play a crucial role Two Boolean expressions and BA are said to be equal if they yield the same truth value for all truth assignments A Boolean expression is a tautology if it yields true for all truth assignments; it is satisfiable if it yields true for at least one truth assignment Exercise 11 Show how all operators can be encoded using only and Use this to argue that any Boolean expression can be written using only,, variables, and applied to variables Exercise 12 Argue that and A are equal if and only if A is a tautology Is it possible to say whether is satisfiable from the fact that is a tautology?

8 2 NRMAL FRMS 7 R X I I ( 2 Normal Forms A Boolean expression is in Disjunctive Normal Form (DNF) if it consists of a disjunction of conjunctions of variables and negations of variables, ie, if it is of the form C ED2D2D where each NM is either a variable M F&G # ED2D2D HJI JI D2D2D M or a negation of a variable P Q# =# JI FLK # (1) An example is which is a well-known function of and (which one?) A more succinct presentation of (1) is to write it using indexed versions of and : TUFWV X M"YZ M!S S Similarly, a Conjunctive Normal Form (CNF) is an expression that can be written as M!S TUFWV R S where each NM is either a variable or a negated variable It is not difficult to prove the following proposition: Proposition 1 Any Boolean expression is equal to an expression in CNF and an expression in DNF In general, it is hard to determine whether a Boolean expression is satisfiable This is made precise by a famous theorem due to Cook [Coo71]: Theorem 1 (Cook) Satisfiability of Boolean expressions is NP-complete (For readers unfamiliar with the notion of NP-completeness the following short summary of the pragmatic consequences suffices Problems that are NP-complete can be solved by algorithms that run in exponential time No polynomial time algorithms are known to exist for any of the NP-complete problems and it is very unlikely that polynomial time algorithms should indeed exist although nobody has yet been able to prove their non-existence) Cook s theorem even holds when restricted to expressions in CNF For DNFs satisfiability is decidable in polynomial time but for DNFs the tautology check is hard (co-np complete) Although satisfiability is easy for DNFs and tautology check easy for CNFs, this does not help us since the conversion between CNFs and DNFs is exponential as the following example shows Consider the following CNF over the variables [ # [ M"YZ # ED2D2D [ / " [! / /! ( ( [ #\ ( :

9 3 BINARY DECISIN DIAGRAMS 8 ( ( ( ( ( The corresponding DNF is a disjunction which has a disjunct for each of the 8 -digit binary [ (for numbers from 17 / 71 to 17 / 71 the ] th digit representing a choice of either ) or (for ): (_^ [ [ D2D2D2 [ [ # (_^ [ [ D2D2D2 [ # D2D2D2 D2D2D (_^ (_^ [ # #\ Whereas the original expression has size proportional to 8 the DNF has size proportional to 8a` The next section introduces a normal form that has more desirable properties than DNFs and CNFs In particular, there are efficient algorithms for determining the satisfiability and tautology questions Exercise 21 Describe a polynomial time algorithm for determining whether a DNF is satisfiable Exercise 22 Describe a polynomial time algorithm for determining whether a CNF is a tautology Exercise 23 Give a proof of proposition 1 Exercise 24 Explain how Cook s theorem implies that checking in-equivalence between Boolean expressions is NP-hard Exercise 25 Explain how the question of tautology and satisfiability can be decided if we are given an algorithm for checking equivalence between Boolean expressions 3 Binary Decision Diagrams Let >b [ c be the if-then-else operator defined by >b [ c [ # d"# hence, b [ is true if and [ are true or if is false and is true We call the test expression All operators can easily be expressed using only the if-then-else operator and the constants and Moreover, this can be done in such a way that all tests are performed only on (un-negated) variables and variables occur in no other places Hence the operator gives rise to a new kind of normal form For example, is eb #, is eb fb #$ fb # Since variables must only occur in tests the Boolean expression is represented as eb An If-then-else Normal Form (INF) is a Boolean expression built entirely from the if-then-else operator and the constants and such that all tests are performed only on variables

10 3 BINARY DECISIN DIAGRAMS 9 If we by )*1+0 denote the Boolean expression obtained by replacing with in then it is not hard to see that the following equivalence holds: Eeb )g+0h )i,+0, (2) This is known as the Shannon expansion of with respect to This simple equation has a lot of useful applications The first is to generate an INF from any expression If contains no variables it is either equivalent to or which is an INF therwise we form the Shannon expansion of with respect to one of the variables in Thus since )*1+0 and )g+0 both contain one less variable than, we can recursively find INFs for both of these; call them [ and An INF for is now simply eb $ [ We have proved: Proposition 2 Any Boolean expression is equivalent to an expression in INF Example 1 Consider the Boolean expression jk d"# 7&# If we find an INF of by selecting in order the variables $ d-!2 _ on which to perform Shannon expansions, we get the expressions lmb - [ [ cjb [B[ cjb B$ [B[ nb [B[ $ [B[B[ B nb BB$ B [ [B[B[ 7ob [B[ 7ob B [ 7ob BB 7ob Figure 2 shows the expression as a tree Such a tree is also called a decision tree p A lot of the expressions are easily seen to be identical, so it is tempting to identify them For example, instead of B [ we can use [B[B[ and instead of BB we can use [B[ If we substitute [B[B[ for B [ in the right-hand side of B and also [B[ for BB, we in fact see that [B[ and B are identical, and in we can replace B with [B[ If we in fact identify all equal subexpressions we end up with what is known as a binary decision diagram (a BDD) It is no longer a tree of Boolean expressions but a directed acyclic graph (DAG) Applying this idea of sharing, can now be written as: lmb - [ [ cjb [B[ cjb [B[ [B[ nb [B[ $ [B[B[ [B[B[ 7ob [B[ 7ob

11 3 BINARY DECISIN DIAGRAMS 10 t s t t s q,r u/r u/r q7v q7v u$v u$v u$v u$v s t t s t Figure 2: A decision tree for cl# lines high-branches _-# Dashed lines denote low-branches, solid Each subexpression can be viewed as the node of a graph Such a node is either terminal in the case of the constants and, or non-terminal A non-terminal node has a low-edge corresponding to the else-part and a high-edge corresponding to the then-part See figure 3 Notice, that the number of nodes has decreased from w in the decision tree to x in the BDD It is not hard to imagine that if each of the terminal nodes were other big decision trees the savings would be dramatic Since we have chosen to consistently select variables in the same order in the recursive calls during the construction of the INF of, the variables occur in the same orderings on all paths from the root of the BDD In this situation the binary decision diagram is said to be ordered (an BDD) Figure 3 shows a BDD that is also an BDD Figure 4 shows four BDDs Some of the tests (eg, on in y ) are redundant, since both the low- and high-branch lead to the same node Such unnecessary tests can be removed: any reference to the redundant node is simply replaced by a reference to its subnode If all identical nodes are shared and all redundant tests are eliminated, the BDD is said to be reduced (an RBDD) RBDDs have some very convenient properties centered around the canonicity lemma below (ften when people speak about BDDs they really mean RBDDs) To summarize:

12 3 BINARY DECISIN DIAGRAMS 11 ~ ~ ~ s z s z s { z\{ z@{ Figure 3: A BDD for c"# drawn as dotted lines and high-edges as solid lines } ~ _-# with ordering 9 co9 9 7 Low-edges are s s s ƒ{ { m } ~ a b c d Figure 4: Four BDDs: a) An BDD for b) Another BDD for with two redundant tests c) Same as y with one of the redundant tests removed d) An BDD for with one redundant test

13 3 BINARY DECISIN DIAGRAMS 12 Š Š Š u q ( 3 ( q ˆu q q q q Figure 5: The ordering and reducedness conditions of RBDDs Left: Variables must be ordered Middle: Nodes must be unique Right: nly non-redundant tests should be present A Binary Decision Diagram (BDD) is a rooted, directed acyclic graph with one or two terminal nodes of out-degree zero labeled 0 or 1, and a set of variable nodes of out-degree two The two outgoing edges are given by two functions ŒŽ # and c # (In pictures, these are shown as dotted and solid lines, respectively) A variable 7 # is associated with each variable node A BDD is rdered (BDD) if on all paths through the graph the variables respect a given linear order 9 9 D2D2D 9 ( An ()BDD is Reduced (R()BDD) if Š (uniqueness) no two distinct nodes and have the same variable name and low- and high-successor, ie, 7 # 7 #$ ŒŽ # ŒŽ #- c # c # implies and (non-redundant tests) no variable node has identical low- and highsuccessor, ie, ŒŽ # š c #\ The ordering and reducedness conditions are shown in figure 5 RBDDs have some interesting properties They provide compact representations of Boolean expressions, and there are efficient algorithms for performing all kinds of logical operations on RBDDs They are all based on the crucial fact that for any function b 3 there is exactly one RBDD representing it This means, in particular, that there is exactly one RBDD for the constant true (and constant false) function on 3 : the terminal node (and in case of false) Hence, it is possible to test in constant time whether an RBDD is constantly true or false (Recall that for Boolean expressions this problem is NP-complete) To make this claim more precise we must say what we mean for an RBDD to represent a function First, it is quite easy to see how the nodes of an RBDD inductively defines Boolean expressions Bœ : A terminal node is a Boolean constant A non-terminal node marked with is an if-then-else expression where the condition is and the two branches are the Boolean expressions given by the low- or high-son, respectively: [ œ 7 #jb " "ž Ÿ / œ' B œ/ if is a variable node

14 3 BINARY DECISIN DIAGRAMS 13 œ š œ 3 œ ( ² œ ( ² 3 Moreover, if n9 9 D2D2D 9 ( is the variable ordering of the RBDD, we associate with each node the function that maps y - y 2 / / y (1#n 3 to the truth value of Bœ )*y +& y + / / y ( +(70 We can now state the key lemma: Lemma 1 (Canonicity lemma) For any function D2D2D 9 ( such that œ b 3 there is exactly one RBDD with variable ordering $ / / "(,# 9? 9 Proof: The proof is by induction on the number of arguments of For 8 there are only two Boolean functions, the constantly false and constantly true functions Any RBDD containing at least one non-terminal node is non-constant (Why?) Therefore there is exactly one RBDD for each of these: the terminals and Assume now that we have proven the lemma for all functions ( «@ of 8 arguments We proceed to show it for all functions of 8 ª arguments Let b 3 be any Boolean function of 8 arguments Define the two functions [ and of 8 arguments by fixing the first argument of to respectively : 2 / '!( «@!# y "2 $!(2«@!# for y 3 (Sometimes [ and are called the negative and positive co-factors of with respect to ) These functions satisfy the following equation: - / / "(,# mb / / "(,#- [ 2 '!(1#\ (3) Since [ and take only 8 arguments we assume by induction that there are unique RBDD nodes [ and œ' with [ œ G and There are two cases to consider If [ œ' n œ G then and [ œ' o œ G Hence [ is an RBDD for It is also the only RBDD for since due to the ordering, if is at all present in the RBDD rooted at, would need to be the root node However, if then [ J œ' )i,+b0 and "ž ŸW œ' ) 2+J0 Since [ œ$ œ G by assumption, the low- and high-son of would be the same, making the RBDD violate the reducedness condition of non-redundant tests If [ œ then š œ G by the induction hypothesis (using the names 2 / '!( «@ in place of $ / /!( ) We take to be the node with 7 #, ŒŽ # [, and c #, ie, œ ƒb œ G œ$which is reduced By assumption œ$ œ G and [ therefore œ± using (3) we get Suppose that is some other node with ² Clearly, ² must depend on, ie, ²_)i,+J0³š ²1)g+ 0 (otherwise also [ ²1)i,+ 0 ²_)g+J0, a contradiction) Due to the ordering this means that 7 # 7 # Moreover, from J ² it follows that [ œ$and œ G "ž ŸW /, which by the induction hypothesis implies that ŒŽ # [ ŒŽ # and c # c # From the reducedness property of uniqueness it follows that p An immediate consequence is the following Since the terminal is an RBDD for all variable orderings it is the only RBDD that is constantly true So in order to check whether an RBDD is constantly true it suffices to check whether it is the terminal which is definitely a constant time operation Similarly, RBDDs that are constantly false must be identical to the terminal In fact, to determine whether two Boolean functions are the same, it suffices to construct their RBDDs (in the same graph) and check whether the resulting nodes are the same!

15 3 BINARY DECISIN DIAGRAMS 14 º ( ` ~ The ordering of variables chosen when constructing an RBDD has a great impact on the size of the RBDD If we consider again the expression d"# _-# and construct an RBDD using the ordering 9 f9µ c 9µ _ the RBDD consists of w nodes (figure 6) and not x nodes as for the ordering n9 c 9 9? 7 (figure 3) s { { z s z s z s z s z@{ z@{ Figure 6: The RBDD for d"# _-# with variable ordering n9 9? d 9? 7 Exercise 31 Show how to express all operators from the if-then-else operator and the constants and Exercise 32 Draw the RBDDs for cl# 7&# n9 9 9? do and n9 co ? 7 7&# with orderings Exercise 33 Draw the RBDDs for d"# _-# with orderings o9 9? co9 _ and o9? co9 9 7 How does it compare with the example in figures 3 and 6? Based on the examples you have seen so far, what variable ordering would you recommend for constructing a small RBDD for d"# 7-# 7-# ED2D2D F F #? Exercise 34 Give an example of a sequence of RBDDs (Q ¹8 which induces exponentially bigger decision trees Ie, if ( has size º 8 # then the decision tree should have size # Exercise 35 Construct an RBDD of maximum size over six variables

16 4 CNSTRUCTING AND MANIPULATING RBDDS 15 Á  À À  `  » ½¼ b ] &¾B - # var ŒŽ c ` Á Á À ` Á x à ` Á À x Figure 7: Representing an RBDD with ordering 9Ä 9? 9? The numbers inside the vertices are the identities used in the representation The numbers and are reserved for the terminal nodes The numbers to the right of the RBDD shows the index of the variables in the ordering The constants are assigned an index which is the number of variables in the ordering plus one (here Á ª À ) This makes some subsequent algorithms easier to present The lowand high-fields are unused for the terminal nodes 4 Constructing and Manipulating RBDDs In the previous section we saw how to construct an BDD from a Boolean expression by a simple recursive procedure The question arises now how do we construct a reduced BDD? ne way is to first construct an BDD and then proceed by reducing it Another more appealing approach, which we follow here, is to reduce the BDD during construction To describe how this is done we will need an explicit representation of RBDDs Nodes will be represented as numbers ` / with and reserved for the terminal nodes The variables in the ordering E9Å9 D2D2D 9Å( are represented by their indices ` / ' 8 The RBDD is stored in a table» Ƽ b ] &¾B - # which maps a node to its three attributes 7 # ], ŒŽ # ¾, and c # Figure 7 shows the representation of the RBDD from figure 3 (with the variable names changed to ) 41 MK In order to ensure that the BDD being constructed is reduced, it is necessary to determine from a triple ] &¾B - # whether there exists a node with 7 # ] ŒŽ # ¾, and c # For this purpose we assume the presence of a table Ç ] &¾B - # ¼ b mapping triples ] &¾B - # of variable indices ], and nodes ¾B - to nodes The table Ç is the inverse of the table», ie, for variable nodes,» # È ] &¾B - #, if and only if, Ç ] ¾J & # The operations needed on the

17 4 CNSTRUCTING AND MANIPULATING RBDDS 16 Ç» MK) Ç 0 ] &¾B - # 1: if ¾ then return ¾ 2: else if member Ç ] &¾B - # then 3: return lookup Ç ] ¾J & # 4: else >É add» ] &¾B - # 5: insert Ç ] &¾B - # 6: ÊËdÌ2ÍÎÊ Ïe» Figure 8: The function MK) Ç 0 ] &¾B - # two tables are:» >¼ b ] &¾B - # init» # initialize» to contain only and >É add» ] &¾B - # allocate a new node with attributes ] &¾B - # 7 #$ ŒŽ #$ c # lookup the attributes of in» ] &¾B - # ¼ b init Ç # initialize Ç to be empty yé member Ç ] &¾B - # check if ] &¾B - # is in Ç >É lookup Ç ] &¾B - # find Ç ] ¾J & # insert Ç ] &¾B - # make ] ¾J & # map to in Ç We shall assume that all these operations can be performed in constant time, Ð will show how such a low complexity can be achieved» The function MK) Ç 0 # Section 5 ] ¾J & # (see figure 8) searches the table Ç for a node with variable index ] and low-, high-branches ¾B - and returns a matching node if one exists therwise it creates a new node, inserts it into Ç and returns the identity of it The running time of MK is Ð # due to the assumptions on the basic operations on» and Ç The BDD is ensured to be reduced if nodes are only created through the use of MK In describing MK and subsequent» algorithms, we make use of the notation ) Ç 0 to indicate that MK depends on the global data structures» and Ç, but we leave out the arguments when invoking it as part of other algorithms 42 BUILD The construction of an RBDD from a given Boolean expression proceeds as in the construction of an if-then-else normal form (INF) in section 2 An ordering of the variables Ñ9 D2D2D 9 ( is fixed Using the Shannon expansion b ) 2+J0W )*,+J0, a node for is constructed by a call to MK, after the nodes for )i,+j0 and )g+b0 have been constructed by recursion The algorithm is shown in figure 9 The call BUILD C ] # constructs an RBDD for a Boolean expression with variables in 4! «@- / /!( 6 It does so by first recursively constructing RBDDs [ and for )i,+ 0 and )g+ 0 in lines 4 and 5, and then proceeding to find the identity of the node for in line 6 Notice that if [ and are identical, or if there already is a node with the same ], [ and, no new node is created

18 4 CNSTRUCTING AND MANIPULATING RBDDS 17 (» BUILD) Ç 0 H # 1: function BUILD C ] # = 2: if ]ƒò 8 then 3: if is false then return 0 else return 1 4: else [ É BUILD H )*1+ 0h ]@ ª # 5: É BUILD H ) + 0h ] ª # 6: Ê Ë,ÌÍ Ê Ï MK ] [!# 7: end BUILD 8: 9: return BUILD H # Figure 9: Algorithm for building an RBDD from a Boolean expression using the ordering 9;Ó9 D2D2D 9ª( In a call BUILD C ] #, ] is the lowest index that any variable of can have Thus when the test ]ÒÔ8 succeeds, contains no variables and must be either constantly false or true An example of using BUILD to compute an RBDD is shown in figure 10 The running time of BUILD is bad It is easy to see that for a variable ordering with 8 variables there will always be generated on the order of ` calls 43 APPLY All the binary Boolean operators on RBDDs are implemented by the same general algorithm NÕ-Ö APPLY & -# that for two RBDDs computes the RBDD for the Boolean expression Bœ G Õ&ÖÑBœ' The construction of APPLY is based on the Shannon expansion (2): Eeb )g+0h )i,+0, bserve that for all Boolean operators op the following holds: eb - $# Õ-Ö>eb A A # >b Õ&ÖØ A Õ&ÖÑ A (4) If we start from the root of the two RBDDs we can construct the RBDD of the result by recursively constructing the low- and the high-branches and then form the new root from these Again, to ensure that the result is reduced, we create the node through a call to MK Moreover, to avoid an exponential blow-up of recursive calls, dynamic programming is used The algorithm is shown in figure 11 Dynamic programming is implemented using a table of results Ù Each entry ] BÚc# is either empty or contains the earlier computed result of APP ] BÚc# The algorithm distinguishes between four different cases, the first of them handles the situation where both arguments are terminal nodes, the remaining three handle the situations where at least one argument is a variable node If both and are terminal, a new terminal node is computed having the value of op applied to the two truth values (Recall, that terminal node is represented by a node with identity and similarly for )

19 4 CNSTRUCTING AND MANIPULATING RBDDS 18 ~ } b Û Û*ÜQÞ½ÜWâ'ãà"äJå èhâ d Û ÛÝÜßÞ>à!áNâ$ãà!äBå v â Û ÛÝÜßÞ r â$ãà"äjå èwâ BUILD Û Ûæà çqþ>à!ánâ$ãà!äbå r â c g e Û Û r Þ½ÜWâ$ãà!äBåŽèhâ f Û Û r Þeà!áNâ$ã\à!äJå v â e Û Û r Þ r â'ãà"äjå èhâ Û Û*ÜQÞ½ÜWâ'ã\ÜLå é â Û Û*ÜQÞ r â$ã\ü"å é â Û Û*ÜßÞ½Ü â$ã r å é â Û Û r Þ½Ü â$ã\ü"å é â Û Û*ÜcÞ r â$ã r å é â Û Û r Þ r â$ã\ü"å é â Û Û r Þ½ÜWâ/ã r å é â Û Û r Þ r â'ã r å é â a ƒ{ ~ ~ } b c d s { { { { { ~ } ~ } ~ } e f g Figure 10: Using BUILD on the expression $# (a) The tree of calls to BUILD (b) The RBDD after the call BUILD! Ñ #  # (c) After the call BUILD " Ñ #  # (d) After the call BUILD! ±$# 2 ` # (e) After the calls BUILD! ˆ # 2  # and BUILD " # 2  # (f) After the call BUILD! $# 2 ` # (g) The final result

20 4 CNSTRUCTING AND MANIPULATING RBDDS 19» APPLY) Ç 0 hõ&ö -# 1: init Ù # 2: 3: ê Í%ÏÎë7ÌìCí@Ï APP - # 4: ìcêù - &# š empty Ìî ËßÏeÊË,ÌÍÎÊ Ï±Ù - -# 5: Ëcïhð'ËñìCêo o 4 _6òÏÎóô 4 Õ-Ö 76oÌîÎËcÏ u É - -# 6: Ëcïhð'ËñìCê var "# var -# ÌîÎËcÏ 7: u É MK var "#- APP ŒŽ "#$ ŒŽ -#!#- APP c "#- c 8 Ëcïhð'ËñìCê var "#n9 var -# ÌîÎËcÏ 9 u É MK var "#- APP ŒŽ "#$ -#- APP c "#- -#!# õ 10: Ëcïhð'Ë var "# Ò var -# õ # 11: u É MK var -#- APP - ŒŽ -#!#- APP - c &#!#!# 12: Ù - -# É u 13: ÊË,ÌÍÎÊ Ï u 14: ËcÏÎó APP 15: 16: return APP - -#» Figure 11: The algorithm APPLY ) Ç 0 hõ&ö & # &#!#"# If at least one of and are non-terminal, we proceed according to the variable index If the nodes have the same index, the two low-branches are paired and APP recursively computed on them Similarly for the high-branches This corresponds exactly to the case shown in equation (4) If they have different indices, we proceed by pairing the node with lowest index with the low- and high-branches of the other This corresponds to the equation b $ -# op 5 b op op (5) which holds for all Since we have taken the index of the terminals to be one larger than the index of the non-terminals, the last two cases, 7 "#n9 7 -# and 7 "# ÒÔ 7 -#, take account of the situations where one of the nodes is a terminal Figure 12 shows an example of applying the algorithm on two small RBDDs Notice how pairs of nodes from the two RBDDs are combined and computed To analyze the complexity of APPLY we let denote the number of nodes that can be reached from in the RBDD Assume that Ù can be implemented with constant lookup and insertion times (See section 5 for details on how to achieve this) Due to the dynamic programming at most 2 _ calls to APPLY are generated Each call takes constant time The total running time is therefore Ð /2 _ # 44 RESTRICT The next operation we consider is the restriction of a RBDD That is, given a truth assignment, for example )i,+2 +ö 2+!0, we want to compute the RBDD for Bœ under this

21 4 CNSTRUCTING AND MANIPULATING RBDDS 20 ü ý ø G ø ø-ù ø-ú ø$û ,5 ø G 3,2 2,2 0,2 5,3 0,0 4,0 6,3 2,0 0,2 0,3 0,0 0,1 0,4 0,2 7,4 5,4 3,0 2,0 0,1 0,2 4,2 2,2 ø ø ù ø-ú ø$û 1,1 0,0 0,1 0,0 1,0 0,0 Figure 12: An example of applying the algorithm APPLY for computing the conjunction of the two RBDDs shown at the top left The result is shown to the right Below the tree of arguments to the recursive calls of APP Dashed nodes indicate that the value of the node has previously been computed and is not recomputed due to the use of dynamic programming The solid ellipses show calls that finishes by a call to MK with the variable index indicated by the variables to the right of the tree

22 4 CNSTRUCTING AND MANIPULATING RBDDS 21» RESTRICT) Ç 0 BÚ1 y # = 1: function res # = 2: ìnê 7 # Ò Ú Ì2îÎËcÏeÊ Ë,ÌÍ Ê Ï> 3: ËßïNð/ËÓìCê 7 #o9ú Ìî ËcϱÊË,ÌÍ Ê_Ï MK 7 #$ res ŒŽ 4: ËßïNð/Ë (* 7 # Ú *) ìcêy ÌîÎËcÏeÊËdÌ2ÍÎÊ Ï res ŒŽ 5: ËßïNð/Ë (* 7 6: end res 7: return res # # Ú1 y Figure 13: The algorithm RESTRICT ) *) ÊË,ÌÍÎÊ Ï res c #"# #"#$ res c #!# #"#!#» Ç 0 Ú1 y # which computes an RBDD for Bœ ) Ú +7y 0 restriction, ie, find the RBDD for œ )i,+ 2+ö +!0 As an example consider the RBDD of figure 10(g) (repeated below to the left) representing the Boolean expression -# Restricting it with respect to the truth assignment )i,+ 0 yields an RBDD for -# It is constructed by replacing each occurrence of a node with label by its left branch yielding the RBDD at the right: x1 x2 x2 x1 x3 x The algorithm again uses MK to ensure that the resulting BDD is reduced Figure 13 shows the algorithm in the case where only singleton truth assignments ()*y$+ M 0, y 4 76 ) are allowed Intuitively, in computing RESTRICT BÚ1 y # we search for all nodes with 7 Ú and replace them by their low- or high-son depending on y Since this might force nodes above the point of replacemen to become equal, it is followed by a reduction (through the calls to MK) Due to the two recursive calls in line 3, the algorithm has an exponential running time, see exercise 47 for an improvement that reduces this to linear time 45 SATCUNT, ANYSAT, ALLSAT In this section we consider operations to examine the set of satisfying truth assignments of a node A truth assignment þ satisfies a node if Bœ )iþ 0 can be evaluated to using the truth tables of the Boolean operators Formally, the satisfying truth assignments is the set sat # : sat # ÿ4 þ ø G ø 3 œ )iþ 0 is true 6 ø G ø where 3 denotes the set of all truth assignments for variables 4 - / / "( 6, ie, functions from 4 $ $!( 4 6 to the truth values 3 76 The first algorithm, SATCUNT, computes the size of sat #, see figure 14 The algorithm exploits the following fact If is a node

23 4 CNSTRUCTING AND MANIPULATING RBDDS 22 ) ` œ» SATCUNT) 0 # 1: function count # 2: if then res É 3: else if then res É B œ' ^ 4: else res É ` "ž Ÿ œ' ^ 5: return res 6: end count 7: 8: return ` œ' ^ õ ;` count # œ' ^ õ count ŒŽ #"# œ' ^ õ count c Figure 14: An algorithm for determining the number of valid truth assignments Recall, that the variable index 7 of and in the RBDD representation is 8ˆ Ä when the ordering contains 8 variables (numbered through 8 ) This means that var # and var # always gives 8 ; #!# with variable index 7 # then two sets of truth assignments can make true The first set has 7 _ equal to, the other has 7 equal to For the first set, the number is found by finding the number of truth assignments count ŒŽ #"# making ŒŽ # true All variables between 7 # and 7 ŒŽ #!# in the ordering can be chosen arbitrarily, therefore in the case of B œ' ^ œ' ^ õ 7 being, a total of ` count ŒŽ #"# satisfying truth assignments exists To be efficient, dynamic programming should be applied in SATCUNT (see exercise 410) ANYSAT # 1: if then Error 2: else if 3: else if ŒŽ # 4: else return ) then return ) 0 then return ) œ' ¼ b ANYSAT c œ' ¼ b ANYSAT ŒŽ #!#J0 Figure 15: An algorithm for returning a satisfying truth-assignment The variables are assumed to be $ / /!( ordered in this way #"#J0 The next algorithm ANYSAT in figure 15 finds a satisfying truth assignment Some irrelevant variables present in the ordering might not appear in the result and they can be assigned any value whatsoever ANYSAT simply finds a path leading to 1 by a depth-first traversal, prefering somewhat arbitrarily low-edges over high-edges It is particularly simple due to the observation that if a node is not the terminal 0, it has at least one path leading to 1 The running time is clearly linear in the result ALLSAT in figure 16 finds all satisfying truth-assignments leaving out irrelevant variables from the ordering ALLSAT # finds all paths from a node to the terminal The running time is linear in the size of the result multiplied with the time to add the single assignments œ/ ¼ b 0 and ) œ' ¼ b 0 in front of a list of up to 8 elements However, the result can be exponentially large in œ, so the running time is the poor Ð 8 #

An Introduction to Binary Decision Diagrams Henrik Reif Andersen x y y z 1 0 Lecture notes for 49285 Advanced Algorithms E97, October 1997. (Minor revisions, Apr. 1998) E-mail: hra@it.dtu.dk. Web: http://www.it.dtu.dk/hra

More information

The Classes P and NP

The Classes P and NP The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the

More information

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding

More information

Offline 1-Minesweeper is NP-complete

Offline 1-Minesweeper is NP-complete Offline 1-Minesweeper is NP-complete James D. Fix Brandon McPhail May 24 Abstract We use Minesweeper to illustrate NP-completeness proofs, arguments that establish the hardness of solving certain problems.

More information

Mathematical Induction

Mathematical Induction Mathematical Induction In logic, we often want to prove that every member of an infinite set has some feature. E.g., we would like to show: N 1 : is a number 1 : has the feature Φ ( x)(n 1 x! 1 x) How

More information

NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

More information

CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

More information

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B KITCHENS The equation 1 Lines in two-dimensional space (1) 2x y = 3 describes a line in two-dimensional space The coefficients of x and y in the equation

More information

Discuss the size of the instance for the minimum spanning tree problem.

Discuss the size of the instance for the minimum spanning tree problem. 3.1 Algorithm complexity The algorithms A, B are given. The former has complexity O(n 2 ), the latter O(2 n ), where n is the size of the instance. Let n A 0 be the size of the largest instance that can

More information

3. Mathematical Induction

3. Mathematical Induction 3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

More information

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

More information

Chapter 1. NP Completeness I. 1.1. Introduction. By Sariel Har-Peled, December 30, 2014 1 Version: 1.05

Chapter 1. NP Completeness I. 1.1. Introduction. By Sariel Har-Peled, December 30, 2014 1 Version: 1.05 Chapter 1 NP Completeness I By Sariel Har-Peled, December 30, 2014 1 Version: 1.05 "Then you must begin a reading program immediately so that you man understand the crises of our age," Ignatius said solemnly.

More information

Determination of the normalization level of database schemas through equivalence classes of attributes

Determination of the normalization level of database schemas through equivalence classes of attributes Computer Science Journal of Moldova, vol.17, no.2(50), 2009 Determination of the normalization level of database schemas through equivalence classes of attributes Cotelea Vitalie Abstract In this paper,

More information

Lecture 1: Course overview, circuits, and formulas

Lecture 1: Course overview, circuits, and formulas Lecture 1: Course overview, circuits, and formulas Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: John Kim, Ben Lund 1 Course Information Swastik

More information

Lecture 7: NP-Complete Problems

Lecture 7: NP-Complete Problems IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 7: NP-Complete Problems David Mix Barrington and Alexis Maciel July 25, 2000 1. Circuit

More information

Exponential time algorithms for graph coloring

Exponential time algorithms for graph coloring Exponential time algorithms for graph coloring Uriel Feige Lecture notes, March 14, 2011 1 Introduction Let [n] denote the set {1,..., k}. A k-labeling of vertices of a graph G(V, E) is a function V [k].

More information

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly

More information

One last point: we started off this book by introducing another famously hard search problem:

One last point: we started off this book by introducing another famously hard search problem: S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 261 Factoring One last point: we started off this book by introducing another famously hard search problem: FACTORING, the task of finding all prime factors

More information

Analysis of Algorithms, I

Analysis of Algorithms, I Analysis of Algorithms, I CSOR W4231.002 Eleni Drinea Computer Science Department Columbia University Thursday, February 26, 2015 Outline 1 Recap 2 Representing graphs 3 Breadth-first search (BFS) 4 Applications

More information

Handout #1: Mathematical Reasoning

Handout #1: Mathematical Reasoning Math 101 Rumbos Spring 2010 1 Handout #1: Mathematical Reasoning 1 Propositional Logic A proposition is a mathematical statement that it is either true or false; that is, a statement whose certainty or

More information

Quotient Rings and Field Extensions

Quotient Rings and Field Extensions Chapter 5 Quotient Rings and Field Extensions In this chapter we describe a method for producing field extension of a given field. If F is a field, then a field extension is a field K that contains F.

More information

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Complexity Theory IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Outline Goals Computation of Problems Concepts and Definitions Complexity Classes and Problems Polynomial Time Reductions Examples

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms

More information

The Characteristic Polynomial

The Characteristic Polynomial Physics 116A Winter 2011 The Characteristic Polynomial 1 Coefficients of the characteristic polynomial Consider the eigenvalue problem for an n n matrix A, A v = λ v, v 0 (1) The solution to this problem

More information

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic Lars Birkedal Rasmus Ejlers Møgelberg Rasmus Lerchedahl Petersen IT University Technical Report Series TR-00-7 ISSN 600 600 February 00

More information

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation: CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm

More information

2.1 Complexity Classes

2.1 Complexity Classes 15-859(M): Randomized Algorithms Lecturer: Shuchi Chawla Topic: Complexity classes, Identity checking Date: September 15, 2004 Scribe: Andrew Gilpin 2.1 Complexity Classes In this lecture we will look

More information

1 Sets and Set Notation.

1 Sets and Set Notation. LINEAR ALGEBRA MATH 27.6 SPRING 23 (COHEN) LECTURE NOTES Sets and Set Notation. Definition (Naive Definition of a Set). A set is any collection of objects, called the elements of that set. We will most

More information

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m) Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.

More information

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Why? A central concept in Computer Science. Algorithms are ubiquitous. Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

More information

A Working Knowledge of Computational Complexity for an Optimizer

A Working Knowledge of Computational Complexity for an Optimizer A Working Knowledge of Computational Complexity for an Optimizer ORF 363/COS 323 Instructor: Amir Ali Ahmadi TAs: Y. Chen, G. Hall, J. Ye Fall 2014 1 Why computational complexity? What is computational

More information

Generating models of a matched formula with a polynomial delay

Generating models of a matched formula with a polynomial delay Generating models of a matched formula with a polynomial delay Petr Savicky Institute of Computer Science, Academy of Sciences of Czech Republic, Pod Vodárenskou Věží 2, 182 07 Praha 8, Czech Republic

More information

Chapter. NP-Completeness. Contents

Chapter. NP-Completeness. Contents Chapter 13 NP-Completeness Contents 13.1 P and NP......................... 593 13.1.1 Defining the Complexity Classes P and NP...594 13.1.2 Some Interesting Problems in NP.......... 597 13.2 NP-Completeness....................

More information

Simulation-Based Security with Inexhaustible Interactive Turing Machines

Simulation-Based Security with Inexhaustible Interactive Turing Machines Simulation-Based Security with Inexhaustible Interactive Turing Machines Ralf Küsters Institut für Informatik Christian-Albrechts-Universität zu Kiel 24098 Kiel, Germany kuesters@ti.informatik.uni-kiel.de

More information

Lecture 3: Finding integer solutions to systems of linear equations

Lecture 3: Finding integer solutions to systems of linear equations Lecture 3: Finding integer solutions to systems of linear equations Algorithmic Number Theory (Fall 2014) Rutgers University Swastik Kopparty Scribe: Abhishek Bhrushundi 1 Overview The goal of this lecture

More information

You know from calculus that functions play a fundamental role in mathematics.

You know from calculus that functions play a fundamental role in mathematics. CHPTER 12 Functions You know from calculus that functions play a fundamental role in mathematics. You likely view a function as a kind of formula that describes a relationship between two (or more) quantities.

More information

Integer roots of quadratic and cubic polynomials with integer coefficients

Integer roots of quadratic and cubic polynomials with integer coefficients Integer roots of quadratic and cubic polynomials with integer coefficients Konstantine Zelator Mathematics, Computer Science and Statistics 212 Ben Franklin Hall Bloomsburg University 400 East Second Street

More information

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

More information

Bounded Treewidth in Knowledge Representation and Reasoning 1

Bounded Treewidth in Knowledge Representation and Reasoning 1 Bounded Treewidth in Knowledge Representation and Reasoning 1 Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien Luminy, October 2010 1 Joint work with G.

More information

CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e.

CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e. CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e. This chapter contains the beginnings of the most important, and probably the most subtle, notion in mathematical analysis, i.e.,

More information

A Propositional Dynamic Logic for CCS Programs

A Propositional Dynamic Logic for CCS Programs A Propositional Dynamic Logic for CCS Programs Mario R. F. Benevides and L. Menasché Schechter {mario,luis}@cos.ufrj.br Abstract This work presents a Propositional Dynamic Logic in which the programs are

More information

Indiana State Core Curriculum Standards updated 2009 Algebra I

Indiana State Core Curriculum Standards updated 2009 Algebra I Indiana State Core Curriculum Standards updated 2009 Algebra I Strand Description Boardworks High School Algebra presentations Operations With Real Numbers Linear Equations and A1.1 Students simplify and

More information

ON THE COMPLEXITY OF THE GAME OF SET. {kamalika,pbg,dratajcz,hoeteck}@cs.berkeley.edu

ON THE COMPLEXITY OF THE GAME OF SET. {kamalika,pbg,dratajcz,hoeteck}@cs.berkeley.edu ON THE COMPLEXITY OF THE GAME OF SET KAMALIKA CHAUDHURI, BRIGHTEN GODFREY, DAVID RATAJCZAK, AND HOETECK WEE {kamalika,pbg,dratajcz,hoeteck}@cs.berkeley.edu ABSTRACT. Set R is a card game played with a

More information

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs CSE599s: Extremal Combinatorics November 21, 2011 Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs Lecturer: Anup Rao 1 An Arithmetic Circuit Lower Bound An arithmetic circuit is just like

More information

The Goldberg Rao Algorithm for the Maximum Flow Problem

The Goldberg Rao Algorithm for the Maximum Flow Problem The Goldberg Rao Algorithm for the Maximum Flow Problem COS 528 class notes October 18, 2006 Scribe: Dávid Papp Main idea: use of the blocking flow paradigm to achieve essentially O(min{m 2/3, n 1/2 }

More information

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS Systems of Equations and Matrices Representation of a linear system The general system of m equations in n unknowns can be written a x + a 2 x 2 + + a n x n b a

More information

Math 312 Homework 1 Solutions

Math 312 Homework 1 Solutions Math 31 Homework 1 Solutions Last modified: July 15, 01 This homework is due on Thursday, July 1th, 01 at 1:10pm Please turn it in during class, or in my mailbox in the main math office (next to 4W1) Please

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a

More information

Notes on Factoring. MA 206 Kurt Bryan

Notes on Factoring. MA 206 Kurt Bryan The General Approach Notes on Factoring MA 26 Kurt Bryan Suppose I hand you n, a 2 digit integer and tell you that n is composite, with smallest prime factor around 5 digits. Finding a nontrivial factor

More information

CS510 Software Engineering

CS510 Software Engineering CS510 Software Engineering Propositional Logic Asst. Prof. Mathias Payer Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-cs510-se

More information

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Mathematics Course 111: Algebra I Part IV: Vector Spaces Mathematics Course 111: Algebra I Part IV: Vector Spaces D. R. Wilkins Academic Year 1996-7 9 Vector Spaces A vector space over some field K is an algebraic structure consisting of a set V on which are

More information

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1. MATH10212 Linear Algebra Textbook: D. Poole, Linear Algebra: A Modern Introduction. Thompson, 2006. ISBN 0-534-40596-7. Systems of Linear Equations Definition. An n-dimensional vector is a row or a column

More information

Factoring & Primality

Factoring & Primality Factoring & Primality Lecturer: Dimitris Papadopoulos In this lecture we will discuss the problem of integer factorization and primality testing, two problems that have been the focus of a great amount

More information

Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs

Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs Kousha Etessami U. of Edinburgh, UK Kousha Etessami (U. of Edinburgh, UK) Discrete Mathematics (Chapter 6) 1 / 13 Overview Graphs and Graph

More information

6.852: Distributed Algorithms Fall, 2009. Class 2

6.852: Distributed Algorithms Fall, 2009. Class 2 .8: Distributed Algorithms Fall, 009 Class Today s plan Leader election in a synchronous ring: Lower bound for comparison-based algorithms. Basic computation in general synchronous networks: Leader election

More information

Topology-based network security

Topology-based network security Topology-based network security Tiit Pikma Supervised by Vitaly Skachek Research Seminar in Cryptography University of Tartu, Spring 2013 1 Introduction In both wired and wireless networks, there is the

More information

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA 90405 rkennedy@ix.netcom.

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA 90405 rkennedy@ix.netcom. Some Polynomial Theorems by John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA 90405 rkennedy@ix.netcom.com This paper contains a collection of 31 theorems, lemmas,

More information

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

More information

C H A P T E R. Logic Circuits

C H A P T E R. Logic Circuits C H A P T E R Logic Circuits Many important functions are naturally computed with straight-line programs, programs without loops or branches. Such computations are conveniently described with circuits,

More information

Notes on Determinant

Notes on Determinant ENGG2012B Advanced Engineering Mathematics Notes on Determinant Lecturer: Kenneth Shum Lecture 9-18/02/2013 The determinant of a system of linear equations determines whether the solution is unique, without

More information

Factorization Theorems

Factorization Theorems Chapter 7 Factorization Theorems This chapter highlights a few of the many factorization theorems for matrices While some factorization results are relatively direct, others are iterative While some factorization

More information

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

More information

OPRE 6201 : 2. Simplex Method

OPRE 6201 : 2. Simplex Method OPRE 6201 : 2. Simplex Method 1 The Graphical Method: An Example Consider the following linear program: Max 4x 1 +3x 2 Subject to: 2x 1 +3x 2 6 (1) 3x 1 +2x 2 3 (2) 2x 2 5 (3) 2x 1 +x 2 4 (4) x 1, x 2

More information

A first step towards modeling semistructured data in hybrid multimodal logic

A first step towards modeling semistructured data in hybrid multimodal logic A first step towards modeling semistructured data in hybrid multimodal logic Nicole Bidoit * Serenella Cerrito ** Virginie Thion * * LRI UMR CNRS 8623, Université Paris 11, Centre d Orsay. ** LaMI UMR

More information

Network (Tree) Topology Inference Based on Prüfer Sequence

Network (Tree) Topology Inference Based on Prüfer Sequence Network (Tree) Topology Inference Based on Prüfer Sequence C. Vanniarajan and Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology Madras Chennai 600036 vanniarajanc@hcl.in,

More information

Bounded-width QBF is PSPACE-complete

Bounded-width QBF is PSPACE-complete Bounded-width QBF is PSPACE-complete Albert Atserias 1 and Sergi Oliva 2 1 Universitat Politècnica de Catalunya Barcelona, Spain atserias@lsi.upc.edu 2 Universitat Politècnica de Catalunya Barcelona, Spain

More information

Model Checking: An Introduction

Model Checking: An Introduction Announcements Model Checking: An Introduction Meeting 2 Office hours M 1:30pm-2:30pm W 5:30pm-6:30pm (after class) and by appointment ECOT 621 Moodle problems? Fundamentals of Programming Languages CSCI

More information

NOTES ON LINEAR TRANSFORMATIONS

NOTES ON LINEAR TRANSFORMATIONS NOTES ON LINEAR TRANSFORMATIONS Definition 1. Let V and W be vector spaces. A function T : V W is a linear transformation from V to W if the following two properties hold. i T v + v = T v + T v for all

More information

Polynomial Degree and Lower Bounds in Quantum Complexity: Collision and Element Distinctness with Small Range

Polynomial Degree and Lower Bounds in Quantum Complexity: Collision and Element Distinctness with Small Range THEORY OF COMPUTING, Volume 1 (2005), pp. 37 46 http://theoryofcomputing.org Polynomial Degree and Lower Bounds in Quantum Complexity: Collision and Element Distinctness with Small Range Andris Ambainis

More information

How To Know If A Domain Is Unique In An Octempo (Euclidean) Or Not (Ecl)

How To Know If A Domain Is Unique In An Octempo (Euclidean) Or Not (Ecl) Subsets of Euclidean domains possessing a unique division algorithm Andrew D. Lewis 2009/03/16 Abstract Subsets of a Euclidean domain are characterised with the following objectives: (1) ensuring uniqueness

More information

JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004

JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004 Scientiae Mathematicae Japonicae Online, Vol. 10, (2004), 431 437 431 JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS Ondřej Čepeka and Shao Chin Sung b Received December May 12, 2003; revised February

More information

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Diagonalization Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee Background One basic goal in complexity theory is to separate interesting complexity

More information

Coverability for Parallel Programs

Coverability for Parallel Programs 2015 http://excel.fit.vutbr.cz Coverability for Parallel Programs Lenka Turoňová* Abstract We improve existing method for the automatic verification of systems with parallel running processes. The technique

More information

Sudoku as a SAT Problem

Sudoku as a SAT Problem Sudoku as a SAT Problem Inês Lynce IST/INESC-ID, Technical University of Lisbon, Portugal ines@sat.inesc-id.pt Joël Ouaknine Oxford University Computing Laboratory, UK joel@comlab.ox.ac.uk Abstract Sudoku

More information

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 17 Shannon-Fano-Elias Coding and Introduction to Arithmetic Coding

More information

9.2 Summation Notation

9.2 Summation Notation 9. Summation Notation 66 9. Summation Notation In the previous section, we introduced sequences and now we shall present notation and theorems concerning the sum of terms of a sequence. We begin with a

More information

Section 1.1. Introduction to R n

Section 1.1. Introduction to R n The Calculus of Functions of Several Variables Section. Introduction to R n Calculus is the study of functional relationships and how related quantities change with each other. In your first exposure to

More information

Discrete Mathematics. Hans Cuypers. October 11, 2007

Discrete Mathematics. Hans Cuypers. October 11, 2007 Hans Cuypers October 11, 2007 1 Contents 1. Relations 4 1.1. Binary relations................................ 4 1.2. Equivalence relations............................. 6 1.3. Relations and Directed Graphs.......................

More information

CMSC 858T: Randomized Algorithms Spring 2003 Handout 8: The Local Lemma

CMSC 858T: Randomized Algorithms Spring 2003 Handout 8: The Local Lemma CMSC 858T: Randomized Algorithms Spring 2003 Handout 8: The Local Lemma Please Note: The references at the end are given for extra reading if you are interested in exploring these ideas further. You are

More information

Lecture 4: AC 0 lower bounds and pseudorandomness

Lecture 4: AC 0 lower bounds and pseudorandomness Lecture 4: AC 0 lower bounds and pseudorandomness Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: Jason Perry and Brian Garnett In this lecture,

More information

The Set Data Model CHAPTER 7. 7.1 What This Chapter Is About

The Set Data Model CHAPTER 7. 7.1 What This Chapter Is About CHAPTER 7 The Set Data Model The set is the most fundamental data model of mathematics. Every concept in mathematics, from trees to real numbers, is expressible as a special kind of set. In this book,

More information

Linear Codes. Chapter 3. 3.1 Basics

Linear Codes. Chapter 3. 3.1 Basics Chapter 3 Linear Codes In order to define codes that we can encode and decode efficiently, we add more structure to the codespace. We shall be mainly interested in linear codes. A linear code of length

More information

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No. # 11 Block Cipher Standards (DES) (Refer Slide

More information

INCIDENCE-BETWEENNESS GEOMETRY

INCIDENCE-BETWEENNESS GEOMETRY INCIDENCE-BETWEENNESS GEOMETRY MATH 410, CSUSM. SPRING 2008. PROFESSOR AITKEN This document covers the geometry that can be developed with just the axioms related to incidence and betweenness. The full

More information

Random vs. Structure-Based Testing of Answer-Set Programs: An Experimental Comparison

Random vs. Structure-Based Testing of Answer-Set Programs: An Experimental Comparison Random vs. Structure-Based Testing of Answer-Set Programs: An Experimental Comparison Tomi Janhunen 1, Ilkka Niemelä 1, Johannes Oetsch 2, Jörg Pührer 2, and Hans Tompits 2 1 Aalto University, Department

More information

Tree-representation of set families and applications to combinatorial decompositions

Tree-representation of set families and applications to combinatorial decompositions Tree-representation of set families and applications to combinatorial decompositions Binh-Minh Bui-Xuan a, Michel Habib b Michaël Rao c a Department of Informatics, University of Bergen, Norway. buixuan@ii.uib.no

More information

Software Modeling and Verification

Software Modeling and Verification Software Modeling and Verification Alessandro Aldini DiSBeF - Sezione STI University of Urbino Carlo Bo Italy 3-4 February 2015 Algorithmic verification Correctness problem Is the software/hardware system

More information

Chapter 7 Uncomputability

Chapter 7 Uncomputability Chapter 7 Uncomputability 190 7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction

More information

Chapter 7: Products and quotients

Chapter 7: Products and quotients Chapter 7: Products and quotients Matthew Macauley Department of Mathematical Sciences Clemson University http://www.math.clemson.edu/~macaule/ Math 42, Spring 24 M. Macauley (Clemson) Chapter 7: Products

More information

How To Find Out What A Key Is In A Database Engine

How To Find Out What A Key Is In A Database Engine Database design theory, Part I Functional dependencies Introduction As we saw in the last segment, designing a good database is a non trivial matter. The E/R model gives a useful rapid prototyping tool,

More information

PYTHAGOREAN TRIPLES KEITH CONRAD

PYTHAGOREAN TRIPLES KEITH CONRAD PYTHAGOREAN TRIPLES KEITH CONRAD 1. Introduction A Pythagorean triple is a triple of positive integers (a, b, c) where a + b = c. Examples include (3, 4, 5), (5, 1, 13), and (8, 15, 17). Below is an ancient

More information

Compact Representations and Approximations for Compuation in Games

Compact Representations and Approximations for Compuation in Games Compact Representations and Approximations for Compuation in Games Kevin Swersky April 23, 2008 Abstract Compact representations have recently been developed as a way of both encoding the strategic interactions

More information

The Basics of Graphical Models

The Basics of Graphical Models The Basics of Graphical Models David M. Blei Columbia University October 3, 2015 Introduction These notes follow Chapter 2 of An Introduction to Probabilistic Graphical Models by Michael Jordan. Many figures

More information

Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi

Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi Lecture - 9 Basic Scheduling with A-O-A Networks Today we are going to be talking

More information

Lecture 2: Universality

Lecture 2: Universality CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal

More information

KNOWLEDGE FACTORING USING NORMALIZATION THEORY

KNOWLEDGE FACTORING USING NORMALIZATION THEORY KNOWLEDGE FACTORING USING NORMALIZATION THEORY J. VANTHIENEN M. SNOECK Katholieke Universiteit Leuven Department of Applied Economic Sciences Dekenstraat 2, 3000 Leuven (Belgium) tel. (+32) 16 28 58 09

More information

2 Temporal Logic Model Checking

2 Temporal Logic Model Checking Bounded Model Checking Using Satisfiability Solving Edmund Clarke 1, Armin Biere 2, Richard Raimi 3, and Yunshan Zhu 4 1 Computer Science Department, CMU, 5000 Forbes Avenue Pittsburgh, PA 15213, USA,

More information

each college c i C has a capacity q i - the maximum number of students it will admit

each college c i C has a capacity q i - the maximum number of students it will admit n colleges in a set C, m applicants in a set A, where m is much larger than n. each college c i C has a capacity q i - the maximum number of students it will admit each college c i has a strict order i

More information

Fairness in Routing and Load Balancing

Fairness in Routing and Load Balancing Fairness in Routing and Load Balancing Jon Kleinberg Yuval Rabani Éva Tardos Abstract We consider the issue of network routing subject to explicit fairness conditions. The optimization of fairness criteria

More information

Reading 13 : Finite State Automata and Regular Expressions

Reading 13 : Finite State Automata and Regular Expressions CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

More information