cpsc 121 models of computation
play

CPSC 121: Models of Computation Determine the negation of any - PowerPoint PPT Presentation

Pre-Class Learning Goals By the start of class, you should be able to: CPSC 121: Models of Computation Determine the negation of any quantified statement. Given a quantified statement and an equivalence rule, apply the rule to create


  1. Pre-Class Learning Goals  By the start of class, you should be able to: CPSC 121: Models of Computation  Determine the negation of any quantified statement.  Given a quantified statement and an equivalence rule, apply the rule to create an equivalent statement (particularly the De Morgan’s and contrapositive rules).  Prove and disprove quantified statements using the “challenge” method (Epp, 4th edition, page 119). Unit 6  Apply universal instantiation, universal modus ponens, and Rewriting Predicate Logic Statements universal modus tollens to predicate logic statements that correspond to the rules’ premises to infer statements implied by the premises. Based on slides by Patrice Belleville and Steve Wolfman Unit 6 - Rewriting Predicate Logic Statements 2 Quiz 6 Feedback In-Class Learning Goals  Overall:  By the end of this unit, you should be able to:  Explore alternate forms of predicate logic statements using  Issues: the logical equivalences you have already learned plus negation of quantifiers (a generalized form of the De Morgan’s Law).  Prove arguments with quantifiers.  Open-ended question: Unit 6 - Rewriting Predicate Logic Statements Unit 6 - Rewriting Predicate Logic Statements 3 4 1

  2. ? ? Related to CPSC 121 Big Questions Outline  How can we convince ourselves that an algorithm  Thinking of quantifiers differently. does what it's supposed to do?  Rules and Transformations  We continue discussing how to prove various types of predicate logic statements that arise when we discuss  The challenge method. algorithm correctness. Unit 5 - Predicate Logic 5 Unit 6 - Rewriting Predicate Logic Statements 6 Relation between ∀ , ∃ , ˄, ˅ Negation  Suppose D contains values x1, x2, ..., xn  ~ ∀ x ∈ D, P(x) ≡ ~(P(x1) ^ P(x2) ^ ... ^ P(xn))  What does ∀ x ∈ D, P(x) really mean? ≡ ~P(x1) v ~P(x2) v ... v ~P(xn)  It's the same as ≡ ∃ x ∈ D, ~P(x) P(x1) ^ P(x2) ^ ... ^ P(xn).  Similarly,  ~ ∃ x ∈ D, P(x) ≡ ~(P(x1) v P(x2) v ... v P(xn)) ∃ x ∈ D, P(x) ≡ P(x1) v P(x2) v ... v P(xn) ≡ ~P(x1) ^ ~P(x2) ^ ... ^ ~P(xn)  Thinking of quantifiers this way explains  Negation ≡ ∀ x ∈ D, ~P(x)  Universal instantiation  Universal Modus Ponens, Tollens Unit 6 - Rewriting Predicate Logic Statements Unit 6 - Rewriting Predicate Logic Statements 7 8 2

  3. Negation Negation  What can we do with the negation in: Which of the following are equivalent to: ~ ∃ c ∈ R+ ∃ n0 ∈ N ∀ n ∈ N, n ≥ n0 → f(n) ≤ cg(n) ? ~  n 0  Z 0 ,  n  Z 0 , n > n 0  F(a 1 , a 2 , n). A. It cannot be moved inward. B. It can only move across one quantifier because the A.  n 0  Z 0 , ~  n  Z 0 , n > n 0  F(a 1 , a 2 , n). generalized De Morgan’s law can only handle one quantifier. B.  n 0  Z 0 ,  n  Z 0 , ~(n > n 0 )  F(a 1 , a 2 , n). C. It can only be moved across all three quantifiers because a negation can't appear between quantifiers. C.  n 0  Z 0 ,  n  Z 0 , ~(n > n 0  F(a 1 , a 2 , n)). D. It could be moved across one, two or all three D.  n 0  Z 0 ,  n  Z 0 , ~(n > n 0  F(a 1 , a 2 , n)). quantifiers. E. None of the above. E.  n 0  Z 0 ,  n  Z 0 , n > n 0  ~F(a 1 , a 2 , n). Unit 6 - Rewriting Predicate Logic Statements 9 10 Exercise Outline  Let A be the set of amoebae, and Parent(x, y) be true  Thinking of quantifiers differently. if amoeba x is amoeba y's parent.  Use logical equivalences to show that these two  Rules and Transformations translations of “an amoeba has only one parent” are  The challenge method. logically equivalent: ∀ x ∈ A, ∃ y ∈ A, Parent(y, x) ∧ ( ∀ z ∈ A, Parent(z, x) → y = z) ∀ x ∈ A, ∃ y ∈ A, Parent(y, x) ∧ (~ ∃ z ∈ A, Parent(z, x) ∧ y ≠ z) Unit 6 - Rewriting Predicate Logic Statements Unit 6 - Rewriting Predicate Logic Statements 11 12 3

  4. Universal Instantiation Is Existential Instantiation a Valid Rule?  If a is an element of D then:  Consider an existential instantiation rule: ∃ x ∈ D, P(x) ∀ x ∈ D, P(x) a ∈ D P(a) P(a)  Proving it is a valid inference: A. This argument is valid: P(a) is true.  Suppose ∀ x ∈ D, P(x) is true. B. This argument is invalid: P(a) is false.  Hence P(x 1 ) ∧ P(x 2 ) ∧ ... ∧ P(x n ) holds.  If a = x i is an element of D, then by specialization we have C. This argument is invalid: P(a) might be false. P(x i ). D. This argument is invalid for another reason. Unit 6 - Rewriting Predicate Logic Statements 13 Unit 6 - Rewriting Predicate Logic Statements 14 Existential Generalization Universal Generalization  If a is an element of D then:  If y is a non-specific ( arbitrary ) element of D then: P(a) P(y) for a non-specific y ∃ x ∈ D, P(x) ∀ x ∈ D, P(x)  Proving it is a valid inference:  Proving it is a valid inference:  Suppose P(a) is true and a = x i  Suppose P(y) is true a non-specific y ∈ D  Hence P(x 1 ) v … v P(x i ) v ... v P(x n ) holds.  Since y can be anyone of the elements of D,  Therefore ∃ x ∈ D, P(x) is true. P(x 1 ) ∧ … ∧ P(x n ) holds.  Therefore ∀ x ∈ D, P(x) is true. Unit 6 - Rewriting Predicate Logic Statements Unit 6 - Rewriting Predicate Logic Statements 15 16 4

  5. Universal Modus Ponens/Tollens Is Existential Modus Ponens Valid?  If a is an element of D then:  Is this rule valid? ∀ x ∈ D, P(x) → Q(x) ∃ x ∈ D, P(x) → Q(x) P(a) P(a) Q(a) Q(a)  Proof: 1. ∀ x ∈ D, P(x) → Q(x) premise A. This argument is valid, and Q(a) is true. 2. P(a) premise B. The argument is valid, but the 1st premise can not be true; so Q(a) might be false. 3. P(a) → Q(a) 1, universal instantiation C. This argument is invalid because Q(a) is false. 4. Q(a) 3, modus ponens D. This argument is invalid because the premises can be true and Q(a) can be false.  The proof for universal modus tollens is similar. E. The argument is invalid for another reason. Unit 6 - Rewriting Predicate Logic Statements 17 Unit 6 - Rewriting Predicate Logic Statements 18 Quantifier Rules (the only new rules we need) Logical Equivalences Universal Instantiation Existential Instantiation  Applying logical equivalences to predicate logic: For any a ∈ D:  Suppose we have For an unspecified new (witness) w ∈ D: o ∀ x ∈ D, P(x) → Q(x) ∀ x ∈ D, P(x)  and we know that ∃ x ∈ D, P(x) P(a) o P(x) → Q(x) ≡ ~P(x) v Q(x) P(w)  Can we infer o ∀ x ∈ D, ~P(x) v Q(x) ? Existential Generalization Universal Generalization  Can we infer For any a ∈ D: For any arbitrary x ∈ D: o ~ ∀ x ∈ D, P(x) v Q(x) ? P(a) P(x) ∃ x ∈ D, P(x) ∀ x ∈ D, P(x)  Is any of these valid? Unit 6 - Rewriting Predicate Logic Statements Unit 6 - Rewriting Predicate Logic Statements 19 20 5

  6. Logical Equivalences Applying Rules of Inference  Which propositional logic equivalences apply to  Suppose a and b are elements of D and we know predicate logic? P(a) ∀ x ∈ D, P(x) → ∃ y ∈ D, Q(x,y) A. De Morgan's B. ~(P(x) → Q(x)) ≡ P(x) ∧ ~Q(x)  Can we infer C. Commutative, Associative, and the “definition of A.Q(a, b) ? conditional” B. ∃ y ∈ D, Q(a, y) ? D. All propositional logic equivalences apply to predicate  What if we have logic, but… we have to be sure to carefully “line up” the P(a) parts of the logical equivalence with the parts of the logical ∀ x ∈ D, P(x) → ∀ y ∈ D, Q(x,y) statement.  Can we infer E. None of the above. A.Q(a, b) ? B. ∀ y ∈ D, Q(a, y) ? Unit 6 - Rewriting Predicate Logic Statements 21 Unit 6 - Rewriting Predicate Logic Statements 22 Rules of Inference Outline  Which rules of inference apply to predicate logic?  Thinking of quantifiers differently. A. Modus ponens and modus tollens only.  Rules and Transformations B. All rules apply, but only if they follow universal quantifiers, not existential quantifiers.  The challenge method. C. All rules apply, but only if they follow existential quantifiers, not universal quantifiers. D. All rules apply, but… we have to be sure to match the parts of the rule with correct logical statements. E. None of the above. Unit 6 - Rewriting Predicate Logic Statements Unit 6 - Rewriting Predicate Logic Statements 23 24 6

Recommend


More recommend