Refresh your memory about Propositional Logic.
In addition to propositional logic, it would be good to have basic knowledge of Abstract Algebra.
Propositional logic discussed in ICS141 can be reinterpreted from a viewpoint of algebra as Boolean algebra that is an algebraic system on the set B = {0,1}. A logical statement (called a proposition) in propositional logic is regarded as an expression in Boolean algebra. Applications of inference rules to derive a theorem in logic are similar to transformations and/or manipulations of expressions in algebra. Thus, in Boolean algebra, we can manipulate logical statements as algebraic expressions systematically.
Many technical terms in propositional logic are also used in Boolean algebra though, there are some technical terms specific to Boolean algebra.
Propositional Logic | Boolean Algebra |
---|---|
propositional variable | Boolean variable |
proposition | Boolean expression |
negation | complement |
logical equivalence | equality |
Logical Connectives vs Boolean Operators
Propositional Logic | Boolean Algebra | ||
---|---|---|---|
Logical Connective | Notation | Boolean Operator | Notation |
negation | ¬ | complement | ‾ |
conjunction | ∧ | AND | ⋅ |
disjunction | ∨ | OR | + |
Analogy between Boolean Algebra and Arithmetics
Boolean Algebra | Arithmetics | |
---|---|---|
Domain | truth values | numbers (e.g., integers and real numbers) |
Operands | truth values and/or Boolean variables | numbers and/or variables |
Unary Operator | NOT (complement) | − (negative sign) |
Binary Operators | AND (conjunction), OR (disjunction) | + (addition), − (subtraction), × (multiplication), / (division) |
Review 2.1 on Boolean Operators:
A proposition with n propositional variables in propositional logic is regarded as an expression (called a Boolean expression) in Boolean algebra.
Notations for Boolean Expressions
0 denotes F (false). 1 denotes T (true). p ⋅ q denotes p AND q (i.e., p ∧ q in propositional logic). [Note that a dot "⋅" is often omitted.] p + q denotes p OR q (i.e., p ∨ q in propositional logic). _ p denotes NOT p (i.e., ¬ p in propositional logic). [This operator is called a "complement".]
Some textbooks (especially, in the field of Electrical Engineering) denote the complement of p by p’ (read as “p prime”).
By the traditional convention, it is assumed that an AND operator has a higher precedence than an OR operator if there are no parentheses for explicitly clarifying the order of the operators. For example, x + y ⋅ z is interpreted as x + (y ⋅ z) rather than (x + y) ⋅ z and x y z + a b c is interpreted as (x ⋅ y ⋅ z) + (a ⋅ b ⋅ c).
___ _______ p + q r denotes p + ( q ⋅ r ). ___ _ _ Note that q r is different from q r. The former denotes NOT(q AND r) while the latter denotes (NOT(q)) AND (NOT(r)).
Review 2.2 on Boolean Expressions: Express the following propositions in Boolean algebra.
A Boolean expression with n Boolean variables represents a function f : {0,1}n → {0,1} that is called an n-ary Boolean function (or n-place Boolean function). The integer n is called the arity (or degree) of the Boolean function. Note that there may be more than one Boolean expression representing the same Boolean function. Two Boolean expressions are said to be equivalent if their truth values are identical for every possible truth assignment to Boolean variables of the Boolean expressions. Since each Boolean function is uniquely defined by a truth table, it is common to use a truth table as the specification of a Boolean function. Thus, two Boolean expressions are equivalent iff their truth tables are identical.
x1 | x2 | x3 | τ for k = 5 |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
x1 | x2 | x3 | μ |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
Review 2.3 on Boolean Functions:
_ _ ____ (w + x)y + x(y + (wz))
_ x + z _ _ _ _ _ y(x + z) + y x + (x + x ) y z
Each equivalence or tautology in propositional logic corresponds to an identity or law in Boolean algebra. Important identities and laws are summarized in Algebraic Laws in Boolean Algebra regarding axioms and useful theorems in Boolean algebra.
_ _ _ _ _ z x y + x y z + x y z = x y + z(x y + x y) ----------------------------------------------------------------- Boolean Expression Identity or Law to Be Applied ----------------------------------------------------------------- _ _ _ z x y + x y z + x y z Given LHS _ _ _ x y z + x y z + x y z Commutativity _ _ _ x y z + x y z + x y z + x y z Idempotent Law _ _ _ x y z + x y z + x y z + x y z Commutativity _ _ _ (xy)(z + z) + x y z + x y z Distributivity _ _ (xy)1 + x y z + x y z Complement Law _ _ x y + x y z + x y z Identity Law _ _ x y + z(xy) + x y z Commutativity _ _ x y + z(xy) + z(x y) Commutativity _ _ x y + z((xy) + (x y)) Distributivity -----------------------------------------------------------------
_______ ___ _ x + y z = x y z ----------------------------------------------------------------- Boolean Expression Identity or Law to Be Applied ----------------------------------------------------------------- _______ ___ x + y z Given LHS ___ _ ___ x y z DeMorgan's Law _ x y z Involution Law -----------------------------------------------------------------
_____________ ___ _______ _ _ x + y z + x y = x y ----------------------------------------------------------------- Boolean Expression Identity or Law to Be Applied ----------------------------------------------------------------- _____________ ___ _______ _ x + y z + x y Given LHS ___ _______ ___ _______ _ (x + y z) (x y) DeMorgan's Law _______ _______ _ (x + y z) (x y) Involution Law _ (x + y z) (x y) Involution Law _ (x y) (x + y z) Commutativity _ _ x y x + x y y z Distributivity _ x y x + x 0 z Idempotent Law _ x y x + 0 z Null Law _ x y x + z 0 Commutativity _ x y x + 0 Null Law _ x y x Identity Law _ x x y Commutativity _ x y Idempotent Law -----------------------------------------------------------------
Review 2.4 on Transformation of Boolean Expressions by Identities and Laws:
_ _ _ _ _ _ y(x + z) + y x + (x + x ) y z = x + z
_ _ _ _ _ _ _ _ _ _ _ x + y(x + z) = x y z + x y z + x y z + x y z + x y z + x y z
In the list of identities and laws (Algebraic Laws in Boolean Algebra) in Boolean algebra, they are paired so that every identity or law has its counterpart.
The dual of a Boolean expression is a Boolean expression constructed by interchanging all between AND and OR operators and between Boolean constants 0 and 1.
By using the duality principle of Boolean algebra, an identity or law can logically be derived from another identity or law.
Review 2.5 on the Duality of Boolean Expressions:
_ _ _ x y z + x y z
_ _ x z + x ⋅ 1 + x ⋅ 0
Terminology
_ _ Example 3.1: f(w,x,y,z) = wy + xy + wyz + x
_ _ Example 3.2: wxyz for f(w,x,y,z)
_ _ _ _ Example 3.3: f(w,x,y,z) = wxyz + wxyz + wxyz
_ _ _ Example 3.4: f(w,x,y,z) = (w + x)(y + z)(w + x + z) where f consists of 3 clauses
_ _ Example 3.5: w + x + y + z for f(w,x,y,z)
_ _ _ Example 3.6: f(w,x,y,z) = (w + x + y + z)(w + x + y + z)
Theorem 3.1: For every Boolean function f, there are disjunctive and conjunctive normal forms of f.
Construction of a Sum-of-Products Expansion
Step 1: Construct a truth table of a Boolean function f. Step 2: For each combination of truth values of variables for which f is equal to 1, create a minterm so that the value 1 of a variable x corresponds to a literal x _ and the value 0 of x corresponds to literal x. Step 3: Construct disjunction of all the minterms obtained at Step 2.
_______ _ Example 3.7: f(x,y,z) = ( x y ) (x + z) --------------------------------------------------------------- _____ _ _ x y z x y (x y) x+z f minterm --------------------------------------------------------------- 0 0 0 0 1 0 0 _ _ 0 0 1 0 1 1 1 x y z 0 1 0 1 0 0 0 0 1 1 1 0 1 0 _ _ 1 0 0 0 1 1 1 x y z _ 1 0 1 0 1 1 1 x y z _ 1 1 0 0 1 1 1 x y z 1 1 1 0 1 1 1 x y z --------------------------------------------------------------- _ _ _ _ _ _ f(x,y,z) = x y z + x y z + x y z + x y z + x y z
Construction of a Product-of-Sums Expansion
This is dual to the above process for constructing a sum-of-products expansion.
Step 1: Construct a truth table of a Boolean function f. Step 2: For each combination of truth values of variables for which f is equal to 0, create a maxterm so that the value 0 of a variable x corresponds to a literal x _ and the value 1 of x corresponds to literal x. Step 3: Construct conjunction of all the maxterms obtained at Step 2.
The Boolean function in the above example is expressed as follows.
_ _ _ f(x,y,z) = ( x + y + z ) ( x + y + z ) ( x + y + z )
Remark 3.1: Some textbooks (especially in the field of electrical engineering) use the following notation for specifying the sum-of-product expansion of a Boolean function,
f(x,y,z) = Σm(1,4,5,6,7)
where “Σm” indicates the sum of minterms and each nonnegative integer in a list denotes the binary representation of a row corresponding to a minterm. Similarly, the following specifies a Boolean function with minterms whose values are “don’t care”.
f(x,y,z) = Σm(1,4,5,7) + Σd(0,6)
_ _ _ _ _ _ _ _ _ _ _ x y z + x y z + x y z + x y z + x y z + x y z + x y z = x + y + z
x + (y ⋅ (x + z)) = (x + y) ⋅ (x + z)
_ _ _ _ _ _ _ f(x,y,z) = x ( y + y z + x ) + (x y + y z ) ( x y z + x z )
_ _ _ _ _ _ y ( x + z ) + y x + ( x + x ) y ̄z = x + z
_ _ x + y ( x + z )
_ _ x + y ( x + z )Hint: Apply DeMorgan's laws.
_ _ f(x,y,z) = ( x + y )( x + y + z )