The Logic of Quantified Statements: CSE 215, Foundations of Computer Science Stony Brook University
The Logic of Quantified Statements: CSE 215, Foundations of Computer Science Stony Brook University
H, x is mortal
Universal statements
A universal statement is a statement of the form
x D, Q(x) is true if, and only if, Q(x) is true for every x in D
x D, Q(x) is false if, and only if, Q(x) is false for at least one x in D
x D, x2 x for D = {1, 2, 3, 4, 5}
12 1,
22 2,
32 3,
42 4,
Hence x D, x2 x is true.
52 5
there exists
Example:
There is a student in CSE 215
x D s.t. Q(x) is true if, and only if, Q(x) is true for at least one x in D
x D s.t. Q(x) is false if, and only if, Q(x) is false for all x in D
Example:
m Z such that m2 = m
12 = 1
True
squares x, x is a rectangle.
10
Implicit Quantification
P(x)
11
13
14
Q(x1)
Q (x2)
D, Q(x)
Q (xn)
Q(x1)
16
Q(x2)
True
17
x
x
Example:
18
19
20
Only If
Only If:
21
22
quantifiers occur:
Example:
x in set D, y in set E such that x and y satisfy property P(x, y)
23
Tarskis World
Blocks of various sizes, shapes, and colors located on a grid
t, Triangle(t) Blue(t)
x, Blue(x) Triangle(x).
y such that Square(y) RightOf(d, y).
z such that Square(z) Gray(z).
24
TRUE
FALSE
TRUE
FALSE
For all triangles x, there is a square y such that x and y have the same color
TRUE
25
TRUE
26
27
28
quantifiers occur:
Examples of statements with two quantifiers:
x in D, y in E such that P(x, y)
29
For all triangles x, there is a square y such that x and y have the same color
TRUE
30
TRUE
31
32
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 e is black and no circle is black.
33
Negation:
triangles x, ( squares y, x is to the right of y)
triangles x, a square y such that x is not to the right of y
TRUE
34
For every square x there is a triangle y such that x and y have different colors
There exists a triangle y such that for every square x, x and y have different
colors
35
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 and y have different
colors
FALSE
36
x(Circle(x) Above(x, f ))
Negation:
38
x(Square(x)
Black(x))
Negation:
( x(Square(x) Black(x)))
x (Square(x) Black(x))
Black(x))
x( Square(x)
39
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)
( y(Triangle(y) RightOf(x, y))))
x( Square(x)
y( (Triangle(y) RightOf(x, y))))
x( Square(x)
y(Triangle(y)
RightOf(x, y)))
x( Square(x)
41
Prolog statements:
42
?- isabove(b2,w1).
TRUE
?- color(w1, X) .
X = white
?- color(X, blue).
X = b1; X = b2; X = b3.
43
44
InformalVersion
If x makes P(x) true, then x makes
Q(x) true.
a makes P(x) true.
a makes Q(x) true.
Example:
InformalVersion
If x makes P(x) true, then x makes
Q(x) true.
a does not make Q(x) true.
a does not make P(x) true.
Example:
46
47
48
49
50
Universal Transitivity
FormalVersion
InformalVersion
x P(x) Q(x).
Any x that makes P(x) true makes Q(x) true.
xQ(x) R(x).
Any x that makes Q(x) true makes R(x) true.
x P(x) R(x).
Any x that makes P(x) true makes R(x) true.
Example from Tarskis World:
x, if x is a triangle, then x is blue.
x, if x is blue, then x is to the right of all the squares.
x, if x is a triangle, then x is to the right of all the squares
51
52
InformalVersion
If x makes P(x) true, then x makes
Q(x) true.
a makes Q(x) true.
a makes P(x) true.
53
InformalVersion
If x makes P(x) true, then x makes
Q(x) true.
a does not make P(x) true.
a does not make Q(x) true.