x - Computer Science Department - Stony Brook University

41 downloads 75 Views 320KB Size Report
Statements with Multiple Quantifiers in Tarski's World. ׊׌.  For all triangles x, there is a square y such that x and y have the same color. TRUE. (c) 2010 ...
The Logic of Quantified Statements Arguments with Quantified Statements CSE 215, Computer Science 1, Fall 2011 Stony Brook University http://www.cs.stonybrook.edu/~cse215

Refresh from last time: Logic of Quantified Statements  Universal quantifier:     

“for all” Existential quantifier: “there there exists exists” Universal statements: x D, Q(x) Existential statements: x D such that Q(x) P(x) Q (x) ≡ x, P(x) → Q(x) P(x) Q(x) ≡ x, x P(x) ↔ Q(x)

 Negations of Quantified Statements:  ‫׊(׽‬x ( ‫ א‬D,, Q(x)) Q( )) ≡ ‫׌‬x ‫ א‬D,,‫׽‬Q( Q(x))  ‫׌(׽‬x ‫ א‬D, Q(x)) ≡ ‫׊‬x ‫ א‬D,‫׽‬Q(x)

2

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Refresh from last time: Logic of Quantified Statements  Negations of Universal Conditional Statements:  ‫׊(׽‬x, ‫׊(׽‬x P(x) → Q(x)) ≡ ‫׌‬x such that P(x) ‫׽ ר‬Q(x)  The Relation among

, , , and

D={ {x1, x2, . . . , xn} and ‫׊‬x ‫ א‬D,, Q( Q(x)) ≡

Q(x1) ‫ ר‬Q (x2) ‫ ר · · · ר‬Q (xn)  D = {x1, x2, . . . , xn} and ‫׌‬x ‫ א‬D such that Q(x) ≡ Q(x1) ‫ ש‬Q(x2) ‫ ש · · · ש‬Q(xn)

3

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Refresh from last time: Logic of Quantified Statements  Universal conditional statement: x      

4

D, if P(x) then Q(x) Contrapositive: x D, D if Q(x) then P(x) Converse: x D, if Q(x) then P(x) Inverse: x D, D if P(x) then Q(x) “ x, r (x) is a sufficient condition for s(x)” means x if r (x) then s(x)” s(x) “ x, “ x, r (x) is a necessary condition for s(x)” means ( ) “ x,, if r ((x)) then s(x)” “ x, r (x) only if s(x)” means ( ) then r ((x)” ) ≡ “ x,, if r(x) ( ) then s(x).” ( ) “ x,, if s(x) (c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Statements with Multiple Quantifiers  Quantifiers are performed in the order in which the

quantifiers occur:  Examples of statements with two quantifiers:  ‫׊‬x in D, ‫׌‬yy in E such that P(x, ( y)

for whatever element x in D you must find an element y in E that “works” for that particular x  ‫׌‬x ‫ ׌‬in i D suchh that h ‫׊‬y ‫ ׊‬iin E E, P(x, P( y)) find one particular x in D that will “work” no matter what y in E y might g choose anyone

5

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Statements with Multiple Quantifiers in Tarski’s World

‫׌׊‬  For all triangles x, there is a square y such that x and y have the same color

TRUE

6

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Statements with Multiple Quantifiers in Tarski’s World

‫׊׌‬  There is a triangle x such that for all circles y, x is to the right of y

TRUE

7

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Negations of Multiply-Quantified Statements  Apply negation to quantified statements from left to right:

( x in D, D y in E such that P(x P(x, y)) ≡ x in D such that ( y in E such that P(x, y)) ≡ x in D such that y in E, E P(x, P(x y) y). ( x in D such that y in E, P(x, y)) D ( y in E E, P(x, P(x y)) ≡ x in D, ≡ x in D, y in E such that P(x, y).

8

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Negating Statements in Tarski’s World

 For all squares x, there is a circle y such that x and y have the same color

Negation: ‫ ׌‬a square x such that ‫ ׌(׽‬a circle y such that x and y have the same color) ≡ ‫ ׌‬a square x such that ‫ ׊‬circles y, x and y do not have the same color TRUE: Square q e is black and no circle is black. 9

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Negating Statements in Tarski’s World

 There is a triangle x such that for all squares y, x is to the right of y

Negation: ‫ ׊‬triangles x,‫׽‬ x ‫ ׊( ׽‬squares y, y x is to the right of y) ≡ ‫ ׊‬triangles x, ‫ ׌‬a square y such that x is not to the right of y TRUE 10

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Quantifier Order in Tarski’s World

 For every square x there is a triangle y such that x and y have different colors

TRUE  There exists a triangle y such that for every square x, x x and y have different colors TRUE 11

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Formalizing Statements in Tarski’s World  Triangle(x) means “x is a triangle”  Circle(x) means “x is a circle”  Square(x) means “x is a square”  Blue(x) means “x is blue”  Gray(x) means “x is gray”  Black(x) means “x is black”  RightOf(x, y) means “x is to the right of y”  Above(x, y) means “x is above y”  SameColorAs(x, y) means “x has the same color as y”  x = y denotes the p predicate “x is equal q to y” y 12

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Formalizing Statements in Tarski’s World  For all circles x, x is above f

x(Circle(x) →Above(x, f ))  Negation:

( x(Circle(x) → Above(x, f ))) ≡ x (Circle(x) → Above(x, f )) ≡ x(Circle(x) l Above(x, b f ))

13

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Formalizing Statements in Tarski’s World  There is a square x such that x is black

x(Square(x)

Black(x))

 Negation:

( x(Square(x) Black(x))) ≡ x (Square(x) Black(x)) ≡ x( Square(x) Black(x)) l k

14

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Formalizing Statements in Tarski’s World  For all circles x, there is a square y

such that x and y have the same color x(Circle(x) → y(Square(y) SameColor(x, y)))  Negation:

( x(Circle(x)→ y(Square(y) SameColor(x, y)))) ≡ x (Circle(x) → y(Square(y) SameColor(x, y))) ≡ x(Circle(x) l ( y(Square(y) SameColor(x, l y)))) y( (Square(y) SameColor(x, y)))) ≡ x(Circle(x) ≡ x(Circle(x) (Ci l ( ) y(( Square(y) S ( ) S C l ( y))) SameColor(x, ))) 15

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Formalizing Statements in Tarski’s World  There is a square x such that for all

triangles y, x is to right of y x(Square(x)

y(Triangle(y) → RightOf(x, y)))

 Negation:

( x(Square(x) y(Triangle(y) → RightOf(x, y)))) y(Triangle(x) → RightOf(x, y))) ≡ x (Square(x) ≡ x( Square(x) ( y(Triangle(y) l → RightOf(x, h f y)))) y( (Triangle(y) → RightOf(x, y)))) ≡ x( Square(x) ≡ x(( Square(x) S ( ) y(Triangle(y) (T i l ( ) Ri h Of( y))) RightOf(x, ))) 16

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Prolog (Programming in logic)

 Prolog statements:

isabove(g, b1). color(g, gray). color(b3, blue). isabove(b1,w1). color(b1, blue). color(w1, white). isabove(w2, b2). color(b2, blue). ( 2, white). ) isabove(b ( 2, b3)). color(w isabove(X, Z) :- isabove(X,Y ), isabove(Y, Z). ( 1, blue). ) ?- isabove(X,w ( , 1)). ?- color(b TRUE X=b1; X=g

17

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Prolog (Programming in logic)

?- isabove(b2,w1). TRUE

?- color(w1, X) . X = white

?- color(X, ( , blue). ) X = b1; X = b2; X = b3.

18

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Arguments with Quantified Statements  Universal instantiation: if some property is true of everything

in a set, then it is true of any particular thing in the set.  Example: All men are mortal. Socrates is a man. Socrates is mortal.

19

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Universal Modus Ponens FormalVersion x if P(x) then Q(x) x, Q(x). P(a) for a particular a. Q(a) Q(a).

InformalVersion If x makes P(x) true, true then x makes Q(x) true. a makes P(x) true. true a makes Q(x) true.

 Example:

x, if E(x) then S(x). E(k),for a particular k. S(k). 20

If an integer is even, then its square is even. k is a particular integer that is even. k2 is even.

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Universal Modus Tollens FormalVersion x if P(x) then Q(x) x, Q(x). Q(a), for a particular a. P(a) P(a).

InformalVersion If x makes P(x) true, true then x makes Q(x) true. a does not make Q(x) true. true a does not make P(x) true.

 Example:

x, if H(x) then M(x) M(Z) ( ) H(Z).

21

All human beings are mortal. Zeus is not mortal. Zeus is not human.

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Validity of Arguments with Quantified Statements  An argument form is valid, if and only if, for any particular

predicates substituted for the predicate symbols in the premises if the resulting premise statements are all true, then the conclusion is also true  Using Diagrams to Test for Validity: integers n, n is a rational number

22

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Using Diagrams to Test for Validity All human h bbeings are mortal. l Zeus is not mortal. Z is Zeus i not a hhuman bbeing. i

23

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Using Diagrams to Show Invalidity All human h bbeings are mortal. l Felix is mortal. F li is Felix i a human h bbeing. i

24

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Using Diagrams to Test for Validity  Universal U l modus d tollens ll E Example: l

No polynomial functions have horizontal asymptotes. Thi function This f ti has h a horizontal h i t l asymptote. t t This function is not a polynomial function

25

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Universal Transitivity FormalVersion InformalVersion x P(x) → Q(x). Q(x) Any x that makes P(x) true makes Q(x) true. true xQ(x) → R(x). Any x that makes Q(x) true makes R(x) true. x P(x) → R(x). R(x) Any x that makes P(x) true makes R(x) true. true  Example from Tarski’s World: x if x is a triangle x, triangle, then x is blue. blue x, if x is blue, then x is to the right of all the squares. x,, if x is a triangle, g , then x is to the right g of all the squares q

26

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Converse Error (Quantified Form) FormalVersion x if P(x) then Q(x) x, Q(x). Q(a) for a particular a. a P(a). invalid conclusion

27

InformalVersion If x makes P(x) true, true then x makes Q(x) true. a makes Q(x) true. true a makes P(x) true.

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)

Inverse Error (Quantified Form) FormalVersion x if P(x) then Q(x) x, Q(x). P(a), ( ), for a particular p a. Q(a). invalid conclusion

28

InformalVersion If x makes P(x) true, true then x makes Q(x) true. a does not make P(x) ( ) true. a does not make Q(x) true.

(c) 2010 Cengage Learning & P.Fodor (CS Stony Brook)