Top Banner
odule #1 - Logic 03/27/22 Michael Frank / Kees van Deemter 1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d. be Let the u.d. be parking spaces at parking spaces at UF UF . . Let Let P P ( ( x x ) be ) be x x is occupied. is occupied. Let Q( Let Q( x x ) be ) be x x is free of charge. is free of charge. x x ( ( Q Q ( ( x x ) ) P P ( ( x x ) ) ) ) x x ( ( Q Q ( ( x x ) ) P P ( ( x x ) ) ) ) x x ( ( Q Q ( ( x x ) ) P P ( ( x x ) ) ) ) x x ( ( Q Q ( ( x x ) ) P P ( ( x x ) ) ) )
55

Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Dec 25, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 1

Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false

Let the u.d. be Let the u.d. be parking spaces at UFparking spaces at UF..Let Let PP((xx) be ) be ““xx is occupied. is occupied.””Let Q(Let Q(xx) be ) be ““xx is free of charge. is free of charge.”” x x ((QQ((xx) ) PP((xx)))) x x ((QQ((xx) ) PP((xx))) ) x x ((QQ((xx) ) PP((xx)))) x x ((QQ((xx) ) PP((xx))))

Page 2: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 2

II. Construct a model where 1 and 4 are true, while 2 and 3 are false

1.1. x x ((QQ((xx) ) PP((xx))) (true for place a below)) (true for place a below)2.2. x x ((QQ((xx) ) PP((xx))) (false for places b below)) (false for places b below)3.3. x x ((QQ((xx) ) PP((xx))) (false for place b below)) (false for place b below)4.4. x x ((QQ((xx) ) PP((xx))) (true for place a below)) (true for place a below)One solutionOne solution: a model with exactly two objects in it. : a model with exactly two objects in it.

One object has the property Q and the property One object has the property Q and the property P; the other object has the property Q but not the P; the other object has the property Q but not the property P. In a diagram: property P. In a diagram:

a: Q P b: Q not-Pa: Q P b: Q not-P

Page 3: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 3

III. Construct a model where 1 and 3 and 4 are true, but 2 is false

1.1. x x ((QQ((xx) ) PP((xx))) ) 2.2. x x ((QQ((xx) ) PP((xx))) ) 3.3. x x ((QQ((xx) ) PP((xx))) ) 4.4. x x ((QQ((xx) ) PP((xx))))

Here is such a model (using a diagram). It has just Here is such a model (using a diagram). It has just two objects in its u.d., called a and b:two objects in its u.d., called a and b:

a: Q P b: not-Q Pa: Q P b: not-Q P

Page 4: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 4

Quantifier Equivalence Laws

• Expanding quantifiers: If u.d.=a,b,c,… Expanding quantifiers: If u.d.=a,b,c,… x Px P((xx) ) PP(a) (a) PP(b) (b) PP(c) (c) … … x Px P((xx) ) PP(a) (a) PP(b) (b) PP(c) (c) … …

• From those, we can From those, we can ““proveprove”” the laws: the laws:x Px P((xx) ) x x PP((xx))x Px P((xx) ) x x PP((xx))

Topic #3 – Predicate Logic

Page 5: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 5

Remember

• In propositional logic, we can In propositional logic, we can strictly strictly speakingspeaking only build formulas of finite size. only build formulas of finite size.

• E.g., we can write E.g., we can write PP(a) (a) PP(b) (b) PP(a) (a) PP(b) (b) PP(c) (c) PP(a) (a) PP(b) (b) PP(c) (c) PP(d) , etc.(d) , etc.

• But this way, we could never say that all But this way, we could never say that all natural numbers have Pnatural numbers have P

Page 6: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 6

Formulas of infinite length?

• In predicate logic, you can say this easily:In predicate logic, you can say this easily: xPxP((xx))

• It’s sometimes useful to pretend that It’s sometimes useful to pretend that propositional logic allows infinitely long propositional logic allows infinitely long formulas, but in the “official” version this is formulas, but in the “official” version this is not possible.not possible.

Page 7: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 7

More Equivalence Laws

x x y Py P((xx,,yy) ) y y x Px P((xx,,yy))x x y Py P((xx,,yy) ) y y x Px P((xx,,yy))

x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))))x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))))

Topic #3 – Predicate Logic

Page 8: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 8

More Equivalence Laws

x x y Py P((xx,,yy) ) y y x Px P((xx,,yy))x x y Py P((xx,,yy) ) y y x Px P((xx,,yy))

x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))))x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))))

• Let’s prove the last of these equivalences Let’s prove the last of these equivalences using the definition of the truth of a formula using the definition of the truth of a formula of the form of the form x x φφ

Topic #3 – Predicate Logic

Page 9: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 9

A Pred. Log. equivalence proven

x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))))Proof: Proof: Suppose x x ((PP((xx) ) QQ((xx)))) is true. So, there is a is true. So, there is a constantconstant a a such that ( such that (P(x) P(x) QQ((xx)) )) (x:=a)(x:=a) is true. is true. So, for that So, for that aa, the formula , the formula PP(a) Q(a) is true. is true. One One possibilitypossibility is that is that P(a)P(a) is true. In this case, is true. In this case, P(x)P(x)(x:=a)(x:=a) is true. So, is true. So, x Px P((xx)) is true, so (x Px P((xx)) )) ((x Qx Q((xx)) is true. )) is true. The other possibilityThe other possibility is that is that Q(a)Q(a) is true. In this case, is true. In this case, Q(x)(x:=a)Q(x)(x:=a) is true. is true. So, So, x Qx Q((xx)) is true, so (x Px P((xx)) )) ( (x Qx Q((xx))))is true. is true.

Topic #3 – Predicate Logic

Page 10: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 10

A Pred. Log. equivalence proven

x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))))Proof: Proof: Suppose ((x Px P((xx)))) ((x Qx Q((xx)))) is true. is true. One One possibilitypossibility is that is that x Px P((xx) is true. This would mean ) is true. This would mean that there is an a such that that there is an a such that P(x) (x:=a)P(x) (x:=a) is true. So, is true. So, for that constant for that constant aa, , PP(a) is true.Therefore, is true.Therefore, P(a) P(a) Q(a) Q(a) would also be true. Hence, would also be true. Hence, (P(x) (P(x) Q(x))(x:=a) Q(x))(x:=a) would be true. Hence, would be true. Hence, x x ((PP((xx) ) QQ((xx)))) would be true. would be true. The other The other possibilitypossibility is that is that x Qx Q((xx). From this, ). From this, x x ((PP((xx) ) QQ((xx)))) is proven in the same way is proven in the same way QEDQED

Topic #3 – Predicate Logic

Page 11: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 11

More Equivalence Laws

x x y Py P((xx,,yy) ) y y x Px P((xx,,yy))x x y Py P((xx,,yy) ) y y x Px P((xx,,yy))

x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))))x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))))

• How about this one?How about this one?

x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx)))?)?

Topic #3 – Predicate Logic

Page 12: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 12

More Equivalence Laws

• How about this one?How about this one?

x x ((PP((xx) ) QQ((xx)))) ((x Px P((xx)))) ((x Qx Q((xx))) ?) ?• This equivalence statement is false.This equivalence statement is false.

Counterexample Counterexample (i.e. model making this false):(i.e. model making this false):

• P(x): x’s birthday is on 30 AprilP(x): x’s birthday is on 30 AprilQ(x): x’s birthday is on 20 December Q(x): x’s birthday is on 20 December

Topic #3 – Predicate Logic

Page 13: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 13

Cases to think carefully about

Let’s discuss some specific casesLet’s discuss some specific cases

These might seem unusual, but it’s These might seem unusual, but it’s important not to loose your way when important not to loose your way when they occurthey occur

1.1. Quantifiers that don’t bind any variablesQuantifiers that don’t bind any variables

2.2. Quantification in an empty u.d.Quantification in an empty u.d.

3.3. x x ((QQ((xx) ) PP((xx))) ) whenwhen yQyQ((yy))

Page 14: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 14

1. Quantifiers that do not bind: xP(b)

• Recall definition:Recall definition: Let Let be a formula. be a formula. Then Then xx is true in D if every expression is true in D if every expression (x:=(x:=aa) is true in D, and false otherwise.) is true in D, and false otherwise.

xP(b) xP(b) is true in D if every expression of is true in D if every expression of the form the form P(b)P(b)(x:=(x:=aa) is true in D, and false ) is true in D, and false otherwise.otherwise.

• What is the set of all the What is the set of all the expression of the expression of the form form P(b)P(b)(x:=(x:=aa)?)?

Page 15: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 15

Consider xP(b)

• What is the set of all the What is the set of all the expression of the expression of the form form P(b)P(b)(x:=(x:=aa)?)?

• That’s the singleton set {P(b)} ! So, That’s the singleton set {P(b)} ! So,

xP(b) xP(b) is true in D if P(b) is true, is true in D if P(b) is true, and false otherwise.and false otherwise.

• So, So, xP(b) xP(b) means just P(b) means just P(b)

Page 16: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 16

2. Empty u.d.: We defined

• Let Let be a formula. Then the proposition be a formula. Then the proposition xx is true in D if is true in D if every expression every expression ((xx:=:=aa)) is true in D, and false otherwise.is true in D, and false otherwise.

This is read as follows:This is read as follows:

• Let Let be a formula. Then the proposition be a formula. Then the proposition xx is false in D if at least one expression is false in D if at least one expression ((xx:=:=aa) is false in D, and true otherwise.) is false in D, and true otherwise.

Page 17: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 17

could have been defined differently. For example,

• Let Let be a formula. Then the proposition be a formula. Then the proposition xx is true in D if is true in D if D is nonempty andD is nonempty and every every expression expression (x:=(x:=aa) is true in D, and false ) is true in D, and false otherwise.otherwise.– Under this definition, Under this definition, xx PP((xx) would have been ) would have been

false whenever D is empty (e.g., when there are false whenever D is empty (e.g., when there are no parking spaces at U.F., and P = no parking spaces at U.F., and P = ““occupiedoccupied””))

– But thatBut that’’s s not how itnot how it’’s dones done! !

Page 18: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 18

Suppose D is empty

Suppose the u.d. is empty. ConsiderSuppose the u.d. is empty. Consider

xx PP((xx) (e.g., ) (e.g., PP((xx) means ) means ““xx is occupied. is occupied.””))

This counts as true. (Sometimes called This counts as true. (Sometimes called “vacuously true”)“vacuously true”)

For the same reason,For the same reason,

xx PP((xx) is also true) is also true

Page 19: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 19

Consequences of the standard position

Two logical equivalences in Predicate Logic:Two logical equivalences in Predicate Logic:x Px P((xx) ) x x PP((xx) ) ((““no counterexample against Pno counterexample against P””))

x Px P((xx) ) x x PP((xx))

So, one of the two quantifiers suffices So, one of the two quantifiers suffices (cf., functional completeness of a set of (cf., functional completeness of a set of connectives in propositional logic)connectives in propositional logic)

We’ll return to these equivalences later.We’ll return to these equivalences later.

Page 20: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 20

3. x (Q(x) P(x)) when yQ(y)

Page 21: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 21

When many implications are combined

• ConsiderConsider the formula the formula rr = = x x ((QQ((xx) ) PP((xx)))) with respect to a with respect to a nonempty u.d.nonempty u.d.

• Suppose Suppose yQyQ((yy))

• (For example, Q might mean “being more (For example, Q might mean “being more than 4 meters tall”)than 4 meters tall”)

• Can you work out whether Can you work out whether rr is true? is true?

Page 22: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 22

When many implications are combined

• ConsiderConsider x x ((QQ((xx) ) PP((xx))) ) in a nonempty u.d.in a nonempty u.d.• Suppose, however, Suppose, however, yQyQ((yy))• Then Then QQ((aa) ) PP((aa)) is true for every is true for every a a

(since Q(a) is false for every a) (since Q(a) is false for every a) • Consequently Consequently x x ((QQ((xx) ) PP((xx))) is true) is true• Once again, we sometimes say: it is Once again, we sometimes say: it is vacuouslyvacuously

true (because the antecedent is always false, so true (because the antecedent is always false, so you can never use the formula to conclude that you can never use the formula to conclude that PP holds of something).holds of something).

Page 23: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 23

Vacuous truth

• Example 1: Think of a tax form: Example 1: Think of a tax form: “Have you sent “Have you sent us details about all your children?”us details about all your children?” No children No children You’ve complied (without doing anything) You’ve complied (without doing anything)

• Example 2: Think of our definition of Example 2: Think of our definition of (x:=(x:=aa)) as as ““the result of substituting the result of substituting allall free occurrences of x in free occurrences of x in by aby a””No occurrences No occurrences dondon’’t do anything (after t do anything (after which itwhich it’’s true that all occurrences have been s true that all occurrences have been substituted)substituted)

Page 24: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 24

Some consequences of these definitions

• Sometimes, predicate logic is taught very Sometimes, predicate logic is taught very informallyinformally

• This makes it easy to understand simple formulasThis makes it easy to understand simple formulas• But each more complex case has to be explained But each more complex case has to be explained

separately, as if it was an exceptionseparately, as if it was an exception• By defining things properly once, complex By defining things properly once, complex

formulas fall out as special casesformulas fall out as special cases• One example: quantifier nestingOne example: quantifier nesting

Page 25: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 25

Back to Quantifier Exercise

RR((xx,,yy)=)=““xx relies upon relies upon yy””. Suppose the u.d. is. Suppose the u.d. isemptyempty. Now . Now consider these formulas:consider these formulas: xx((y Ry R((x,yx,y)))) yy((xx RR((x,yx,y)))) xx((y Ry R((x,yx,y))))Which of them is most informative?Which of them is most informative?Which of them is least informative?Which of them is least informative?

Topic #3 – Predicate Logic

Page 26: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 26

Back to our Quantifier Exercise

Now that the u.d. isNow that the u.d. is empty,empty,1.1. xx((y Ry R((x,yx,y)) is uninformative)) is uninformative2.2. yy((xx RR((x,yx,y)) is false!)) is false!3.3. xx((y Ry R((x,yx,y)) is uninformative)) is uninformativex(P(x))x(P(x)) is true if P is true if P(a)(a) is true for all is true for all aa.. If no If no xx exist then this makes exist then this makes x(P(x))x(P(x))

((““vacuouslyvacuously””) true) truex(P(x))x(P(x)) is true if is true if P(a)P(a) is true for some is true for some aa.. If no If no xx exist then this makes exist then this makes x(P(x))x(P(x)) false. false.

Topic #3 – Predicate Logic

Page 27: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 27

Back to models: Look at the old formula 3 again

3. 3. x x ((QQ((xx) ) PP((xx))) Consider this model:) Consider this model:

a: a: Q P b: Q P b: QQPP

c:c:Q P d: Q P d: QQP P

Is the proposition true or false in the model?Is the proposition true or false in the model?

Page 28: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 28

Look at formula number 3 again

3. 3. x x ((QQ((xx) ) PP((xx))) is true in this model:) is true in this model:

a: a: Q P b: Q P b: QQPP

c:c:Q P d: Q P d: QQP P

(3) Is true iff each of these is true:(3) Is true iff each of these is true: x x ((QQ((aa) ) PP((aa)))) x x ((QQ(b) (b) PP(b)(b))) x x ((QQ(c) (c) PP(c)(c))) x x ((QQ(d) (d) PP(d)(d)))

Page 29: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 29

Look at formula number 3 again

3. 3. x x ((QQ((xx) ) PP((xx))) is true in this model:) is true in this model:

a: a: Q P b: Q P b: QQPP

c:c:Q P d: Q P d: QQP P

(3) Is true because each of these is true:(3) Is true because each of these is true: QQ((aa) ) PP((aa)) … F T, hence … F T, hence TT QQ(b) (b) PP(b) (b) … F F, hence … F F, hence TT QQ(c) (c) PP(c) (c) … F T, hence … F T, hence TT QQ(d) (d) PP(d) (d) … F F, hence … F F, hence TT

Page 30: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 30

Predicate Logic essentials

• Predicates of different arity (one-place, Predicates of different arity (one-place, two-place, etc.)two-place, etc.)

• Quantifiers: [Quantifiers: [xx PP((xx)] :)] :≡≡ ““For all For all xx, , PP((xx).).”” [[x Px P((xx)] :)] :≡ ≡ ““There is/are There is/are xx such that such that PP((xx).).””

• Universes of discourse, bound & free vars.Universes of discourse, bound & free vars.

• The rest followsThe rest follows: empty domains, quantified : empty domains, quantified implications, quantifier nestingimplications, quantifier nesting

Page 31: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 31

Some common shorthands

• Sometimes the universe of discourse is Sometimes the universe of discourse is restricted within the quantification, restricted within the quantification, e.g.e.g.,, x>x>0 0 PP((xx) is shorthand for) is shorthand for

““For all For all xx that are greater than zero, that are greater than zero, PP((xx).).””

• How would you write this in formal How would you write this in formal notation?notation?

Topic #3 – Predicate Logic

Page 32: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 32

Some common shorthands

• Sometimes the universe of discourse is Sometimes the universe of discourse is restricted within the quantification, restricted within the quantification, e.g.e.g.,, x>x>0 0 PP((xx) is shorthand for) is shorthand for

““For all For all xx that are greater than zero, that are greater than zero, PP((xx).).””

==x x ((x>x>0 0 PP((xx))))

Topic #3 – Predicate Logic

Page 33: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 33

Some common shorthands

• Sometimes the universe of discourse is Sometimes the universe of discourse is restricted within the quantification, restricted within the quantification, e.g.e.g.,, x>x>0 0 PP((xx) is shorthand for) is shorthand for

““For all For all xx that are greater than zero, that are greater than zero, PP((xx).).””

==x x ((x>x>0 0 PP((xx)))) x>x>0 0 PP((xx) is shorthand for) is shorthand for

““There is an There is an x x greater than zero such that greater than zero such that PP((xx).).””

==x x ((x>x>0 0 PP((xx))))

Topic #3 – Predicate Logic

Page 34: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 34

Some common shorthands

• Consecutive quantifiers of the same type Consecutive quantifiers of the same type can be combined:can be combined: xyz Pxyz P((xx,,yy,,zz) ) defdef x x y y z Pz P((xx,,yy,,zz) )

xyz Pxyz P((xx,,yy,,zz) ) defdef x x y y z Pz P((xx,,yy,,zz) )

Topic #3 – Predicate Logic

Page 35: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 35

Theorems about logic

• WeWe are studying logical languages/calculi to are studying logical languages/calculi to allow you to use them (better)allow you to use them (better)

• LogiciansLogicians study logical languages/calculi to study logical languages/calculi to understand their limitationsunderstand their limitations

• Meta-theorems can, e.g., say things like “… Meta-theorems can, e.g., say things like “… cannot be expressed in predicate logic”cannot be expressed in predicate logic”

Page 36: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 36

Theorems about logic

• About propositional logic, we asked “What types About propositional logic, we asked “What types of things can we express?” How many connectives of things can we express?” How many connectives do we need?do we need?

• About predicate logic, logicians ask similar About predicate logic, logicians ask similar questions. For example, are these two quantifiers questions. For example, are these two quantifiers enough to be able to ‘say everything’?enough to be able to ‘say everything’?

• This is a question about the This is a question about the expressive powerexpressive power of of predicate logicpredicate logic

Page 37: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 37

Example: one

• As per their name, quantifiers can be used As per their name, quantifiers can be used to express that a predicate is true of a given to express that a predicate is true of a given quantityquantity (number) of objects. (number) of objects.

• Example:Example: Can predicate logic say “there Can predicate logic say “there exists at most one object with property P”? exists at most one object with property P”?

Page 38: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 38

Example: at most one

• Example:Example: Can predicate logic say “there Can predicate logic say “there exists at most one object with property P”? exists at most one object with property P”?

Yes (provided we have equality):Yes (provided we have equality):

xxy y ((((PP((x)x) PP((yy)) )) x= yx= y))

Page 39: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 39

Example: one

• Can predicate logic say “there exists exactly Can predicate logic say “there exists exactly one object with property P”? one object with property P”?

Page 40: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 40

Example: one

• Can predicate logic say “there exists exactly Can predicate logic say “there exists exactly one object with property P”? one object with property P”? xPxP((xx) ) xxyy((((PP((x)x) PP((yy))))x= y)x= y)

• ““There exist x such that P(x)” There exist x such that P(x)” andand“There exists at most one x such that P(x)”“There exists at most one x such that P(x)”

• Abbreviation: Abbreviation: !!xx PP((xx))((““there exists exactly one x such that P(x)there exists exactly one x such that P(x)””))

Page 41: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 41

Example: one

• Another way to write this:Another way to write this:

x x ((PP((xx) ) y y ((PP((yy) ) y y x x))))““There is an There is an xx such that such that PP((xx), such that there ), such that there is no is no yy such that P( such that P(yy) and ) and yy xx..””

x x binds binds xx throughout the conjunction: throughout the conjunction:

xx ((PP((xx) ) y y ((PP((yy) ) y y xx))))

Page 42: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 42

At least two

• Can predicate logic say “there exist at least Can predicate logic say “there exist at least two objects with property P”? two objects with property P”?

Page 43: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 43

At least two

• Can predicate logic say “there exist at least Can predicate logic say “there exist at least two objects with property P”? two objects with property P”?

• Yes:Yes:xx y y ((((PP((xx) ) PP((yy)) )) xx y y))

• Incorrect would beIncorrect would be xxPP((xx) ) y(Py(P((yy) ) x x y), y),(where (where xx occurs free, and which occurs free, and whichtherefore does not express a proposition)therefore does not express a proposition)

Page 44: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 44

Exactly two

• Can predicate logic say “there exist exactly Can predicate logic say “there exist exactly two objects with property P”?two objects with property P”?

Page 45: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 45

Exactly wo

• Can predicate logic say “there exist exactly Can predicate logic say “there exist exactly two objects with property P”?two objects with property P”?

• Yes:Yes:

• x x y y ((PP((xx) ) PP((yy) ) xx y y z z ((PP((zz) ) ( (z= x z= x z= y z= y)) ))))

Page 46: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 46

What’s wrong with

x x y y ((PP((xx) ) PP((yy) ) x x y) y) z z ((PP((zz) ) ( (z= x z= x z= y z= y ))))as a formalisation of as a formalisation of ‘‘exactly twoexactly two’’??

Page 47: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 47

What’s wrong with

x x y y ((PP((xx) ) PP((yy) ) x x y) y) z z ((PP((zz) ) ( (z= x z= x z= y z= y ))))as a formalisation of as a formalisation of ‘‘exactly twoexactly two’’??

• This is a conjunction of two separate This is a conjunction of two separate propositions. As a result, propositions. As a result, xx and and yy are not are not boundbound, so this is not even a proposition, so this is not even a proposition

Page 48: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 48

infinitely many

• Can predicate logic say “there exist Can predicate logic say “there exist infinitely manyinfinitely many objects with property P”? objects with property P”?

• No! [This follows from the so-called No! [This follows from the so-called Compactness Theorem: Compactness Theorem: “An infinite set S of “An infinite set S of formulas has a model iff every finite subset formulas has a model iff every finite subset of S has a model”of S has a model”]]

• How aboutHow about finitely manyfinitely many??

Page 49: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 49

finitely many

• How aboutHow about finitely manyfinitely many??• Suppose there existed a formula Suppose there existed a formula = =

“there exist only finitely many x such that “there exist only finitely many x such that so and so”so and so”

• Then Then = = “there exist infinitely many x “there exist infinitely many x such that so and so”such that so and so”

• We know that such a formula does not existWe know that such a formula does not exist• So, also So, also does not exist does not exist

Page 50: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 50

((Of course if we allow infinite conjunctions Of course if we allow infinite conjunctions then all this then all this cancan be expressed: be expressed:

!!xx PP((xx) ) 22!!xx PP((xx) ) 33!!xx PP((xx) ) … … ))

Page 51: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 51

• Can predicate logic say “Can predicate logic say “mostmost objects have objects have property P”? property P”?

• No! [This follows from the Compactness No! [This follows from the Compactness Theorem as well. Again, this is unless we Theorem as well. Again, this is unless we allow infinitely long disjunctions.]allow infinitely long disjunctions.]

• Can predicate logic say “Can predicate logic say “manymany objects have objects have property P”? property P”?

• No, only precisely defined quantitiesNo, only precisely defined quantities

Page 52: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 52

Bonus: Number Theory Examples

Let u.d. = the Let u.d. = the natural numbersnatural numbers 0, 1, 2, … 0, 1, 2, …

What do the following mean?What do the following mean?x x ((EE((xx) ) ( (y x=y x=22yy))))

x x ((PP((xx) )

((xx>1 >1 yz xyz x==yzyz yy1 1 zz11))))

Topic #3 – Predicate Logic

Page 53: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 53

Bonus: more Number Theory Examples

• Let u.d. = the Let u.d. = the natural numbersnatural numbers 0, 1, 2, … 0, 1, 2, … • ““A number A number xx has the property E if and only if it is has the property E if and only if it is

equal to 2 times some other number.equal to 2 times some other number.”” (even!)(even!)

x x ((EE((xx) ) ( (y x=y x=22yy))))• ““A number has A number has PP, iff it, iff it’’s greater than 1 and it isns greater than 1 and it isn’’t t

the product of any non-unity numbers.the product of any non-unity numbers.”” (prime!)(prime!)

x x ((PP((xx) ) ((xx>1 >1 yz xyz x==yzyz yy1 1 zz11))))

Topic #3 – Predicate Logic

Page 54: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 54

Goldbach’s Conjecture (unproven)

Using Using EE((xx) and ) and PP((xx) from previous slide,) from previous slide,

x(x( [ [xx>2 >2 EE((xx)] )] → →

pp q Pq P((pp) ) PP((qq) ) pp++qq = = x)x)..

Topic #3 – Predicate Logic

Page 55: Module #1 - Logic 8/28/2015Michael Frank / Kees van Deemter1 Remember: I. Construct a model where 1 and 4 are true, while 2 and 3 are false Let the u.d.

Module #1 - Logic

04/19/23 Michael Frank / Kees van Deemter 55

Goldbach’s Conjecture (unproven)

Using Using EE((xx) and ) and PP((xx) from previous slide,) from previous slide,

x(x( [ [xx>2 >2 EE((xx)] )] → →

pp q Pq P((pp) ) PP((qq) ) pp++qq = = x)x)..

““Every even number greater than 2 Every even number greater than 2 is the sum of two primes.is the sum of two primes.””

Topic #3 – Predicate Logic