Discussion #10 Logical Equivalences

# Discussion #10 Logical Equivalences

Télécharger la présentation

## Discussion #10 Logical Equivalences

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. Discussion #10Logical Equivalences

2. Topics • Laws • Duals • Manipulations / simplifications • Normal forms • Definitions • Algebraic manipulation • Converting truth functions to logic expressions

3. 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 

4. 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

5. 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.

6. 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

7. 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.

8. 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

9. 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.

10. 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)

11. 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.)

12. 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)

13. 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.

14. 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)

15. 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)

16. 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.