Download x - Homepages | The University of Aberdeen

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CS2013
Mathematics for Computing Science
Adam Wyner
University of Aberdeen
Computing Science
Slides adapted from
Michael P. Frank's course based on the text
Discrete Mathematics & Its Applications
(5th Edition)
by Kenneth H. Rosen
Predicate Logic
Continued
Agenda
•
•
•
•
Bound and free variables
Vacuous quantification
Empty domains
Complex expressions
– False antecedents
– Quantifiers with logical connectives
– Nested quantifiers
• Quantifier equivalences
• Defining (or not) other quantifiers
Fall 2013
Frank / van Deemter / Wyner
2
Bound and Free Variables
• What do we say about the quantifiers and variables in the
following expressions (same point with )?
–
–
–
–
B(x)
x B(y,x)
x(B(x)  A(y))
xy (B(y)  A(x))
• A "relationship" between the variable associated with the
quantifier and variable associated with the predicate.
Cannot vary the variable unless it is bound.
Fall 2013
Frank / van Deemter / Wyner
3
Bound and Free Variables
• An expression like P(x) is said to have a free
variable x (i.e., x is not “specified”). "She is
happy" does not have a truth value unless we
know whom "she" denotes.
• When we indicate whom "she" is, we can
determine if it is true with respect to a model.
Fall 2013
Frank / van Deemter / Wyner
4
Bound and Free Variables
• A quantifier (either  or ) operates on an
expression having one or more free variables, and
it binds one or more of those variables to produce
an expression having one or more bound
variables.
• Expression with one free variable: P(x)
• Expression with the x binding the variable x
x P(x)
Fall 2013
Frank / van Deemter / Wyner
5
Example of Binding
• P(x,y) has 2 free variables, x and y.
• x P(x,y) has 1 free variable and one bound
variable.
• An expression with zero free variables is a bonafide (actual) proposition.
P(jill',bill')
Fall 2013
Frank / van Deemter / Wyner
6
Formal Definition of Free Variables
• The free-variable occurrences in an atomic
formula are all the variable occurrences in that
atomic formula.
• The free-variable occurrences in  are the freevariable occurrences in .
• The free-variable occurrences in
( connective ) are the free-variable occurrences
in  plus the free-variable occurrences in 
• The free-variable occurrences in x and x are
the free-variable occurrences in  except for any
occurrences of x.
Fall 2013
Frank / van Deemter / Wyner
7
Examples
• Occurrences of variables that are not free are
bound. Start from atomic formula and work
outwards. Which (if any) variables are free in:
1.
2.
3.
4.
5.
6.
Fall 2013
x P(x)
x P(x)
y Q(x)
x P(b)
x(y R(x,y))
x(y R(x,z))
A. x x P(x)
B. x (P(x))  Q(x)
C. y Q(y)  x Q(x)
Frank / van Deemter / Wyner
8
Examples
1.
2.
3.
4.
5.
6.
Fall 2013
x P(x)
x P(x)
y Q(x)
x P(b)
x(y R(x,y))
x(y R(x,z))
(no free variable)
(no free variables)
(x is a free variable)
(no free variables)
(no free variables)
(z is a free variable)
Frank / van Deemter / Wyner
9
Exercise
Suppose (x:=a), where (x:=a) is the result of
substituting all free occurrences of the variable x
in  by the constant a.
What is ?
1.
2.
3.
4.
5.
Fall 2013
P(x)
R(x,y)
P(b)
x P(x)
yQ(x)
Frank / van Deemter / Wyner
10
Exercise
1.
2.
3.
4.
5.
Fall 2013
P(x)
R(x,y)
P(b)
x P(x)
yQ(x)
P(a)
R(a,y)
P(b)
x P(a)
y Q(a)
Frank / van Deemter / Wyner
11
Vacuous Quantification
• Recall definition: Let  be a formula.
Then x is true in D if every expression (x:=a)
is true in D, and false otherwise.
• xP(b) is true in D if every expression of the form
P(b)(x:=a) is true in D, and false otherwise.
• What is the set of all the expression of the form
P(b)(x:=a)?
Fall 2013
Frank / van Deemter / Wyner
12
xP(b)
• What is the set of all expressions of the form
P(b)(x:=a)?
• That’s the singleton set {P(b)} !
• xP(b) is true in D if P(b) is true, and false
otherwise.
• So, xP(b) means the same as P(b)
Fall 2013
Frank / van Deemter / Wyner
13
Empty Domains
• Let  be a formula. Then the proposition
x is true in D if every expression (x:=a) is true
in D, and false otherwise.
This is read as follows:
• Let  be a formula. Then the proposition
x is false in D if at least one expression (x:=a)
is false in D, and true otherwise.
Fall 2013
Frank / van Deemter / Wyner
14
 could have been defined as
• Let  be a formula. Then the proposition
x is true in D if D is nonempty and every
expression (x:=a) is true in D, and false
otherwise.
– Under this definition, x P(x) would have been false
whenever D is empty. Every teddy_bear is happy is
false in a model where there is nothing. Sadness!
• But that’s not how it's done!
Fall 2013
Frank / van Deemter / Wyner
15
Suppose D is Empty
Suppose D is empty.
x P(x) (e.g., P(x) means “x is occupied.”) is true
(sometimes called “vacuously true”).
For the same reason, x P(x) is also true.
Fall 2013
Frank / van Deemter / Wyner
16
Consequences of the Standard
Position
Two logical equivalences in Predicate Logic:
x P(x)  x P(x)
x P(x)  x P(x)
(“no counterexample against P”)
So, one of the two quantifiers suffices (cf.,
functional completeness of a set of connectives in
propositional logic)
We’ll return to these equivalences later.
Fall 2013
Frank / van Deemter / Wyner
17
False Antecedent
• Suppose M2: where D = {jill, bill, phil, will, mary},
is_happy' denotes {jill, bill, phil}, is_rich' denotes {}.
• x (is_rich'(x)  is_happy'(x))
• Is this formula T or F? Recall your T-tables for .
• It is clear that no constant for x will make is_rich'(x) true
since the denotation of is_rich'(x) is empty. In other
words, yQ(y).
Fall 2013
Frank / van Deemter / Wyner
18
False Antecedent
•
•
•
•
Fall 2013
Then Q(a)  P(a) is true for every a
(since Q(a) is false for every a)
Consequently x (Q(x)  P(x)) is true because
Q(x) is false for every a.
A proposition  with a false antecedent is true!
We sometimes say the formula is vacuously true.
Yet, because the antecedent is always false, you
can never use the formula to conclude that P
holds of something.
Frank / van Deemter / Wyner
19
Vacuous truth
•
•
Fall 2013
Example 1: Think of a tax form: “Have you sent us
details about all your children?” You have no children,
so you’ve complied (without doing anything).
Example 2: Think of our definition of (x:=a) as “the
result of substituting all free occurrences of x in  by a”
No occurrences, so don't do anything (after which it’s
true that all occurrences have been substituted)
Frank / van Deemter / Wyner
20
Quantifiers with Connectives
Let the D be parking spaces at ABDN.
Let P(x) be "x is occupied."
Let Q(x) be "x is free of charge."
What do the following mean/paraphrase?
When are they T/F (construct models)?
1.
2.
3.
4.
Fall 2013
x (Q(x)  P(x))
x (Q(x)  P(x))
x (Q(x) P(x))
x (Q(x)  P(x))
Frank / van Deemter / Wyner
21
Construct English paraphrases
1.
2.
3.
4.
1.
2.
3.
4.
Fall 2013
x (Q(x)  P(x))
x (Q(x)  P(x))
x (Q(x)  P(x))
x (Q(x)  P(x))
Some places are free of charge and occupied
All places are free of charge and occupied
All places that are free of charge are occupied
For some places x, if x is free of charge then x is occupied
Frank / van Deemter / Wyner
22
Construct a Model where 1 and 4 are T,
while 2 and 3 are F
1.
2.
3.
4.
x (Q(x)  P(x)) (true for place a below)
x (Q(x)  P(x)) (false for places b below)
x (Q(x) P(x)) (false for place b below)
x (Q(x)  P(x)) (true for place a below)
M4: a model where D = {a, b}, I(Q) = {a, b}, I(P) = {a}.
Fall 2013
Frank / van Deemter / Wyner
23
Construct a Model where 1 and 3 and 4
are T, but 2 is F
1.
2.
3.
4.
x (Q(x)  P(x))
x (Q(x)  P(x))
x (Q(x) P(x))
x (Q(x)  P(x))
M4: a model where D = {a, b}, I(Q) = {a}, I(P) = {a, b}.
Fall 2013
Frank / van Deemter / Wyner
24
About x (Q(x)  P(x))
x (Q(x)  P(x))
For some x, if x is free of charge then x is occupied
x (Q(x)  P(x)) is true iff, for some place a,
Q(a)  P(a) is true.
Q(a)  P(a) is true iff Q(a) is false or P(a) is true.
Some place is either (not free of charge) or some
place (is occupied).
Fall 2013
Frank / van Deemter / Wyner
25
Further
Remainder of Predicate Logic topics next week.
Then Proof.
Fall 2013
Frank / van Deemter / Wyner
26
Related documents