Chapter 8: Syntax and Semantics I

19
Chapter 8: Syntax and Semantics I 80-210: Logic & Proofs July 21, 2009 Karin Howe

description

Chapter 8: Syntax and Semantics I. 80-210: Logic & Proofs July 21, 2009 Karin Howe. Recall the Kangaroo Argument. All kangaroos can fly. Jim is a kangaroo. ____ Jim can fly. In "standard form:" If it is a kangaroo , it can fly .K  F Jim is a kangaroo. _______ K ____ - PowerPoint PPT Presentation

Transcript of Chapter 8: Syntax and Semantics I

Page 1: Chapter 8: Syntax and Semantics I

Chapter 8: Syntax and Semantics I

80-210: Logic & Proofs

July 21, 2009

Karin Howe

Page 2: Chapter 8: Syntax and Semantics I

Recall the Kangaroo Argument

1. All kangaroos can fly.

2. Jim is a kangaroo.____ Jim can fly.

In "standard form:"

1. If it is a kangaroo, it can fly. K F

2. Jim is a kangaroo._______ K____

Jim can fly. F

Page 3: Chapter 8: Syntax and Semantics I

Isn't this a bit fishy?

1. If it is a kangaroo, it can fly. K F

2. Jim is a kangaroo._______ K____ Jim can fly. F

o Note the mismatch between the antecedent on line 1, and the statement on line 2!

o Also note that we've changed line 1 - used to read "All kangaroos can fly"!

Page 4: Chapter 8: Syntax and Semantics I

The Kangaroo Argument done "right"

1. All kangaroos can fly.

2. Jim is a kangaroo.____ Jim can fly.

1. K

2. J___ F

o There - that's better! Right?

o Whoops! ….. now it's invalid!

o Yet, the Kangaroo Argument is clearly valid!!

o Need a way of representing the structure of the argument that can highlight the internal structure of the statements, and their relationship to each other.

o Predicate logic to the rescue!

Page 5: Chapter 8: Syntax and Semantics I

The Kangaroo Argument done RIGHT!

1. All kangaroos can fly.

2. Jim is a kangaroo.____ Jim can fly.

Read this off as:

1. For all x, if x is a kangaroo, then x can fly.

2. Jim is a kangaroo.____________________ Jim can fly.

Symbolized:

1. (x)(K(x) F(x)) K(x) = x is a kangaroo

2. K(j)____________ F(x) = x can fly F(j) j = Jim

Page 6: Chapter 8: Syntax and Semantics I

The language of predicate logic

• New symbols: : for all

• Use to symbolize words like "all," "every" : there exists

• Use to symbolize "some" (means at least one)

• Punctuation: ,• Keep old symbols: , &, , , • Previous punctuation: ( )

Page 7: Chapter 8: Syntax and Semantics I

Predicates

• n-ary predicates (n > 0)– Examples:

• x is a dog: D(x)

• x loves y: L(x,y)

• x gave y the z: G(x,y,z)

• In theory, you can have any number of places in a predicate: R(x1, x2, …, x8, …. x27, …)

• Can also have 0-place predicates: atomic formulae (e.g., P, Q, R, etc.)

Page 8: Chapter 8: Syntax and Semantics I

Constants (Singular terms)

• Can also have constants in our language, that refer known individuals with a certain quality.

• Convention: these constants are restricted to letters a - t• Use these constants to plug "holes" in predicates with the

known individuals who have the indicated quality:• _____ laughedL(x)

m = Mary L(m)n = Nancy L(n)o = Oscar L(o)a = Ursula L(a)

Page 9: Chapter 8: Syntax and Semantics I

Truth and Falsity in Predicate Logic

• In an important sense, no different than in propositional logic

• Consider the atomic formula: A– A = Alligators live in Florida

• True or false?

– A = Alligators live in Pittsburgh• True or false?

• Consider the predicate formula: – K(x) = x is a kangaroo; j = Jim

• K(j) – true or false?

– K(x) = x is a logic professor; j = Jim• K(j) – true or false?

• All of the usual truth table rules (for the connectives) will still apply

Page 10: Chapter 8: Syntax and Semantics I

Interpretations

• Definition: Truth and falsity with respect to an interpretation:1. If is a 0-place predicate letter, then is true iff I() = T.

2. If is of the form (x1, …, xn) where is a n-place predicate letter (with n > 0), and x1, …, xn are n terms, then is true on I iff <I(x1), …, I(xn)> is in I()

• Example:– S(x,y,z) = the sum of x and y is z– P(x,y,z) = the product of x and y is z– Domain: {0,1,2,3,4,5}– Interpretation:

• I(S) = {<0,1,1>,<0,2,2>,<1,1,2>,<1,3,4>,<2,3,5>,<4,1,5>, <1,0,1>, …}• I(P) = {<0,1,0>,<0,2,0>,<1,1,1>,<1,3,3>,<1,3,3>,<4,1,4>, <1,0,0>, …}

– True or False?S(1,3,4) S(0,1,1) S(3,1,4) S(4,3,5)

P(0,1,0) P(1,1,1) P(2,3,5) P(5,3,4)

Page 11: Chapter 8: Syntax and Semantics I

Change the Interpretation, Change the Truth Value

• Example:– S(x,y,z) = x is sitting between y and z

– P(x,y,z) = x is next to y and two places to the left of z

– Domain: {Amelie, Chris, Daniel, Nathan, Sungwoo, Tomasz}

– Interpretation:• I(S) = {<a,c,d>,<c,n,a>,<d,a,c>,<n,c,t>,<s,d,t>,<t,s,n>}

• I(P) = {<a,c,s>,<c,n,d>,<d,a,t>,<n,c,a>,<s,d,n>,<t,s,c>}

– True or False?

S(a,n,s) S(d,a,c) S(s,t,n) S(n,c,t)

P(a,c,d) P(d,a,t) P(d,s,n) P(n,c,a)

Page 12: Chapter 8: Syntax and Semantics I

Practice with SymbolizationHey diddle diddle,The cat and the fiddle,The cow jumped over the moon,Dictionary:

J(x,y) = x jumped over yc = the cow m = the moon

Symbolization: J(c,m)

The little dog laughed to see such sport,Dictionary:

L(x) = x laughed to see such sportd = the little dog

Symbolization:L(d)

And the dish ran away with the spoonDictionary:

R(x,y) = x ran away with y a = the dishs = the spoon

Symbolization:R(a,s)

Page 13: Chapter 8: Syntax and Semantics I

Jack and Jill went up the hillTo fetch a pail of water.Dictionary:

W(x,y,z) = x went up y to do za = Jacki = Jillh = the hillf = fetch a pail of water

Symbolization:W(a,h,f) & W(i,h,f)

Jack fell down and broke his crown,Dictionary:

F(x) = x fell downB(x) = x broke x's crowna = Jack

Symbolization:F(a) & B(a)

And Jill came tumbling afterDictionary:

T(x) = x came tumbling afteri = Jill

Symbolization:T(i)

Page 14: Chapter 8: Syntax and Semantics I

Hickory, dickory, dock,The mouse ran up the clock.Dictionary:

R(x,y) = x ran up the ym = the mousec = the clock

Symbolization:R(m,c)

The clock struck one,Dictionary:

S(x,y) = x struck yc = the clocko = one

Symbolization:S(c,o)

The mouse ran down,Dictionary:

R(x) = x ran downm = the mouse

Symbolization:R(m)

Hickory, dickory, dock

Page 15: Chapter 8: Syntax and Semantics I

The itsy bitsy spider went up the water spout.Dictionary:

W(x,y) = x went up the ys = the itsy bitsy spidera = the water spout

Symbolization:W(s,a)

Down came the rain, and washed the spider out.Dictionary:

C(x) = x came downA(x,y) = x washed y outr = the rains = the itsy bitsy spider

Symbolization:C(r) & A(r,s)

Out came the sun, and dried up all the rainDictionary:

O(x) = x came outD(x,y) = x dried up yb = the sunr = the rain

Symbolization:O(b) & D(b,r)

And the itsy bitsy spider went up the spout againDictionary:

B(x,y) = x went up the y agains = the itsy bitsy spidera = the water spout

Symbolization:B(s,a)

Page 16: Chapter 8: Syntax and Semantics I

Peter, Peter pumpkin eater,Had a wife but couldn't keep her;Dictionary:

H(x,y) = x had yK(x,y) = x kept yp = Peter, Peter pumpkin eatera = Peter's wife

Symbolization:H(p,a) & K(p,a)

He put her in a pumpkin shellDictionary:

P(x,y,z) = x put y in zp = Peter, Peter pumpkin eatera = Peter's wifes = pumpkin shell

Symbolization:P(p,a,s)

And there he kept her very well. Dictionary:

W(x,y,z) = x kept y in z very wellp = Peter, Peter pumpkin eatera = Peter's wifes = pumpkin shell

Symbolization:W(p,a,s)

Page 17: Chapter 8: Syntax and Semantics I

Pussy cat, pussy cat, where have you been?

I've been to London to visit the Queen.Dictionary:

V(x,y,z) = x went to y to visit the zp = pussy catl = Londonq = the Queen

Symbolization:V(p,l,q)

Pussy cat, pussy cat, what did you do there?

I frightened a little mouse, under her chair.

Dictionary:F(x,y,z) = x frightened y under zp = pussy catm = little mousec = the Queen's chair

Symbolization: V(p,m,c)

Page 19: Chapter 8: Syntax and Semantics I