Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discussion #10 1/16 Discussion #10 Logical Equivalences.

Similar presentations


Presentation on theme: "Discussion #10 1/16 Discussion #10 Logical Equivalences."— Presentation transcript:

1 Discussion #10 1/16 Discussion #10 Logical Equivalences

2 Discussion #10 2/16 Topics Laws Duals Manipulations / simplifications Normal forms –Definitions –Algebraic manipulation –Converting truth functions to logic expressions

3 Discussion #10 3/16 Laws of , , and  Excluded middle law Contradiction law P   P  T P   P  F NameLaw Identity laws P  F  P P  T  P Domination laws P  T  T P  F  F Idempotent laws P  P  P P  P  P Double-negation law  (  P)  P

4 Discussion #10 4/16 Commutative laws P  Q  Q  P P  Q  Q  P NameLaw Associative laws (P  Q)  R  P  (Q  R) (P  Q)  R  P  (Q  R) Distributive laws (P  Q)  (P  R)  P  (Q  R) (P  Q)  (P  R)  P  (Q  R) De Morgan’s laws  (P  Q)   P   Q  (P  Q)   P   Q Absorption laws P  (P  Q)  P P  (P  Q)  P

5 Discussion #10 5/16 Can prove all laws by truth tables… T F T F T T T F T T F F T T T T F F F T T T T F FF TF FT TT QQ PP  (P  Q)  QP De Morgan’s law holds.

6 Discussion #10 6/16 Absorption Laws Prove algebraically … P  (P  Q)  (P  T)  (P  Q)identity  P  (T  Q)distributive (factor)  P  Tdomination  Pidentity P  (P  Q)  P P  (P  Q)  P Venn diagram proof … P Q

7 Discussion #10 7/16 Duals To create the dual of a logical expression 1) swap propositional constants T and F, and 2) swap connective operators  and . P   P  TExcluded Middle   P   P  FContradiction The dual of a law is always a law! Thus, most laws come in pairs  pairs of duals.

8 Discussion #10 8/16 Why Duals of Laws are Always Laws 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 We can always do the following:

9 Discussion #10 9/16 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 Discussion #10 10/16 Disjunctive Normal Form (DNF) (.. .. .. )  (.. .. .. )  …  (.. .. ) Term Literal, i.e. P or  P Conjunctive Normal Form (CNF) (.. .. .. )  (.. .. .. )  …  (.. .. ) Examples:(P  Q)  (P   Q) P  (Q  R) DNF and CNF Examples:(P  Q)  (P   Q) P  (Q  R)

11 Discussion #10 11/16 Converting Expressions to DNF or CNF The following procedure converts an expression to DNF or CNF: 1.Remove all  and . 2.Move  inside. (Use De Morgan’s law.) 3.Use distributive laws to get proper form. Simplify as you go. (e.g. double-neg., idemp., comm., assoc.)

12 Discussion #10 12/16 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 Discussion #10 13/16 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 Discussion #10 14/16 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) (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.

15 Discussion #10 15/16 DNF Expression Generation F T F F F T T F FFF TFF FTF TTF FFT TFT FTT TTT  RQP (P  Q   R) (P   Q  R) (  P   Q  R)   (P  Q   R)  (P   Q  R)  (  P   Q  R) minterms The only definition of  is the truth table

16 Discussion #10 16/16 CNF Expression Generation 1.Find . 2.Find the DNF of . 3.Then, use De Morgan’s law to get the CNF of  (i.e.  (  )   ) T F T F  FFF TTF FFT TTT  QP (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. max terms } Form a conjunction of max terms


Download ppt "Discussion #10 1/16 Discussion #10 Logical Equivalences."

Similar presentations


Ads by Google