An Introduction to Binary Decision Diagrams


 Kathlyn Sims
 3 years ago
 Views:
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 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 stateoftheart 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 biimplication 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 wellknown 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 NPcomplete (For readers unfamiliar with the notion of NPcompleteness the following short summary of the pragmatic consequences suffices Problems that are NPcomplete can be solved by algorithms that run in exponential time No polynomial time algorithms are known to exist for any of the NPcomplete problems and it is very unlikely that polynomial time algorithms should indeed exist although nobody has yet been able to prove their nonexistence) 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 (conp 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 inequivalence between Boolean expressions is NPhard 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 ifthenelse 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 ifthenelse operator and the constants and Moreover, this can be done in such a way that all tests are performed only on (unnegated) 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 Ifthenelse Normal Form (INF) is a Boolean expression built entirely from the ifthenelse 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 righthand 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 highbranches _# Dashed lines denote lowbranches, 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 nonterminal A nonterminal node has a lowedge corresponding to the elsepart and a highedge corresponding to the thenpart 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 highbranch 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\{ Figure 3: A BDD for c"# drawn as dotted lines and highedges as solid lines } ~ _# with ordering 9 co9 9 7 Lowedges 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 nonredundant tests should be present A Binary Decision Diagram (BDD) is a rooted, directed acyclic graph with one or two terminal nodes of outdegree zero labeled 0 or 1, and a set of variable nodes of outdegree 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 highsuccessor, ie, 7 # 7 #$ ŒŽ # ŒŽ # c # c # implies and (nonredundant 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 NPcomplete) 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 nonterminal node marked with is an ifthenelse expression where the condition is and the two branches are the Boolean expressions given by the low or highson, 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 nonterminal node is nonconstant (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 for y 3 (Sometimes [ and are called the negative and positive cofactors 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 highson of would be the same, making the RBDD violate the reducedness condition of nonredundant 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 Figure 6: The RBDD for d"# _# with variable ordering n9 9? d 9? 7 Exercise 31 Show how to express all operators from the ifthenelse 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 highfields 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, highbranches ¾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 ifthenelse 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 highbranches 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 blowup 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: ê 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 nonterminal, we proceed according to the variable index If the nodes have the same index, the two lowbranches are paired and APP recursively computed on them Similarly for the highbranches 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 highbranches 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 nonterminals, 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 highson 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 truthassignment 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 depthfirst traversal, prefering somewhat arbitrarily lowedges over highedges 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 truthassignments 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) Email: hra@it.dtu.dk. Web: http://www.it.dtu.dk/hra
More informationBoolean Representations and Combinatorial Equivalence
Chapter 2 Boolean Representations and Combinatorial Equivalence This chapter introduces different representations of Boolean functions. It then discuss the applications of these representations for proving
More informationIntroduction 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 informationThe 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 informationOffline 1Minesweeper is NPcomplete
Offline 1Minesweeper is NPcomplete James D. Fix Brandon McPhail May 24 Abstract We use Minesweeper to illustrate NPcompleteness proofs, arguments that establish the hardness of solving certain problems.
More informationMathematical 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 informationNPCompleteness and Cook s Theorem
NPCompleteness 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 informationDecember 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS
December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B KITCHENS The equation 1 Lines in twodimensional space (1) 2x y = 3 describes a line in twodimensional space The coefficients of x and y in the equation
More informationCHAPTER 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 informationDiscuss 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 informationRelations Graphical View
Relations Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Introduction Recall that a relation between elements of two sets is a subset of their Cartesian product (of ordered pairs). A binary
More informationChapter 1. NP Completeness I. 1.1. Introduction. By Sariel HarPeled, December 30, 2014 1 Version: 1.05
Chapter 1 NP Completeness I By Sariel HarPeled, 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 informationCOT5405 Analysis of Algorithms Homework 3 Solutions
COT0 Analysis of Algorithms Homework 3 Solutions. Prove or give a counter example: (a) In the textbook, we have two routines for graph traversal  DFS(G) and BFS(G,s)  where G is a graph and s is any
More informationHandout #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 informationAnalysis 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 Breadthfirst search (BFS) 4 Applications
More information3. 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 informationLecture 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 information2. Methods of Proof Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try.
2. METHODS OF PROOF 69 2. Methods of Proof 2.1. Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try. Trivial Proof: If we know q is true then
More informationMathematics 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 informationMathematical Logic. Tableaux Reasoning for Propositional Logic. Chiara Ghidini. FBKIRST, Trento, Italy
Tableaux Reasoning for Propositional Logic FBKIRST, Trento, Italy Outline of this lecture An introduction to Automated Reasoning with Analytic Tableaux; Today we will be looking into tableau methods for
More informationLecture 7: NPComplete Problems
IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 7: NPComplete Problems David Mix Barrington and Alexis Maciel July 25, 2000 1. Circuit
More informationINTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS
INTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS STEVEN HEILMAN Contents 1. Homework 1 1 2. Homework 2 6 3. Homework 3 10 4. Homework 4 16 5. Homework 5 19 6. Homework 6 21 7. Homework 7 25 8. Homework 8 28
More informationExponential 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 klabeling of vertices of a graph G(V, E) is a function V [k].
More informationA 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 informationRevised 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 informationR u t c o r Research R e p o r t. Boolean functions with a simple certificate for CNF complexity. Ondřej Čepeka Petr Kučera b Petr Savický c
R u t c o r Research R e p o r t Boolean functions with a simple certificate for CNF complexity Ondřej Čepeka Petr Kučera b Petr Savický c RRR 22010, January 24, 2010 RUTCOR Rutgers Center for Operations
More informationParametric Domaintheoretic models of Linear Abadi & Plotkin Logic
Parametric Domaintheoretic models of Linear Abadi & Plotkin Logic Lars Birkedal Rasmus Ejlers Møgelberg Rasmus Lerchedahl Petersen IT University Technical Report Series TR007 ISSN 600 600 February 00
More informationChapter 1 LOGIC AND PROOF
Chapter 1 LOGIC AND PROOF To be able to understand mathematics and mathematical arguments, it is necessary to have a solid understanding of logic and the way in which known facts can be combined to prove
More informationThe 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 informationOne 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 informationApproximation Algorithms
Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NPCompleteness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms
More informationDetermination 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 information1. R In this and the next section we are going to study the properties of sequences of real numbers.
+a 1. R In this and the next section we are going to study the properties of sequences of real numbers. Definition 1.1. (Sequence) A sequence is a function with domain N. Example 1.2. A sequence of real
More informationWHAT 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 informationCost 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 information2.1 Complexity Classes
15859(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 informationCHAPTER 5: MODULAR ARITHMETIC
CHAPTER 5: MODULAR ARITHMETIC LECTURE NOTES FOR MATH 378 (CSUSM, SPRING 2009). WAYNE AITKEN 1. Introduction In this chapter we will consider congruence modulo m, and explore the associated arithmetic called
More information31 is a prime number is a mathematical statement (which happens to be true).
Chapter 1 Mathematical Logic In its most basic form, Mathematics is the practice of assigning truth to welldefined statements. In this course, we will develop the skills to use known true statements to
More informationWhy? 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 informationThreshold Logic. 2.1 Networks of functions
2 Threshold Logic 2. Networks of functions We deal in this chapter with the simplest kind of computing units used to build artificial neural networks. These computing elements are a generalization of the
More informationPartitioning edgecoloured complete graphs into monochromatic cycles and paths
arxiv:1205.5492v1 [math.co] 24 May 2012 Partitioning edgecoloured complete graphs into monochromatic cycles and paths Alexey Pokrovskiy Departement of Mathematics, London School of Economics and Political
More informationYou 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 informationChapter. NPCompleteness. Contents
Chapter 13 NPCompleteness 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 NPCompleteness....................
More informationComplexity 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 informationSemantics for the Predicate Calculus: Part I
Semantics for the Predicate Calculus: Part I (Version 0.3, revised 6:15pm, April 14, 2005. Please report typos to hhalvors@princeton.edu.) The study of formal logic is based on the fact that the validity
More informationMAT2400 Analysis I. A brief introduction to proofs, sets, and functions
MAT2400 Analysis I A brief introduction to proofs, sets, and functions In Analysis I there is a lot of manipulations with sets and functions. It is probably also the first course where you have to take
More informationThe 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 informationQuotient 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 informationCARDINALITY, COUNTABLE AND UNCOUNTABLE SETS PART ONE
CARDINALITY, COUNTABLE AND UNCOUNTABLE SETS PART ONE With the notion of bijection at hand, it is easy to formalize the idea that two finite sets have the same number of elements: we just need to verify
More informationCOMP 250 Fall Mathematical induction Sept. 26, (n 1) + n = n + (n 1)
COMP 50 Fall 016 9  Mathematical induction Sept 6, 016 You will see many examples in this course and upcoming courses of algorithms for solving various problems It many cases, it will be obvious that
More informationRegular 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 informationInteger 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 informationNotes 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 informationTheorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path.
Chapter 3 Trees Section 3. Fundamental Properties of Trees Suppose your city is planning to construct a rapid rail system. They want to construct the most economical system possible that will meet the
More information1 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 informationIndiana 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 informationCHAPTER 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 informationBounded 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 informationmax cx s.t. Ax c where the matrix A, cost vector c and right hand side b are given and x is a vector of variables. For this example we have x
Linear Programming Linear programming refers to problems stated as maximization or minimization of a linear function subject to constraints that are linear equalities and inequalities. Although the study
More informationSimulationBased Security with Inexhaustible Interactive Turing Machines
SimulationBased Security with Inexhaustible Interactive Turing Machines Ralf Küsters Institut für Informatik ChristianAlbrechtsUniversität zu Kiel 24098 Kiel, Germany kuesters@ti.informatik.unikiel.de
More informationLecture 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 informationORDERS OF ELEMENTS IN A GROUP
ORDERS OF ELEMENTS IN A GROUP KEITH CONRAD 1. Introduction Let G be a group and g G. We say g has finite order if g n = e for some positive integer n. For example, 1 and i have finite order in C, since
More informationON 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 informationLecture 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 informationLecture 2: The Complexity of Some Problems
IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 2: The Complexity of Some Problems David Mix Barrington and Alexis Maciel July 18, 2000
More informationGenerating 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 informationUNIT 2 MATRICES  I 2.0 INTRODUCTION. Structure
UNIT 2 MATRICES  I Matrices  I Structure 2.0 Introduction 2.1 Objectives 2.2 Matrices 2.3 Operation on Matrices 2.4 Invertible Matrices 2.5 Systems of Linear Equations 2.6 Answers to Check Your Progress
More informationFormal 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 informationMath 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 informationMath 317 HW #7 Solutions
Math 17 HW #7 Solutions 1. Exercise..5. Decide which of the following sets are compact. For those that are not compact, show how Definition..1 breaks down. In other words, give an example of a sequence
More information4 BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
4 BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION BOOLEAN OPERATIONS AND EXPRESSIONS Variable, complement, and literal are terms used in Boolean algebra. A variable is a symbol used to represent a logical quantity.
More informationMATRIX 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 informationInduction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition
Induction Margaret M. Fleck 10 October 011 These notes cover mathematical induction and recursive definition 1 Introduction to induction At the start of the term, we saw the following formula for computing
More informationCS510 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/15cs510se
More informationDiscrete Mathematics, Chapter 5: Induction and Recursion
Discrete Mathematics, Chapter 5: Induction and Recursion Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 5 1 / 20 Outline 1 Wellfounded
More informationSection 1. Statements and Truth Tables. Definition 1.1: A mathematical statement is a declarative sentence that is true or false, but not both.
M3210 Supplemental Notes: Basic Logic Concepts In this course we will examine statements about mathematical concepts and relationships between these concepts (definitions, theorems). We will also consider
More informationFactoring & 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 informationBoundedwidth QBF is PSPACEcomplete
Boundedwidth QBF is PSPACEcomplete 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 informationChapter 1. Logic and Proof
Chapter 1. Logic and Proof 1.1 Remark: A little over 100 years ago, it was found that some mathematical proofs contained paradoxes, and these paradoxes could be used to prove statements that were known
More informationA 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 informationIntroduction to Flocking {Stochastic Matrices}
Supelec EECI Graduate School in Control Introduction to Flocking {Stochastic Matrices} A. S. Morse Yale University Gif sur  Yvette May 21, 2012 CRAIG REYNOLDS  1987 BOIDS The Lion King CRAIG REYNOLDS
More information3(vi) B. Answer: False. 3(vii) B. Answer: True
Mathematics 0N1 Solutions 1 1. Write the following sets in list form. 1(i) The set of letters in the word banana. {a, b, n}. 1(ii) {x : x 2 + 3x 10 = 0}. 3(iv) C A. True 3(v) B = {e, e, f, c}. True 3(vi)
More informationMathematics Course 111: Algebra I Part IV: Vector Spaces
Mathematics Course 111: Algebra I Part IV: Vector Spaces D. R. Wilkins Academic Year 19967 9 Vector Spaces A vector space over some field K is an algebraic structure consisting of a set V on which are
More informationDiscrete 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 informationMATH10212 Linear Algebra. Systems of Linear Equations. Definition. An ndimensional 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 0534405967. Systems of Linear Equations Definition. An ndimensional vector is a row or a column
More informationC H A P T E R. Logic Circuits
C H A P T E R Logic Circuits Many important functions are naturally computed with straightline programs, programs without loops or branches. Such computations are conveniently described with circuits,
More informationOPRE 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 informationSome 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 informationMATH 289 PROBLEM SET 1: INDUCTION. 1. The induction Principle The following property of the natural numbers is intuitively clear:
MATH 89 PROBLEM SET : INDUCTION The induction Principle The following property of the natural numbers is intuitively clear: Axiom Every nonempty subset of the set of nonnegative integers Z 0 = {0,,, 3,
More informationSets and Cardinality Notes for C. F. Miller
Sets and Cardinality Notes for 620111 C. F. Miller Semester 1, 2000 Abstract These lecture notes were compiled in the Department of Mathematics and Statistics in the University of Melbourne for the use
More information9.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 informationOutline. NPcompleteness. When is a problem easy? When is a problem hard? Today. Euler Circuits
Outline NPcompleteness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2pairs sum vs. general Subset Sum Reducing one problem to another Clique
More informationFactorization 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 informationChapter 8. Matrices II: inverses. 8.1 What is an inverse?
Chapter 8 Matrices II: inverses We have learnt how to add subtract and multiply matrices but we have not defined division. The reason is that in general it cannot always be defined. In this chapter, we
More informationPolynomial 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 informationNetwork (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 information1. What s wrong with the following proofs by induction?
ArsDigita University Month : Discrete Mathematics  Professor Shai Simonson Problem Set 4 Induction and Recurrence Equations Thanks to Jeffrey Radcliffe and Joe Rizzo for many of the solutions. Pasted
More informationprinceton univ. F 13 cos 521: Advanced Algorithm Design Lecture 6: Provable Approximation via Linear Programming Lecturer: Sanjeev Arora
princeton univ. F 13 cos 521: Advanced Algorithm Design Lecture 6: Provable Approximation via Linear Programming Lecturer: Sanjeev Arora Scribe: One of the running themes in this course is the notion of
More informationInference Rules and Proof Methods
Inference Rules and Proof Methods Winter 2010 Introduction Rules of Inference and Formal Proofs Proofs in mathematics are valid arguments that establish the truth of mathematical statements. An argument
More information(Refer Slide Time: 1:41)
Discrete Mathematical Structures Dr. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture # 10 Sets Today we shall learn about sets. You must
More information