1 / 14

CT214 – Logical Foundations of Computing Lecture 2 Propositional Calculus

CT214 – Logical Foundations of Computing Lecture 2 Propositional Calculus. Manipulating Logical Expressions. Prove: P ^ ¬(P ^ Q) = P ^ ¬Q Answer: P ^ ¬(P ^ Q) = P ^ (¬P v ¬Q) De Morgan Law 1 = (P ^ ¬P) v (P ^ ¬Q) Distribution = F v (P ^ ¬Q) Complement

Download Presentation

CT214 – Logical Foundations of Computing Lecture 2 Propositional Calculus

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CT214 – Logical Foundations of Computing Lecture 2 Propositional Calculus

  2. Manipulating Logical Expressions Prove: P ^ ¬(P ^ Q) = P ^ ¬Q Answer: P ^ ¬(P ^ Q) = P ^ (¬P v ¬Q) De Morgan Law 1 = (P ^ ¬P) v (P ^ ¬Q) Distribution = F v (P ^ ¬Q) Complement = P ^ ¬Q Identity

  3. Manipulating Logical Expressions Prove: P ^ ((P ^ Q) v ¬P) = P ^ Q Answer: P ^ ((P ^ Q) v ¬P) = (P ^ (P ^ Q)) v (P ^ ¬P) Distribution = (P ^ (P ^ Q)) v F Complement = P ^ (P ^ Q) Identity = (P ^ P) ^ Q Associative = P ^ Q Idempotent

  4. Manipulating Logical Expressions Prove: (P ^ (Q v R)) ^ ¬Q = (P ^ ¬Q) ^ R Answer: (P ^ (Q v R)) ^ ¬Q = P ^ ((Q v R)) ^ ¬Q) Associative = P ^ (¬Q ^ (Q v R)) Commutative = P ^ ((¬Q ^ Q) v (¬Q ^ R)) Distribution = P ^ (F v (¬Q ^ R)) Complement = P ^ (¬Q ^ R) Identity = (P ^ ¬Q) ^ R Associative

  5. Implication A -> B means if A is true then B is also true i.e. A implies B Converse of A -> B is B -> A Contrapositive of A -> B is ¬A -> ¬B

  6. Implication Can use implication to prove equivalence of programming constructs • If (A and B) Then C A ^ B -> C • If (A or B) Then C A v B -> C • If A Then { If B Then C} A -> (B -> C)

  7. Implication Properties • Definition A -> B = ¬A v B • Reflexive A -> A = T • Right Absorber of T A -> T = T • Left Identity of T T -> A = A • Contrapositive A -> B = ¬A -> ¬B Note that: -> is not commutative, associative or idempotent

  8. Manipulating Logical Expressions Prove: (P ^ Q) -> R = P -> (Q -> R) Answer: RHS P -> (Q -> R) = ¬P v (Q -> R) Definition = ¬P v (¬Q v R) Definition = (¬P v ¬Q) v R Associative = ¬(P ^ Q) v R De Morgan Law 1 = (P ^ Q) -> R Definition

  9. Manipulating Logical Expressions Prove: P -> (Q -> R) = (P -> Q) -> (P -> R) Answer: RHS (P -> Q) -> (P -> R) = (¬P v Q) -> (¬P v R) Definition = ¬(¬P v Q) v (¬P v R) Definition = (¬¬P ^ ¬Q) v (¬P v R) De Morgan Law 2 = (P ^ ¬Q) v (¬P v R) Double Negative = ((P ^ ¬Q) v ¬P) v R Associative .....

  10. Manipulating Logical Expressions ..... = ((P ^ ¬Q) v ¬P) v R Associative = (¬P v (P ^ ¬Q)) v R Commutative = ((¬P v P) ^ (¬P v ¬Q)) v R Distribution = (T ^ (¬P v ¬Q)) v R Complement = (¬P v ¬Q) v R Identity = ¬P v (¬Q v R) Associative = P -> (¬Q v R) Definition = P -> (Q -> R) Definition

  11. Equivalence A B means that A is equivalent to B Define A B to mean (A ^ B) v (¬A ^ ¬B) A B means that A is not equivalent to B Define A B to mean (A ^ ¬B) v (¬A ^ B)

  12. Equivalence Properties • Definition A B = (A ^ B) v (¬A ^ ¬B) • Reflexive A A = T • Associative (A B) C = A (B C) • Commutative A B = B A • Identity A T = A • Complement A ¬A = F • Distribution ¬(A B) = A B ¬(A B) = A B

  13. Equivalence Alternative Definition Prove alternative definition of P Q: (P -> Q) ^ (Q -> P) Definition of P Q = (P ^ Q) v (¬P ^ ¬Q) Answer is to start with (P -> Q) ^ (Q -> P) and get to (P ^ Q) v (¬P ^ ¬Q)

  14. Equivalence Alternative Definition Answer: Show (P -> Q) ^ (Q -> P) = (P ^ Q) v (¬P ^ ¬Q) (¬P v Q) ^ (¬Q v P) Definition ((¬P v Q) ^ ¬Q) v ((¬P v Q) ^ P) Distribution (¬Q ^ (¬P v Q)) v (P ^ (¬P v Q)) Commutative ((¬Q ^ ¬P) v (¬Q ^ Q)) v ((P ^ ¬P) v (P ^ Q)) Distribution ((¬Q ^ ¬P) v F) v (F v (P ^ Q)) Complement (¬Q ^ ¬P) v (P ^ Q) Identity (P ^ Q) v (¬P ^ ¬Q) Commutative

More Related