Presentation is loading. Please wait.

Presentation is loading. Please wait.

F22H1 Logic and Proof Week 5 Overview of weeks 5—9 Predicates and Quantifiers.

Similar presentations


Presentation on theme: "F22H1 Logic and Proof Week 5 Overview of weeks 5—9 Predicates and Quantifiers."— Presentation transcript:

1 F22H1 Logic and Proof Week 5 Overview of weeks 5—9 Predicates and Quantifiers

2 Overview of rest of module Contacting me: dwcorne@macs.hw.ac.ukdwcorne@macs.hw.ac.uk Monday lecture: lecture Thursday/Friday: practice We will cover much but not all of: Nederpelt & Kamareddine: Chapters 8, 9, 11, 16, 17 Two lectures (not from book) on the topics of clausal form and resolution.

3 What we will do this week Chapters 8 and 9, and the exercises therein. What you will learn about: Predicates and Quantifiers: predicate logic Translating english into predicate logic Equivalences in predicate logic Examinable material: Sections: 8.2, 8.3, 8.4, 9.1—9.9

4 Propositions vs Predicates Let A stand for: “Bob is a student” A is a proposition – it is either True or False – definitely one or the other. Now let S = {Anna, Bill, Callum, Dave, …} … the set of students, and let P be the set of all people, and let x be a variable. “x is a student” is not a proposition. What is it?

5 Propositions vs Predicates Instead of “x is a student”, we typically invent suitable function names and write predicates as functions. E.g. here are a few examples: Which of these are predicates and which are propositions? student(x) cat(Tom) taller_than(Madonna, x) prime_minister_of(x, y) hates(Garfield, Mondays)

6 Quantifiers Let S be the set of all students; “x is a student” is a predicate we can decide to write it as: “x in S” instead, or maybe “student(x)” Suppose P is the set of all people. With quantifiers, we can express other possible statements: This is universal quantification  x [P(x): student(x)] -- “every person is a student”  x [S(x): has_a_brain(x)] -- “every student has a brain”

7 Quantifiers  x [P(x): student(x)] “there exists a member of P who is a student” --- i.e. “at least one person is a student” – i.e. there is a student  x [P(x): student(x) AND  attends_lectures(x) ]  x [S(x):  attends_lectures(x) ]   x [S(x): attends_lectures(x) ]

8 Exercises

9

10 Many-place predicates

11

12 This is what chapter 9 is all about:

13 This means, for example:

14 All this means is: “ Every man or woman has an ID card” is equivalent to: “Every man has an ID card AND Every woman has an ID card” “There is a man or a woman at the top of the mountain” is equivalent to: “There is a man at the top of the mountain OR there is a woman at the top of the mountain”

15 This just means: “Every person who is Tom lives in Edinburgh” is equivalent to “Tom lives in Edinburgh” And “There is someone who is Tom who lives in Edinburgh” is equivalent to “Tom lives in Edinburgh” Obviously, the quantification isn’t needed in such cases; all the rule does is remove it.

16 These seem rather daft. But the expressions on the LHS might arise in the middle of trying to prove something, and so the rule helps to automatically simplify it. E.g. we may have: The domain is equivalent to False (why?), so the whole thing = True Don’t worry about it; logic provides a language that enables us to express anything at all in a formal way that computers can manipulate; But logic is powerful enough to also express crazy things like this that we would never say, however they may arise during calculation.

17 Proving the first of the “Empty domain” rules

18 Domain Weakening We can move the domain statements to the right, and make them part of the proposition. This is obvious when you think of it. Means: “For all x in D, A(x)” Means: “For all, if x is in D then A(x)” Logically, there is no difference “There is an x in D for which A(x)” is equivalent to “There is an x in D and A(x)”

19 These observations lead to the following rules: E.g.: “Every student who attends lectures and works hard will pass” is equivalent to: “For every student who attends lectures, if they work hard they’ll pass” “There is a closed passenger door with a red light flashing” is equivalent to: “There is a closed door, which is a passenger door and has a red light flashing” but not equivalent to “There is a closed door, and if it is a passenger door then it has a red light flashing”

20

21 “It is NOT true that every student eats cheese” is equivalent to: “There exists a student who does not eat cheese” “There does NOT exist a camel that can dance the samba” is equivalent to: “Every camel cannot dance the samba”

22 Some practice with logical calculation Showing:

23 Term Splitting

24 Some exercises

25


Download ppt "F22H1 Logic and Proof Week 5 Overview of weeks 5—9 Predicates and Quantifiers."

Similar presentations


Ads by Google