Chapter 4 Boolean Logic

Chapter 4 Boolean Logic

CHAPTER 4 BOOLEAN LOGIC The world divides into facts. Each fact can be the case or not the case, while everything else remains the same. Ludwig Wittgenstein It can be true, it can be false. You'll be given the same reward. The Clash 4.1 BOOLEAN EXPRESSIONS Let us fix a count ably infinite alphabet of Boolean variables X = {Xl, X2, . .}. These are variables that can take the two truth values true and false. We can combine Boolean variables using Boolea connectives such as V (logical or), 1\ (logical and) and -, (logical not), in much the same way as we combine real variables in algebra by +, x, and - to form arithmetic expressions. The definition of Boolean expressions follows. Definition 4.1: A Boolean expression can be anyone of (a) a Boolean variable, such as Xi, or (b) an expression of the form -,4Jl, where 4JI is a Boolean expression, or (c) an expression of the form (4Jl V 4J2), where 4JI and 4J2 are Boolean expressions, or (d) an expression of the form (4JI 1\ 4J2) where 4Jl and 4J2 are Boolean expressions. In case (b) the expression is called the negation of 4JI; in case (c), it is the disjunction of 4Jl and 4J2; and in case (d), it is the conjunction of 4JI and 4J2. An expression of the form Xi or 'Xi is called a li teral. D We have defined only the syntax of Boolean expressions, that is, their su­ perficial, apparent structure. What gives a logical expression life is its seman­ tics, its meaning. The semantics of Boolean expressions is relatively simple: These expressions can be true or false depending on whether the Boolean vari­ ables involved are true or false. Now, the definition of a Boolean expression is 73 74 Chapter 4: BOOLEAN LOGIC inductive, starting from the simplest case of a variable and combining simple expressions by connectives to form more complicated ones. Accordingly, much of our arguing about Boolean expressions will be inductive. Our definitions of properties of Boolean expressions must follow the same inductive path as the original definition, and our proofs will use induction on the structure of the expreSSIon. Definition 4.2: A truth assignment T is a mapping from a finite set X' of Boolean variables, X' c X, to the set of truth values {true, false}. Let c/J be a Boolean expression. We can define the set X (c/J) c X of the Boolean variables appearing in c/J inductively as follows: If c/J is a Boolean variable Xi, then X(c/J) = {Xi}. If c/J == -,c/JI, then X(c/J) == X(c/Jl)' If c/J == (c/JI V c/J2), or if c/J == (c/JI/\ c/J2), then X(c/J) = X(c/JI) U X(c/J2). Now let T-be a truth assignment defined on a set X' of Boolean variables such that X (c/J) c X' ; we call such a truth assignment appropriate to c/J. Suppose that T is appropriate to c/J. We define next what it means for T to satisfy c/J, written T F c/J. If c/J is a variable Xi E X (c/J), then T F c/J if T(Xi) = true. If c/J = .c/JI, then T F c/J if T c/JI (that is, if it is not the case that T F c/JI). If c/J = (c/JI V c/J2), then T F c/J if either T F c/JI or T F c/J2' Finally, if c/J == (c/JI /\ c/J2), T F c/J if both T F c/JI and T F c/J2 hold. D Example 4.1: Consider the Boolean expression c/J = (('XI V X2) /\ X3). An example of an appropriate truth assignment is the one that has T(XI) == T(X3) = true, and T(X2) = false. Does T F c/J? Clearly T F X3. However, the definition of satisfaction of conjunctions requires that ('XI V X2) also be satisfied by T. Is it? To begin with, T F Xl, and thus T V= ,XI. Also, T V= X2. It follows that T V= ('XI V X2), because it is not the case that one of the disjuncts is .satisfied. Finally, T V= c/J, because it fails to satisfy one of its conjuncts-namely ('Xl V X2). D We shall find it convenient to use two more Boolean connectives: (c/JI => c/J2) is a shorthand for (.c/JI V c/J2); and (c/JI {::} c/J2) is a shorthand for (( c/JI => c/J2) /\ (c/J2 => c/J I ) ) . We say that two expressions c/JI, c/J2 are equivalent, written c/JI = c/J2 if for any truth assignment T appropriate to both of them, T F c/JI if and only if T F c/J2 (this is the same as saying that, for any appropriate T, T F (c/JI {::} c/J2), see Problem 4.4.2). If two Boolean expressions are equivalent then they can be considered as different representations of one and the same object, and can be used interchangeably. Boolean connectives possess some basic useful p operties, such as commutativity and associativity, very much like arithmetic operations. We summarize them next. Proposition 4.1: Let c/JI, c/J2, and c/J3 be arbitrary Boolean expressions. Then: ( 1 ) (c/J I V c/J2) - (c/J2 V c/J I ) . (2) (c/JI /\ c/J2) = (c/J2 /\ c/JI). 4.1 Boolean Expressions 75 (3) -,-'c/Jl = c/JI. (4) ((c/JI V c/J2) V c/J3) = (c/JI V (c/J2 V c/J3)). (5) (( c/JI /\ c/J2) /\ c/J3) = (c/Jl /\ (c/J2 /\ c/J3)). (6) ((c/JI/\ c/J2) V c/J3) = ((c/JI V c/J3) /\ (c/J2 V c/J3))' (7) (( c/JI V c/J2) /\ c/J3) = (( c/JI /\ c/J3) V (c/J2 /\ c/J3))' (8) -,( c/JI V c/J2) = (-,c/JI /\ -,c/J2). (9) -,( c/JI /\ c/J2) = (-'c/Jl V -,c/J2). (10) c/JI V c/JI = c/JI. (11) c/JI/\ c/JI - c/JI'. D The commutativity properties (1) and (2) are direct consequences of the symmetry in the definition of V and /\, and property (3) follows directly from the definition of -'. Properties (4) and (5), the associativity properties of V and /\, are also immediate consequences of the definition. For the proofs of properties (6) and (7) (the distributive laws for /\ and V), of (8) and (9) (De Morgan's laws), and of (10) and (11) (the idempotency of Boolean expressions) as well as for an introduction to the truth table method, a general technique for establishing such facts, see Problem 4.4.2. It is worth noting the complete symmetry, or "duality," between V and /\ apparent in properties (6) through (9). Duality in Boolean expressions is much stronger than in the arithmetic case ('Yhere, for example, addition fails to distribute over multiplication). Proposition 4.1 allows us to use henceforth a simplified notation when rep­ resenting Boolean expressions. We shall omit parentheses when they separate binary connectives of the same kind (V or /\). That is, we shall write expres­ sion like (((Xl V -'X3) V X2) V X4 V-(X2 V xs)) as (Xl V -'X3 V X2 V X4 V X2 V xs), allowing for "long disjunctions" and conjunctions. Notice that, using commu­ tativity and idempotency, we can guarantee that long disjunctions and con­ junctions involve distinct expressions: We can rewrite the disjunction above as (Xl V -'X3 V X2 V X4 V xs). We shall occasionally use a mathematical notation that parallels the E and TI notation in algebra: I\ l c/Ji stands for (c/JI/\c/J2/\.. ./\c/Jn), and similarly V =l c/Ji stands for (c/JI V c/J2 V . .'. V c/Jn). Furthermore, using these properties we shall establish that every Boolean expression can be rewritten into an equivalent one in a convenient specialized style. In particular, a Boolean expression c/J is in conjunctive normal form if c/J = I\ =l C i , where n > 1, and each of the Cjs is the disjunction of one or more literals. The Cjs are called the clauses of the expression in conjunctive normal form. Symmetrically, we say that an expression c/J is in disjunctive normal form if c/J = V =l D i where n > 1, and each of the Djs is the conjunction of one or more literals. The Djs are called the implicants of the e pression in disjunctive normal form. Theorem 4.1: Every Boolean expression is equivalent to one in conjunctive normal form, and to one in disjunctive normal form. 76 Chapter 4: BOOLEAN LOGIC Proof: By induction on the structure of c/J. If c/J = x j, a single variable, the statement is trivially true. If c/J = .c/JI, suppose that, by induction, we have turned c/JI into disjunctive normal form with implicants Dj, j = 1,..., n. Then, by de Morgan's laws (properties (8) and (9) in Proposition 4.1), c/J is the con­ junction of the .Dj's. But each .D j is, by another application of de Morgan's law, the disjunction of literals (the negations of the literals appearing in D j ). Similarly for the disjunctive normal form of c/J, starting from the conjunctive normal form of c/JI. Suppose now that c/J = (c/JI Vc/J2). For disjunctive normal form, the induction step is trivial: If both c/JI and c/J2 are in disjunctive normal form, then so is c/JI V c/J2.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us