slides adapted from
DESCRIPTION
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 (5 th Edition) by Kenneth H. Rosen. Predicate Logic Continued. Agenda. - PowerPoint PPT PresentationTRANSCRIPT
Slides adapted fromMichael P. Frank's course based on the textDiscrete Mathematics & Its Applications
(5th Edition)by Kenneth H. Rosen
CS2013Mathematics for Computing Science
Adam WynerUniversity of Aberdeen
Computing Science
Predicate LogicContinued
Fall 2013 Frank / van Deemter / Wyner 3
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 4
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))– xy (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 5
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 6
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 7
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 bona-
fide (actual) proposition.P(jill',bill')
Fall 2013 Frank / van Deemter / Wyner 8
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 free-variable 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 9
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. x P(x)2. x P(x)3. y Q(x)4. x P(b)5. x(y R(x,y))6. x(y R(x,z))
.A x x P(x)
.B x (P(x)) Q(x)
.C y Q(y) x Q(x)
Fall 2013 Frank / van Deemter / Wyner 10
Examples
1. x P(x) (no free variable)2. x P(x) (no free variables)3. y Q(x) (x is a free variable)4. x P(b) (no free variables)5. x(y R(x,y)) (no free variables)6. x(y R(x,z)) (z is a free variable)
Fall 2013 Frank / van Deemter / Wyner 11
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. P(x)
2. R(x,y)
3. P(b)
4. x P(x)
5. yQ(x)
Fall 2013 Frank / van Deemter / Wyner 12
Exercise
1. P(x) P(a)
2. R(x,y) R(a,y)
3. P(b) P(b)
4. x P(x) x P(a)
5. yQ(x) y Q(a)
Fall 2013 Frank / van Deemter / Wyner 13
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 14
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 15
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 16
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 17
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 18
Consequences of the Standard Position
Two logical equivalences in Predicate Logic:
x P(x) x P(x) (“no counterexample against P”)
x P(x) x P(x)
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 19
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 20
False Antecedent
• 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.
Fall 2013 Frank / van Deemter / Wyner 21
Vacuous truth
• 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)
Fall 2013 Frank / van Deemter / Wyner 22
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. x (Q(x) P(x))2. x (Q(x) P(x)) 3. x (Q(x) P(x))4. x (Q(x) P(x))
Fall 2013 Frank / van Deemter / Wyner 23
Construct English paraphrases
1. x (Q(x) P(x))2. x (Q(x) P(x))3. x (Q(x) P(x))4. x (Q(x) P(x))
1. Some places are free of charge and occupied2. All places are free of charge and occupied 3. All places that are free of charge are occupied4. For some places x, if x is free of charge then x is occupied
Fall 2013 Frank / van Deemter / Wyner 24
Construct a Model where 1 and 4 are T, while 2 and 3 are F
1. x (Q(x) P(x)) (true for place a below)2. x (Q(x) P(x)) (false for places b below)3. x (Q(x) P(x)) (false for place b below)4. 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 25
Construct a Model where 1 and 3 and 4 are T, but 2 is F
1. x (Q(x) P(x)) 2. x (Q(x) P(x)) 3. x (Q(x) P(x)) 4. 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 26
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 27
Further
Remainder of Predicate Logic topics next week.Then Proof.