CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.

Slides:



Advertisements
Similar presentations
Rules of Inference Rosen 1.5.
Advertisements

Discrete Math Methods of proof 1.
Introduction to Proofs
The Foundations: Logic and Proofs
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
CPSC 121: Models of Computation
CS128 – Discrete Mathematics for Computer Science
CPSC 121: Models of Computation
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Proof Techniques Steve Wolfman, based on notes by Patrice Belleville and others 1.
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 Rewriting Predicate Logic Statements Steve Wolfman, based on notes by Patrice Belleville.
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Proof Techniques Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Rewriting Predicate Logic Statements Steve Wolfman, based on notes by Patrice Belleville.
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 Proof Techniques Steve Wolfman, based on notes by Patrice Belleville and others 1.
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 Rewriting Predicate Logic Statements Steve Wolfman, based on notes by Patrice Belleville.
First Order Logic (chapter 2 of the book) Lecture 3: Sep 14.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Proof Techniques (Part B) Steve Wolfman, based on notes by Patrice Belleville and others.
CPSC 121: Models of Computation Unit 7: Proof Techniques Based on slides by Patrice Belleville and Steve Wolfman.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Copyright © Cengage Learning. All rights reserved.
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Introduction to Proofs
MATH 224 – Discrete Mathematics
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
Week 3 - Monday.  What did we talk about last time?  Predicate logic  Multiple quantifiers  Negating multiple quantifiers  Arguments with quantified.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Describing the World with Predicate Logic Steve Wolfman, based on notes by Patrice Belleville.
Chap. 2 Fundamentals of Logic. Proposition Proposition (or statement): an declarative sentence that is either true or false, but not both. e.g. –Margret.
Snick  snack CPSC 121: Models of Computation 2012 Summer Term 2 Rewriting Predicate Logic Statements Steve Wolfman, based on notes by Patrice Belleville.
Chapter 1 Logic Section 1-1 Statements Open your book to page 1 and read the section titled “To the Student” Now turn to page 3 where we will read the.
Section 1.5. Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
2.3Logical Implication: Rules of Inference From the notion of a valid argument, we begin a formal study of what we shall mean by an argument and when such.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
CompSci 102 Discrete Math for Computer Science January 24, 2012 Prof. Rodger Slides modified from Rosen.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
Chapter 1: The Foundations: Logic and Proofs
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Predicates and Quantifiers Dr. Yasir Ali. 1.Predicates 2.Quantifiers a.Universal Quantifiers b.Existential Quantifiers 3.Negation of Quantifiers 4.Universal.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2012 CSE
Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
Lecture 10 Methods of Proof CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 1, Part III: Proofs With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without.
Chapter 1 Logic and proofs
Arguments with Quantified Statements
2. The Logic of Compound Statements Summary
3. The Logic of Quantified Statements Summary
Module 2: Conditionals and Logical Equivalences
Advanced Algorithms Analysis and Design
COMP 1380 Discrete Structures I Thompson Rivers University
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
CPSC 121: Models of Computation 2016W2
CSE 311 Foundations of Computing I
CS201: Data Structures and Discrete Mathematics I
CSE 311: Foundations of Computing
A Brief Summary for Exam 1
COMP 1380 Discrete Structures I Thompson Rivers University
CPSC 121: Models of Computation
CPSC 121: Models of Computation
CPSC 121: Models of Computation
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman

Pre-Class Learning Goals By the start of class, you should be able to:  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).  Apply universal instantiation, universal modus ponens, and universal modus tollens to predicate logic statements that correspond to the rules’ premises to infer statements implied by the premises. Unit 6 - Rewriting Predicate Logic Statements 2

Quiz 6 Feedback Overall: Issues: Open-ended question: Unit 6 - Rewriting Predicate Logic Statements 3

In-Class Learning Goals By the end of this unit, you should be able to:  Explore alternate forms of predicate logic statements using the logical equivalences you have already learned plus negation of quantifiers (a generalized form of the De Morgan’s Law).  Prove arguments with quantifiers. Unit 6 - Rewriting Predicate Logic Statements 4

Related to CPSC 121 Big Questions How can we convince ourselves that an algorithm does what it's supposed to do?  We continue discussing how to prove various types of predicate logic statements that arise when we discuss algorithm correctness. Unit 5 - Predicate Logic 5 ? ?

Outline Thinking of quantifiers differently. Rules and Transformations The challenge method. Unit 6 - Rewriting Predicate Logic Statements 6

Relation between ∀, ∃, ˄, ˅ Suppose D contains values x1, x2,..., xn What does ∀ x ∈ D, P(x) really mean?  It's the same as P(x1) ^ P(x2) ^... ^ P(xn).  Similarly, ∃ x ∈ D, P(x) ≡ P(x1) v P(x2) v... v P(xn) Thinking of quantifiers this way explains  Negation  Universal instantiation  Universal Modus Ponens, Tollens Unit 6 - Rewriting Predicate Logic Statements 7

Negation ~ ∀ x ∈ D, P(x) ≡ ~(P(x1) ^ P(x2) ^... ^ P(xn)) ≡ ~P(x1) v ~P(x2) v... v ~P(xn) ≡ ∃ x ∈ D, ~P(x) ~ ∃ x ∈ D, P(x) ≡ ~(P(x1) v P(x2) v... v P(xn)) ≡ ~P(x1) ^ ~P(x2) ^... ^ ~P(xn) ≡ ∀ x ∈ D, ~P(x) Unit 6 - Rewriting Predicate Logic Statements 8

Negation What can we do with the negation in: ~ ∃ c ∈ R+ ∃ n0 ∈ N ∀ n ∈ N, n ≥ n0 → f(n) ≤ cg(n) ? A. It cannot be moved inward. B. It can only move across one quantifier because the generalized De Morgan’s law can only handle one quantifier. C. It can only be moved across all three quantifiers because a negation can't appear between quantifiers. D. It could be moved across one, two or all three quantifiers. E. None of the above. Unit 6 - Rewriting Predicate Logic Statements 9

Negation Which of the following are equivalent to: ~  n 0  Z 0,  n  Z 0, n > n 0  F(a 1, a 2, n). A.  n 0  Z 0, ~  n  Z 0, n > n 0  F(a 1, a 2, n). B.  n 0  Z 0,  n  Z 0, ~(n > n 0 )  F(a 1, a 2, n). C.  n 0  Z 0,  n  Z 0, ~(n > n 0  F(a 1, a 2, n)). D.  n 0  Z 0,  n  Z 0, ~(n > n 0  F(a 1, a 2, n)). E.  n 0  Z 0,  n  Z 0, n > n 0  ~F(a 1, a 2, n). 10

Exercise Let A be the set of amoebae, and Parent(x, y) be true if amoeba x is amoeba y's parent. Use logical equivalences to show that these two translations of “an amoeba has only one parent” are 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 11

Outline Thinking of quantifiers differently. Rules and Transformations The challenge method. Unit 6 - Rewriting Predicate Logic Statements 12

Universal Instantiation If a is an element of D then: ∀ x ∈ D, P(x) P(a) Proving it is a valid inference:  Suppose ∀ x ∈ D, P(x) is true.  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 P(x i ). Unit 6 - Rewriting Predicate Logic Statements 13

Is Existential Instantiation a Valid Rule? Consider an existential instantiation rule: ∃ x ∈ D, P(x) a ∈ D P(a) A. This argument is valid: P(a) is true. B. This argument is invalid: P(a) is false. C. This argument is invalid: P(a) might be false. D. This argument is invalid for another reason. Unit 6 - Rewriting Predicate Logic Statements 14

Existential Generalization If a is an element of D then: P(a) ∃ x ∈ D, P(x) Proving it is a valid inference:  Suppose P(a) is true and a = x i  Hence P(x 1 ) v … v P(x i ) v... v P(x n ) holds.  Therefore ∃ x ∈ D, P(x) is true. Unit 6 - Rewriting Predicate Logic Statements 15

Universal Generalization If y is a non-specific (arbitrary) element of D then: P(y) for a non-specific y ∀ x ∈ D, P(x) Proving it is a valid inference:  Suppose P(y) is true a non-specific y ∈ D  Since y can be anyone of the elements of D, P(x 1 ) ∧ … ∧ P(x n ) holds.  Therefore ∀ x ∈ D, P(x) is true. Unit 6 - Rewriting Predicate Logic Statements 16

Universal Modus Ponens/Tollens If a is an element of D then: ∀ x ∈ D, P(x) → Q(x) P(a) Q(a) Proof: 1. ∀ x ∈ D, P(x) → Q(x)premise 2.P(a)premise 3.P(a) → Q(a)1, universal instantiation 4.Q(a)3, modus ponens The proof for universal modus tollens is similar. Unit 6 - Rewriting Predicate Logic Statements 17

Is Existential Modus Ponens Valid? Is this rule valid? ∃ x ∈ D, P(x) → Q(x) P(a) Q(a) A.This argument is valid, and Q(a) is true. B. The argument is valid, but the 1st premise can not be true; so Q(a) might be false. C. This argument is invalid because Q(a) is false. D.This argument is invalid because the premises can be true and Q(a) can be false. E. The argument is invalid for another reason. Unit 6 - Rewriting Predicate Logic Statements 18

Quantifier Rules (the only new rules we need) Existential Instantiation For an unspecified new (witness) w ∈ D: ∃ x ∈ D, P(x) P(w) Existential Generalization For any a ∈ D: P(a) ∃ x ∈ D, P(x) Unit 6 - Rewriting Predicate Logic Statements 19 Universal Instantiation For any a ∈ D: ∀ x ∈ D, P(x) P(a) Universal Generalization For any arbitrary x ∈ D: P(x) ∀ x ∈ D, P(x)

Logical Equivalences Applying logical equivalences to predicate logic:  Suppose we have o ∀ x ∈ D, P(x) → Q(x)  and we know that oP(x) → Q(x) ≡ ~P(x) v Q(x)  Can we infer o ∀ x ∈ D, ~P(x) v Q(x) ?  Can we infer o~ ∀ x ∈ D, P(x) v Q(x) ? Is any of these valid? Unit 6 - Rewriting Predicate Logic Statements 20

Logical Equivalences Which propositional logic equivalences apply to predicate logic? A.De Morgan's B. ~(P(x) → Q(x)) ≡ P(x) ∧ ~Q(x) C. Commutative, Associative, and the “definition of conditional” D. All propositional logic equivalences apply to predicate logic, but… we have to be sure to carefully “line up” the parts of the logical equivalence with the parts of the logical statement. E. None of the above. Unit 6 - Rewriting Predicate Logic Statements 21

Applying Rules of Inference Suppose a and b are elements of D and we know P(a) ∀ x ∈ D, P(x) → ∃ y ∈ D, Q(x,y)  Can we infer A.Q(a, b) ? B. ∃ y ∈ D, Q(a, y) ? What if we have P(a) ∀ x ∈ D, P(x) → ∀ y ∈ D, Q(x,y)  Can we infer A.Q(a, b) ? B. ∀ y ∈ D, Q(a, y) ? Unit 6 - Rewriting Predicate Logic Statements 22

Rules of Inference Which rules of inference apply to predicate logic? A. Modus ponens and modus tollens only. B. All rules apply, but only if they follow universal quantifiers, not existential quantifiers. 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 23

Outline Thinking of quantifiers differently. Rules and Transformations The challenge method. Unit 6 - Rewriting Predicate Logic Statements 24

The Challenge Method A predicate logic statement is like a game with two players.  you (trying to prove the statement true)  your adversary (trying to prove it false). The two of you pick values for the quantified variables working from the left to right (i.e. inwards).  You pick the values of existentially quantified variables.  Your adversary picks the values of universally quantified variables Unit 6 - Rewriting Predicate Logic Statements 25

The Challenge Method The Challenge method (continued):  If there is a strategy that allows you to always win, then the statement is true.  If there is a strategy for your adversary that allows him/her to always win, then the statement is false. What does it mean to have a winning strategy at Nim? Unit 6 - Rewriting Predicate Logic Statements 26

The Challenge Method Example 1: ∃ x ∈ Z, ∀ n ∈ Z +, 2 x < n  How would we say this in English?  How would we prove this theorem? Example 2: ∀ n ∈ N, ∃ x ∈ N, n < 2 x  How would we say this in English?  How would we prove this theorem? Unit 6 - Rewriting Predicate Logic Statements 27

The Challenge Method Example 3: ∃ x ∈ N, ∀ n ∈ N, n < 2 x  How would we say this in English?  Is this statement true? How do we prove a statement is false? Unit 6 - Rewriting Predicate Logic Statements 28

Reading for Quiz 7 Online quiz #7 is due ________________________ Readings for the quiz:  Epp, 4th edition: 4.1, 4.6, Theorem  Epp, 3rd edition: 3.1, 3.6, Theorem  Rosen, 6th edition: 1.6, (theorem 2 only).  Rosen 7th edition: 1.7, 1.8, 4.1 (theorem 2 only). Unit 6 - Rewriting Predicate Logic Statements 29