200 likes | 863 Views
Discussion #10 Logical Equivalences. Topics. Laws Duals Manipulations / simplifications Normal forms Definitions Algebraic manipulation Converting truth functions to logic expressions. Law. Name. P P T P P F. Excluded middle law Contradiction law. P F P P T P.
E N D
Topics • Laws • Duals • Manipulations / simplifications • Normal forms • Definitions • Algebraic manipulation • Converting truth functions to logic expressions
Law Name P P T P P F Excluded middle law Contradiction law P F P P T P Identity laws P T T P F F Domination laws P P P P P P Idempotent laws (P) P Double-negation law Laws of ,, and
P Q Q P P Q Q P Commutative laws (P Q) R P (Q R) (P Q) R P (Q R) Associative laws (P Q) (P R) P (Q R) (P Q) (P R) P (Q R) Distributive laws (P Q) P Q (P Q) P Q De Morgan’s laws P (P Q) P P (P Q) P Absorption laws Law Name
P Q (P Q) P Q T T F T T F F F T F T F T F T T F T T F T T T F F F T F T T T T Can prove all laws by truth tables… De Morgan’s law holds.
Absorption Laws P (P Q) P Venn diagram proof … P (P Q) P P Q Prove algebraically … P (P Q) (P T) (P Q) identity P (T Q) distributive (factor) P T domination P identity
Duals • To create the dual of a logical expression 1) swap propositional constants T and F, and 2) swap connective operators and . P P T Excluded Middle P P F Contradiction • The dual of a law is always a law! • Thus, most laws come in pairs pairs of duals.
Why Duals of Laws are Always Laws We can always do the following: Start with law P P T Negate both sides (P P) T Apply De Morgan’s law P P T Simplify negations P P F Since a law is a tautology, (P ) (P ) F substitute X for X Simplify negations P P F
Normal Forms • Normal forms are standard forms, sometimes called canonical or accepted forms. • A logical expression is said to be in disjunctive normal form (DNF) if it is written as a disjunction, in which all terms are conjunctions of literals. • Similarly, a logical expression is said to be in conjunctive normal form (CNF) if it is written as a conjunction of disjunctions of literals.
DNF and CNF • Disjunctive Normal Form (DNF) ( .. .. .. ) ( .. .. .. ) … ( .. .. ) Term Literal, i.e. P or P Examples: (P Q) (P Q) P (Q R) • Conjunctive Normal Form (CNF) • ( .. .. .. ) ( .. .. .. ) … ( .. .. ) Examples: (P Q) (P Q) P (Q R)
Converting Expressionsto DNF or CNF • The following procedure converts an expression to DNF or CNF: • Remove all and . • Move inside. (Use De Morgan’s law.) • Use distributive laws to get proper form. • Simplify as you go. (e.g. double-neg., idemp., comm., assoc.)
CNF Conversion Example( .. .. .. ) ( .. .. .. ) … ( .. .. ) ((P Q) R (P Q)) ((P Q) R (P Q))impl. (P Q) R (P Q)deM. (P Q) R (P Q) deM. (P Q) R (P Q) double neg. ((P R) (Q R)) (P Q)distr. ((P R) (P Q)) distr. ((Q R) (P Q)) (((P R) P) ((P R) Q)) distr. (((Q R) P) ((Q R) Q)) (P R) (P R Q) (Q R) assoc. comm. idemp. (DNF)
CNF Conversion Example( .. .. .. ) ( .. .. .. ) … ( .. .. ) ((P Q) R (P Q)) ((P Q) R (P Q))impl. (P Q) R (P Q)deM. (P Q) R (P Q) deM. (P Q) R (P Q) double neg. ((P R) (Q R)) (P Q)distr. ((P R) (P Q)) distr. ((Q R) (P Q)) (((P R) P) ((P R) Q)) distr. (((Q R) P) ((Q R) Q)) (P R) (P R Q) (Q R) assoc. comm. idemp. (DNF) CNF Using the commutative and idempotent laws on the previous step and then the distributive law, we obtain this formula as the conjunctive normal form.
CNF Conversion Example( .. .. .. ) ( .. .. .. ) … ( .. .. ) • (P R) (P R Q) • (Q R) • (P R) (P R Q) • (F Q R) - ident. • (P R) ((P F) (Q R)) - comm., distr. • (P R) (F • (Q R)) - dominat. • (P R) (Q R) - ident. ((P Q) R (P Q)) ((P Q) R (P Q))impl. (P Q) R (P Q)deM. (P Q) R (P Q) deM. (P Q) R (P Q) double neg. ((P R) (Q R)) (P Q)distr. ((P R) (P Q)) distr. ((Q R) (P Q)) (((P R) P) ((P R) Q)) distr. (((Q R) P) ((Q R) Q)) (P R) (P R Q) (Q R) assoc. comm. idemp. (DNF)
P Q R T T T F T T F T T F T T T F F F minterms F T T F F T F F F F T T F F F F DNF Expression Generation The only definition of is the truth table (P Q R) (P Q R) (P Q R) • (P Q R) (P Q R) (P Q R)
P Q T T T F T F F T F T T F F F F T CNF Expression Generation } Form a conjunction of max terms • Find . • Find the DNF of . • Then, use De Morgan’s law to get the CNF of (i.e. () ) max terms (P Q) (P Q) (P Q) (P Q) (P Q) (P Q) DNF of f ((P Q) (P Q)) (P Q) (P Q) De Morgan’s (P Q) (P Q) De Morgan’s, double neg.