1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke....

57
1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

Transcript of 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke....

Page 1: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

1

CA 208 Logic

First-Order Predicate Logic

Kate is a student.

Every student is broke.

-----------------------------

Kate is ???

Page 2: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

2

CA 208 Logic Propositional Logic is not enough ...

Kate is a student. PEvery student is broke. Q----------------------------- --Kate is broke. R

Is that a valid inference in propositional logic?

Sokrates is human. WEvery human is mortal. S----------------------------- --Sokrates is mortal. T

Page 3: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

3

CA 208 Logic Propositional Logic is not enough ...

Kate is a student. PEvery student is broke. Q----------------------------- --Kate is broke. R

Is that a valid inference in propositional logic?

Sokrates is human. WEvery human is mortal. S----------------------------- --Sokrates is mortal. T

Page 4: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

4

CA 208 Logic Propositional Logic is not enough ...

Kate is a student. PEvery student is broke. Q----------------------------- --Kate is broke. R

Is that a valid inference in propositional logic?

Sokrates is human. WEvery human is mortal. S----------------------------- --Sokrates is mortal. T

Page 5: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

5

CA 208 Logic Propositional Logic is not enough ...

7 is a prime number. PEvery prime number is odd. Q----------------------------- --7 is odd. R

Kate is a student. W----------------------------- --Somebody/thing is a student. T

Kate owns Google. U----------------------------- --Kate owns something. V

Page 6: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

6

CA 208 Logic Propositional Logic is not enough ... Propopsitional logic is not fine-grained (expressive)

enough to capture many of these intuitively valid inferences

In fact translated into propositional logic they would give you non-valid inference schemas (and you have seen lots of them on the previous slides)

The problem is that propositional logic can not go inside atomic propositions (sentences) and all we get is P, Q, R, etc...

Page 7: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

7

CA 208 Logic

So what do we need to caputure those inferences????? We need a logic that can break down atomic propositions into

(some of) their constituent parts and make explicit how they fit together

Need to be able to talk about

Individuals: Kate, 7, Google, ... Properties of individuals: being a student, human, prime number, ... Relationships between individuals: a owns b, ... Quantifiers and variables: every, some, ...

Thats what (First-Order) Predicate Logic (FOPL) gives you!

Page 8: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

8

CA 208 Logic Propositional Logic is not enough ...

Kate is a student. P student(k)Every student is broke. Q x (student(x)broke(x))----------------------------- -- ----------------------------------Kate is broke. R broke(k)

Sokrates is human. W human(s)Every human is mortal. S x (human(x)mortal(x))----------------------------- -- ----------------------------------Sokrates is mortal. T mortal(s)

Page 9: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

9

CA 208 Logic Propositional Logic is not enough ...

Kate is a student. P student(k)Every student is broke. Q x (student(x)broke(x))----------------------------- -- ----------------------------------Kate is broke. R broke(k)

Sokrates is human. W human(s)Every human is mortal. S x (human(x)mortal(x))----------------------------- -- ----------------------------------Sokrates is mortal. T mortal(s)

Page 10: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

10

CA 208 Logic Propositional Logic is not enough ...

Kate is a student. P student(k)Every student is broke. Q x (student(x)broke(x))----------------------------- -- ----------------------------------Kate is broke. R broke(k)

Sokrates is human. W human(s)Every human is mortal. S x (human(x)mortal(x))----------------------------- -- ----------------------------------Sokrates is mortal. T mortal(s)

Page 11: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

11

CA 208 Logic Propositional Logic is not enough ...

7 is a prime number. P prime(7)Every prime number is odd. Q x (prime(x)odd(x))----------------------------- -- -----------------------------7 is odd. R odd(7)

Kate is a student. W student(k)----------------------------- -- ----------------Somebody/thing is a student. T x student(x)

Kate owns Google. U own(k,g)----------------------------- -- ---------------Kate owns something. V x own(k,x)

Page 12: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

12

CA 208 Logic Translation key:

7 7, prime number prime(_), odd odd(_)

7 is a prime number. prime(7)Every prime number is odd. x (prime(x)odd(x))----------------------------- -----------------------------7 is odd. odd(7)

Translation key:

Kate k, Google g, own own(_,_)

Kate owns Google. own(k,g)----------------------------- ---------------Kate owns something. x own(k,x)

Page 13: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

13

CA 208 Logic And now something amazing happens:

Kate is a student. student(k) P(j)Every student is broke. x (student(x)broke(x)) x (P(x)Q(x))----------------------------- ---------------------------------- --------------------Kate is broke. broke(k) Q(j)

Sokrates is human. human(s) P(j)Every human is mortal. x (human(x)mortal(x)) x (P(x)Q(x))----------------------------- ---------------------------------- --------------------Sokrates is mortal. mortal(s) Q(j)

7 is a prime number. prime(7) P(j)Every prime number is odd. x (prime(x)odd(x)) x (P(x)Q(x))----------------------------- ----------------------------- --------------------7 is odd. odd(7) Q(j)

Do you see what these guys have in common??

Page 14: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

14

CA 208 Logic And now something amazing happens:

Kate is a student. student(k) P(j)Every student is broke. x (student(x)broke(x)) x (P(x)Q(x))----------------------------- ---------------------------------- --------------------Kate is broke. broke(k) Q(j)

Sokrates is human. human(s) P(j)Every human is mortal. x (human(x)mortal(x)) x (P(x)Q(x))----------------------------- ---------------------------------- --------------------Sokrates is mortal. mortal(s) Q(j)

7 is a prime number. prime(7) P(j)Every prime number is odd. x (prime(x)odd(x)) x (P(x)Q(x))----------------------------- ----------------------------- --------------------7 is odd. odd(7) Q(j)

Do you see what these guys have in common?? The inference doesn’t depend on your particular choice of individuals, poperties and relations! Just the pattern .....!

Page 15: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

15

CA 208 LogicSyntax of First-Order Predicate Logic FOPL

Lexicon (the basic words in the language of FOPL)

Particular individuals = constant symbols: {k,l,m, ...}

Arbitrary individuals = variable symbols: {x, y, z,...}

Properties of individuals = 1-place predicates: {human(_), prime(_), broke(_), ...}

Relations between individuals = n-place predicates: {own(_,_), buy(_,_), give(_,_,_), ...}

Quantifiers over individuals = forall, exists: {,}

Logical connectives (unary and binary): {, , , } (from propositional logic!)

Brackets: {‘(‘,’)’}

Page 16: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

16

CA 208 Logic Let Var be a (countably infinite) set of variables Var = {x,y,z, ...} Let Const be a (countably infinite) set of constants Const = {a,b,c, …} Let Π be a (countably infinite ...) set of predicate symbols Π = {P¹_1,…, P¹_m,… ,

P²_1, ..., P²_m,…, Pⁿ_1, ..., Pⁿ_m,...}, for each arity 1 to n

Terms = Var Const

If t¹, …, tⁿ Terms and Pⁿ Π, then Pⁿ(t¹, …, tⁿ) WFF (atomic formulas)

If Φ WFF, then Φ WFF (complex formulas)

If Φ, Ψ WFF, then (Φ Ψ) WFF If Φ, Ψ WFF, then (Φ Ψ) WFF If Φ, Ψ WFF, then (Φ Ψ) WFF If Φ, Ψ WFF, then (Φ Ψ) WFF

If α Var and Φ WFF, then α Φ WFF If α Var and Φ WFF, then α Φ WFF

Nothing else is a formula.

Page 17: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

17

CA 208 Logic A particular choice of

Var Const Π

fixes a particular language of FOPL

E.g. let

Var = {x,y,z, ...} Const = {j, k, l, g, 7, …} Π = {human¹, student¹, broke¹, prime¹, odd¹, own²}

Page 18: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

18

CA 208 LogicWhich of the following are WWFs in the particular FOPL language fixed in previous slide?

human(k) xy own(x,y) human(student) xy own(x,y) prime(k) x (human(x) own(x,g)) prime(7) x odd(x) human(k,j) x (odd(x)) prime(7) x even(x) own(k,g) odd(5) own(k j,g) prime(7) human(k) (prime(7) human(k)) (prime(7) human(k)) (prime(7) human(k)) (prime(7) human(k)) x broke(x) k x own(x,g) x own(x,x) x own(x,x,x) x y own(x,y)

Page 19: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

19

CA 208 LogicTranslate the following into FOPL:

Kate is human human(k) 7 is prime prime(7) 7 is not prime prime(7) Kate owns Google own(k,g) Somebody owns Google. x own(x,g) Every student is broke. x (student(x) broke(x)) A student is broke. x (student(x) broke(x))

Question: why not

Every student is broke. x (student(x) broke(x)) ???

Page 20: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

20

CA 208 LogicTranslate the following into FOPL:

Kate is human human(k) 7 is prime prime(7) 7 is not prime prime(7) Kate owns Google own(k,g) Somebody owns Google. x own(x,g) Every student is broke. x (student(x) broke(x)) A student is broke. x (student(x) broke(x))

Question: why not

Every student is broke. x (student(x) broke(x)) ???

Page 21: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

21

CA 208 LogicTranslate the following into FOPL:

Kate is human human(k) 7 is prime prime(7) 7 is not prime prime(7) Kate owns Google own(k,g) Somebody owns Google. x own(x,g) Every student is broke. x (student(x) broke(x)) A student is broke. x (student(x) broke(x))

Question: why not

Every student is broke. x (student(x) broke(x)) ???

Page 22: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

22

CA 208 LogicWe’ll develop syntactic |- and semantic |= consequence relations for FOPL

Why? Because thats what logic is about: remember, logic tell you what follows from what ....

First we’ll do |-

We’ll use the Natural Deduction (ND) proof system

The good news is that everything we learned about ND in Propositional Logic carries over to FOPL : all the introduction and elimination rules for the binary connectives and all the rules for negation

What else do we need?

We need ND rules for the quantifiers (and then we are done) ...

This being ND, the quantifier rules come in pairs: we have an introduction rule amd an elimination rule for each of the quantifiers {,}

Page 23: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

23

CA 208 Logic Introduction Elimination

П1 П2 П П : : : : A B A B A B ---------- (I) --------- (E) -------- (E) A B A B

П П П [A]ass [B]ass

: : : : : A A A B C C --------- (I) -------- (I) ----------------------------------------- (E) A B B A C

Page 24: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

24

CA 208 Logic Introduction Elimination

[A]ass П1 П2

: : :

B A A → B

------- (→I) ---------------- (→E)

A → B B

Page 25: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

25

CA 208 Logic Introduction Elimination

[A]ass П1 П2 : : : A A ------- ( I) ---------------- ( E) A

[A]ass П : or : or

----- (ex falso quod libet) A A ------- ------ --------- A A A A

Page 26: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

26

CA 208 Logic Introduction Elimination

П П : : P(c) x P(x)

------- ( I) *¹ ---------- ( E) x P(c)[x/c] P(x)[c/x]

П П [P(x)[c/x]]ass : : : P(x)[c/x] x P(x) Q

----------- ( I) -------------------- ( E) *² x P(x) Q

Page 27: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

27

CA 208 LogicLots of example proofs in ND here (on the blackboard ...) Fix a language of FOPL, e.g. let Var = {x,y,z, ...} Const = {j, k, l, g, 7, …} Π = {human¹, student¹, broke¹, prime¹, odd¹, own²}

{x broke(x)} |- broke(k)

x broke(x)--------------- ( E) broke(k)

{x broke(x)} |- y broke(y)

x broke(x)--------------- (E) broke(k)-------------- (I)y broke(y)

Page 28: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

28

CA 208 Logic

{x (student(x) broke(x)) student(k)} |- broke(k)

x (student(x) broke(x))---------------------------------- ( E)

student(k) student(k) broke(k) --------------------------------------------------- (E) broke(k)

{x (student(x) broke(x)) student(k)} |- z broke(z)

x (student(x) broke(x))---------------------------------- ( E)

student(k) student(k) broke(k) --------------------------------------------------- (E) broke(k) ----------- (I) z broke(z)

Page 29: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

29

CA 208 Logic

{own(k,g)} |- x own(k,x)

own(k,g) ------------- (I) x own(k,x)

{} |- (own(k,g) x own(k,x))

[own(k,g)]ass¹ ------------- (I)

x own(k,x)------------------------------ (I)¹

(own(k,g) x own(k,x))

Page 30: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

30

CA 208 Logic

{own(k,g)} |- x y own(x,y)

own(k,g) ------------- (I) y own(k,y) ------------- (I) x y own(x,y)

{own(k,g)} |- x own(x,x) ??? Can’t do that in ND (and should not be able to!!) but:

{own(g,g)} |- x own(x,x)

own(g,g) ------------- (I) x own(x,x)

Page 31: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

31

CA 208 Logic{own(k,g)} |- x own(x,x) ??? Can’t do that in ND (and should not be able to!!) but:

{own(g,g)} |- x own(x,x)

own(g,g) ------------- (I) x own(x,x)

{own(g,g)} |- x y own(x,y)

own(g,g) ------------- (I) y own(g,y) ------------- (I) x y own(x,y)

Page 32: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

32

CA 208 Logic Introduction Elimination

П П : : P(c) x P(x)

------- ( I) *¹ ---------- ( E) x P(c)[x/c] P(x)[c/x]

П П [P(x)[c/x]]ass : : : P(x)[c/x] x P(x) Q

----------- ( I) -------------------- ( E) *² x P(x) Q

Page 33: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

33

CA 208 Logic Introduction Elimination

П П : : P(c) x P(x)

------- ( I) *¹ ---------- ( E) x P(c)[x/c] P(x)[c/x]

П П [P(x)[c/x]]ass : : : P(x)[c/x] x P(x) Q

----------- ( I) -------------------- ( E) *² x P(x) Q

Page 34: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

34

CA 208 Logic

Introduction П : P(c)

------- ( I) *¹ (side condition)

x P(c)[x/c]

*¹: c does not occur in premise or open, undischarged assumption on which P(c) depends. In other words “c is a truly arbitrary constant symbol ….”

Page 35: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

35

CA 208 Logic{broke(k)} |- x broke(x) ??? No!! Can’t do that in ND (and should not be able to!!) but:

{x broke(x)} |- z broke(z)

x broke(x)--------------- (E) broke(g) ----------- (I) z broke(z)

{x (student(x) broke(x)), z student(z)} |- y broke(y)

z student(z) x (student(x) broke(x)) ---------------- (E) -------------------------------- (E) student(k) student(k) broke(k) ---------------------------------------------(E) broke(k) ------------- (I) y broke(y)

Page 36: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

36

CA 208 Logic

Elimination П [P(x)[c/x]]ass : : x P(x) Q

(side conditions) ---------------------- ( E) *² Q

*²: c does not occur in x P(x) nor in Q nor in any premise or open (undischarged) assumption on which Q depends (except [P(x)[c/x]]ass which is discharded by the proof).

Page 37: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

37

CA 208 LogicShow that:

{x (student(x) broke(x)), z student(z)} |- y broke(y)

x (student(x) broke(x)) ---------------------------------- (E)

[student(k)ass]¹ student(k) broke(k) -------------------------------------------------- (E) broke(k) ---------- (I) z student(z) y broke(y) -------------------------------------------------- (E)¹ y broke(y)

Page 38: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

38

CA 208 LogicThere is method in the madness ...:

Introduction rules Elimination rules

for each connective.

Premisses are “resources” from which to construct conclusions.

Some times complex premises need to be broken apart to get at the components (as they are used in the conclusion): elimination rules

Sometimes simple premises need to be put together into more complex formulas (as they are used in the conclusion): introduction rules

Sometimes you need a bit of both in a proof: elimination rules and introduction rules

Page 39: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

39

CA 208 LogicThere is method in the madness ...:

Introduction rules Elimination rules

for each connective.

This gives an inherent symmetry to Natural Deduction Rules/Calculus

Some times logicians wax lyrical about this ... You have seen the Gentzen/Prawitz-style formulation of ND for FOPL Thats not the only one – but its nice as the proof rules for the quantifiers

work for both intuitionistic and classical versions of FOPL Other formulation of ND for FOPL (classical only): ... Quine (1959), Suppes

(1957), Copi (1954)

Page 40: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

40

CA 208 Logic

{P_1, ..., P_n} |- C iff

P_1, ..., P_n, [A_1]ass, ...,[A_m]ass

ND

C

without any open (undischarged) intermediate assumptions

Page 41: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

41

CA 208 Logic Up to now we have defined |- for FOPL (syntactic consequence relation) Now we’ll define |= for FOPL (semantic consequence relation)

Recall:

{P_1, ..., P_n} |= C iff in all the situations in which all of P_1 to P_n are true, C is true as well

Or, equivalently

{P_1, ..., P_n} |= C iff you can not come up with a single situation in which all of P_1 to P_n are true, and C is false

We’ll need to make this talk about “situations” (ways in which the world is or could be) formal ...

We’ll do this in terms of models. Models are mathematical objects (non-empty sets with relations defined on those sets) which represent “situations”.

These models will allow us then to interpret WFFs of FOPL as true or false, hence allow us to define |= for FOPL formally ... thats da evil plan ...

Page 42: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

42

CA 208 LogicThese models will allow us then to interpret WFFs of FOPL as true or false, hence allow

us to define |= for FOPL formally ... thats da evil plan ...

Trouble is there are infinitely many WFFs ... (by the way, same for Propositional Logic)

So we’ll need a way of defining the truth/falsity of -many WFFs in a finite way ...

We’ll do this the same way we did it for Propositional Logic

We give a compositional semantics, where each syntactic formation (i.e.grammar) rule is paired with a semantic interpretation rule ...

In other words: our syntax builds more and more complex objects out of simpler objects (syntax is a inductive specification) and

Our semantics (semantic interpretation rules) recurses down from the complex to the simpler objects and defines the meaning of the complex objects depending on the meaning of its simpler component parts as defined by the syntax ...

Here is the syntax again ...

Page 43: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

43

CA 208 Logic Let Var be a (countably infinite) set of variables Var = {x,y,z, ...} Let Const be a (countably infinite) set of constants Const = {a,b,c, …} Let Π be a (countably infinite ...) set of predicate symbols Π = {P¹_1,…, P¹_m,… ,

P²_1, ..., P²_m,…, Pⁿ_1, ..., Pⁿ_m,...}, for each arity 1 to n

Terms = Var Const

If t¹, …, tⁿ Terms and Pⁿ Π, then Pⁿ(t¹, …, tⁿ) WFF (atomic formulas)

If Φ WFF, then Φ WFF (complex formulas)

If Φ, Ψ WFF, then (Φ Ψ) WFF If Φ, Ψ WFF, then (Φ Ψ) WFF If Φ, Ψ WFF, then (Φ Ψ) WFF If Φ, Ψ WFF, then (Φ Ψ) WFF

If α Var and Φ WFF, then α Φ WFF If α Var and Φ WFF, then α Φ WFF

Nothing else is a formula.

Page 44: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

44

CA 208 Logic What’s a model? A model is always a model for a specific language, so given a FOPL

language L with CONST = {j,k,m}, VAR = {x,y,z} and П = {student¹, broke¹, like²}

M = < U, > is a model where U {} (U is called the “Universe”) and is an interpretation function interpreting all the constant symbols and

predicate symbols in the language

E.g.: U = {□,◊,○} (j) = □, (m) = ◊, (k) = ○ , (student) = {□,○}, (broke) = {□,○}

(like) = {<□,□>,<○,□>,<◊,○>}

Page 45: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

45

CA 208 Logic Informally (!!) now ... M = < U, > is a model where

U = {□,◊,○} (j) = □, (m) = ◊, (k) = ○ , (student) = {□,○}, (broke) = {□,○}

(like) = {<□,□>,<○,□>,<◊,○>} What’s the meaning (true/false) of

student(m) false student(j) true student(k) true broke(k) true broke(m) false like(k,j) true like(k,k) false like(j,j) true

Page 46: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

46

CA 208 Logic Informally (!!) now ... M = < U, > is a model where

U = {□,◊,○} (j) = □, (m) = ◊, (k) = ○ , (student) = {□,○}, (broke) = {□,○}

(like) = {<□,□>,<○,□>,<◊,○>} In this model M, what’s the meaning (true/false) of

student(m) false student(j) true student(k) true broke(k) true broke(m) false like(k,j) true like(k,k) false like(j,j) true

Page 47: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

47

CA 208 Logic So far so good, but sth. is missing ...

M = < U, > is a model where U {} (U is called the “Universe”) and is an interpretation function interpreting all the constant

symbols and predicate symbols in the language

We haven’t said anything about how to interpret the variables yet ... !

That’s the job of a variable assignment function g g: Var ↦ U (g is a total function from Var into U)

E.g.: g(x) = ○, g(y)= ○, g(z)= ○, Actually, any way of fixing g does the job (why will become clear

later) ...

Page 48: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

48

CA 208 Logic Let Var be a (countably infinite) set of variables Var = {x,y,z, ...} Let Const be a (countably infinite) set of constants Const = {a,b,c, …} Let Π be a (countably infinite ...) set of predicate symbols Π = {P¹_1,…,

P¹_m,… , P²_1, ..., P²_m,…, Pⁿ_1, ..., Pⁿ_m,...}, for each arity 1 to n

Let M = < U, > be a model where U {} (c) U, for each c Const (Pⁿ) ⊆ U x U x ... x U (n-times), for each Pⁿ Π

Let g be a variable assignment/interpretation function g: Var ↦ U

We now define I_[M,g] : interpretation relative to a model M and variable assignment function g

I_[M,g] (t) ≔ (t), if t Const (Terms) I_[M,g] (t) ≔ g(t), if t Var

Page 49: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

49

CA 208 Logic I_[M,g] (Pⁿ(t¹, …, tⁿ)) ≔ 1 iff < I_[M,g] (t¹), …, I_[M,g] (tⁿ)> (Pⁿ)

(atomic formulas)

I_[M,g] (Φ) ≔ 1 iff I_[M,g] (Φ) = 0 (complex formulas)

I_[M,g] (Φ Ψ) ≔ 1 iff I_[M,g] (Φ) = 1 and I_[M,g] (Ψ) = 1 I_[M,g] (Φ Ψ) ≔ 1 iff I_[M,g] (Φ) = 1 or I_[M,g] (Ψ) = 1 I_[M,g] (Φ Ψ) ≔ 1 iff I_[M,g] (Φ) = 0 or I_[M,g] (Ψ) = 1 I_[M,g] (Φ Ψ) ≔ 1 iff I_[M,g] (Φ) = I_[M,g] (Ψ)

I_[M,g] (α Φ) ≔ 1 iff for all u U, I_[M,g(u/α)] (Φ) =1 I_[M,g] (α Φ) ≔ 1 iff for at least one u U, I_[M,g(u/α)] (Φ) =1

Page 50: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

50

CA 208 Logic This is the classical Tarski-style definition of the interpretation of a WFF of a

particular language of FOPL in a model M, relative to an assignment function g.

Notice that (as for the case of Propositional Logic earlier on in the course) the meaning of a WFF is unpacked using a distinction between object language (, , , ... ) and meta-language (English: not, and, for all, ...)

Notice that in this Tarski-style definition, the interpretation I_[M,g] of a formula is effectively truth relative to model M and variable assignment function g

Another way of saying that is that that a formula Φ is true iff in a model M its interpretation I_[M,g ] (Φ) = 1 for all g:

I_[M] (Φ) = 1 iff for all g, I_[M,g] (Φ) = 1

A formula Φ is valid iff it is true in all models:

I(Φ) = 1 iff for all M, I_[M] (Φ) = 1 iff for all M and g, I_[M,g] (Φ) = 1

Page 51: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

51

CA 208 Logic With this we can now define/unpack the semantic consequence relation

|= for FOPL (in terms of validity I, truth I_[M] and interpretation I_[M,g] ...)

{P_1, ...., P_n} |= C iff ((P_1 .... P_n) C) is valid iff ((P_1 .... P_n)) C is true in all models iff the interpretation of ((P_1 .... P_n) C) is 1 for all models and all

variable assignment functions

In symbols:

{P_1, ...., P_n} |= C iff I((P_1 .... P_n) C) = 1 (i.e. formula is valid) iff I_[M] ((P_1 .... P_n) C) = 1 for all models M iff I_[M,g] ((P_1 .... P_n) C) = 1 for all models M and all variable

assignment functions g

Page 52: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

52

CA 208 Logic Do example model and some interpretations on

blackboard in class ...

Page 53: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

53

CA 208 Logic So what’s a model? A model is always a model for a specific language, so Given a FOPL language L with CONST = {j,k,m}, VAR = {x,y,z}

and П = {student¹, broke¹, like²} Interpretation in a model: given our definition of the syntax and

semantics of First Order Predicate Logic (FOPL), and a (specific) language of FOPL with CONST = {j,k,m}, VARS = {x,y,z} and PRED = {student¹, broke¹, like²} and the following model M = < U, > with U = {□, ◊, ○} and (j) = □, (m) = ◊, (k) = ○ , (student) = {□, ○}, (broke) = {□, ○} (like) = {<□,□>,<○,□>,<◊,○>} and a variable assigment function g with g(x) = ○, g(y)= ○, g(z)= ○, compute the truth value of the following formulas relative to model M and variable assignment function g (i.e. compute which of the following are satisfied in M and g)?

Page 54: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

54

CA 208 Logic Ex6 Interpretation in a model: given our definition of the syntax and semantics of First Order Predicate

Logic (FOPL), and a (specific) language of FOPL with CONST = {j,k,m}, VARS = {x,y,z} and PRED = {student¹, broke¹, like²} and the following model M = < U, > with U = {□, ◊, ○} and (j) = □, (m) = ◊, (k) = ○ , (student) = {□, ○}, (broke) = {□, ○} (like) = {<□,□>,<○,□>,<◊,○>} and a variable assigment function g with g(x) = ○, g(y)= ○, g(z)= ○, compute the truth value of the following formulas relative to model M and variable assignment function g (i.e. compute which of the following are satisfied in M and g)?

like(j,j) (like(j,j) like(k,j)) like(j,k) x student(x) z student(z) x student(x) z student(z) y broke(y) x (student(x) broke(x)) x (student(x) broke(x))

Translate the FOPL formulas above into corresponding sentences in English (assume that j translates to John, m to Mary and k to Kate while the predicate symbols translate into the corresponding English verbs (like), nouns (student) and adjectives (broke)).

Page 55: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

55

CA 208 LogicGood things about the Natural Deduction calculus:

Easy to learn Intutive account for each of the connectives Close to how humans (mathemanticians ...) do proofs ND rules can be used to define

Minimal Logic Intuitionistic Logic Classical Logic

Not so good things about Natural Deduction Calculus:

ND Proofs can require quite a bit of ingenuity and expertise ND Proofs have non-local aspect (management of open intermediate premisses ...) NP proofs can not easily be automated

Thats why we have other Calculi (Proof Systems) with are good for e.g. Automation of Proofs ... Thats the subject of more advanced classes in Logic, Theorem Proving, AI, ...

Page 56: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

56

CA 208 LogicWhat’s the relationship between |- and |=?

(P_1, ..., P_n) |- C the syntactic consequence relation (ND proofs) (P_1, ..., P_n) |= C the semantic consequence relation (situations, truth tables ...)

For classical logics such as Propositional Logic we have that

(P_1, ..., P_n) |- C iff (P_1, ..., P_n) |= C |- iff |=

i.e. anything (conclusion, theorem) that can be proved (in ND) is also a semantic consequence of the same premises: if |- then |= (“soundness” of the calculus – here ND – i.e your proof rules are good, they don’t produce rubbish)

And anything (conclusion, theorem) that is a sematic consequence of the some premises can also be proved (with here ND) from the same premises (“completeness” of the calculus – here ND – i.e. your proof rules allow to prove everything that can be proved)

|- iff |= = if |- than |= and if |= then |- If |- then |= (Soundness) If |= then |- (Completeness)

This is “metalogic” = looking at logic as a mathematical object and studying its properties. Soundness and completeness proofs first given by Kurt Gödel. We don’t do that in this introduction to logic here ……

Page 57: 1 CA 208 Logic First-Order Predicate Logic Kate is a student. Every student is broke. ----------------------------- Kate is ???

57

CA 208 Logic

Propositional Logic as a Calculus: |-

[A]ass

:

B

-------

A → B