Download Predicate Calculus

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
CmSc 175 Discrete Mathematics
Lesson 05: Predicate Logic. Quantifiers
1. Introduction
Consider the statements:
P : John is a student.
Q: John studies biology.
R : Tom is a student.
S: John and Tom are brothers.
We can name the above statements with propositional variables P, Q, R, etc,
and we can claim that P and Q are true, however the expression P Λ Q in no way suggests
that both statements concern John. Similarly, P Λ R does not suggest that the expression
concerns one and the same property.
In order to describe properties and relations, we use predicates.
2. Definitions
In linguistics, predicates are words that describe certain relations and properties, usually
verbs and adjectives.
In logic, a predicate has the form
name_of_predicate(arguments).
The above statements can be rewritten following way:
student(John)
studies(John, biology)
student(Tom)
brothers(Tom, John)
Here "student", "studies", "brothers" are names of relations and properties - names of
predicates.
The statement student(John) has a value TRUE if John is a student, and a value FALSE
if John is not a student.
If we want to express the property of being a student, not referring to a particular
individual, we use variables:
1
student(x)
studies(x,y)
brothers(x,y)
The expression student(x) is no longer a statement, as it has no predetermined truth (the
truth value depends on the value of (x).
It is called predicate expression, or propositional function.
The number of the arguments in a predicate expression determines its arity
When we study predicates we need to represent them without referring to a particular
predicate, e.g. such as student(x). Hence we use capital letters for the name of the
predicate.
Examples:
P(x) - a predicate with one variable x, arity one
Q(x,y) - a predicate with two variables x, y, arity two
The variables in a predicate expression can take values within certain domain.
For example, the value of x in student(x) is a human being,
the value of x in integer(x) is a number.
Definition: Domain of a predicate variable is the set of all values
that can be substituted in the place of the variable.
When we assign values to the predicate variables within their domains
we obtain statements that may be true or false.
Definition: Truth set of a predicate P(x) with a domain D is the set of all elements in D
that make P(x) true when substituted for x.
We write: Truth set: {x D | P(x)}
We read: the set of all x in D, such that P(x) is true.
Examples:
integer(x)
Domain: the set of all numbers.
Truth set: the set of all integers.
odd(x)
Domain: the set of all numbers.
Truth set: the set of all odd integers.
Note that we can also specify explicitly the domain to be the set of all integers,
or even the set of all odd integers. In the latter case the predicate will be always true.
2
student(x)
Domain: the set of all people.
Truth set: the set of all students.
brothers(x,y)
Domain of x: the set of all people.
Domain of y: the set of all people.
Truth set: the set of all pairs of persons that are brothers.
studies(x,y)
Domain of x: the set of all people.
Domain of y: the set of all courses, disciplines.
Truth set: the set of all pairs "person, course" such that the persons studies the
course.
3. Summary

Predicates describe properties and relations.
A predicate P(x) is a sentence that contains a finite number of variables
and becomes a statement when specific values are substituted for the variables.

Predicates may have one or more variables, e.g. student(x), mother(x,y)

The domain of a predicate variable is the set of all values that may be substituted
for that variable.

The truth set of a predicate is the set of all values within the domain of its
variables for which the predicate is true.
3
QUANTIFIERS
IN PREDICATE LOGIC
P(x) represents a property of objects in a given set (the domain of x: D)
Naturally we are interested if there are objects in D for which P(x) is true.
To express the truth value of a predicate with respect to a set of objects , we use
quantifiers. Quantifiers refer to quantities such as some, all, none. They tell us for "how
many" elements a given predicate is true.
Here 'how many" is not a particular number. A quantified statement tells us if the
predicate is true for all the elements in the set, or for some of the elements, or for none of
the elements.
A. Universal quantifier
"for all, "all"
denoted by the symbol: 
Example:
All human beings are mortal:
Here, the property "being mortal" refers to all human beings.
The symbol is used to denote the quantity "all" of objects for which a given predicate is
true. Since it represents quantity, it is called quantifier.
Since the quantity is "all" (the property is true for all objects) it is called universal
quantifier.
We write:  x  S, mortal(x) where S is the set of all human beings.
We read: For all x in S, the property mortal(x) is true.
When we quantify universally a predicate, we get a statement (can be true or false)
A universal statement is a statement of the form
 x  D, P(x)
It is defined to be true if and only if P(x) is true for every x in D.
It is false if and only if there exists at least one element in D, for which P(x) is false.
Including the domain in the expression:  x D(x)  P(x)
For all x, if D(x) is true, i.e. x is in D, then P(x) is also true, i.e. x has the property P
Example:
All babies cry
Even numbers are integers
 x, baby(x)  cry(x)
 x, number(x)  even(x)  integer(x)
4
B. Existential quantifier
Existential quantifier: , "there exists"
(there is, we can find, there is at least one, for some, for at least one)
Consider the statements:
Some people are students at Simpson College.
There are some students at Simpson.
There exists at least one student at Simpson College.
All these statements are equivalent in that they claim the existence of at least one
object for which the predicate simpson_student(x) is true.
The symbol is used to denote the quantity "at least one" of objects for which a given
predicate is true. Since it represents quantity, it is called quantifier.
Since it claims the existence of an object with a given property, it is called existential
quantifier.
Example:
 a person s, such that s is a student in Simpson College.
Or:
 s  S, such that Q(s),
where S is the set of all people,
Q(s) is "being a student in Simpson College."
Existential statement is a statement of the form:
 x  D, such that Q(x).
It is defined to be true if and only if Q(x) is true for at least one element in D.
It is false if and only if Q(x) is false for all elements in D.
Note: sometimes the words "such that" are omitted and we simply write:  x  D, Q(x).
Including the domain in the expression:  x D(x)  Q(x).
There is some x in D with the property Q, i.e. D(x) is true and Q(x) is true.
Example:
Some numbers are positive:  x number(x)  positive(x).
Some people like grapefruits:  x person(x)  likes(x,grapefruits).
5
Common errors:
1.  x D(x) P(x) This would mean that all objects in the universe have both
properties D and P. In most cases this is false. Here is an example:
correct:  x bird(x) flies (x)
All birds fly, i.e. if something is a bird then it flies
Wrong:  x bird(x) flies (x)
everything is birds that fly, which obviously is false.
2.  x D(x)  Q(x). The conditional would be true when D(x) is false , that is why
we have to use conjunction:  x D(x)  Q(x).
Example: Some tests are difficult  x test(x)  difficult(x).
Exercise
1. Consider the following statement: "All basketball players are tall".
This statement uses the following predicates:
basketball_player(x)
tall(x)
In predicate logic the statement can be represented as:
(1) x, basketball_player(x) → tall(x).
Consider now the following sentences and determine which of them are equivalent to (1):
a. Every basketball player is tall:
 x, basketball_player(x) → tall(x)
This is equivalent to (1).
b. Among all the basketball players, some are tall:
 x, basketball_player(x) Λ tall(x).
This sentence is not equivalent to (1). It claims the property "tall" only for some of the basketball
players, so we may assume that there are basketball players that are not tall.
c. Some of all the tall people are basketball players:
d. Anyone who is tall is a basketball player:
e. All people who are basketball players are tall:
f. Anyone who is a basketball player is a tall person.
6
2. Represent each of the following statements as quantified expressions
a. All dinosaurs are extinct
b. Every real number is positive, negative or zero
c.
Some problems have answers
d. Some real numbers are rational
e. Some polynomial functions are not continuous
f.
There is a noncontinuous polynomial function
g. No tests are easy
h. No horses fly
3. Consider the following statement: x, real(x) Λ x = 2
2
Which of the following are equivalent ways of expressing this statement?
a. The square of each real number is 2
b. Some real numbers have square 2
c.
2
if x is a real number, then x = 2
d. There is at least one real number whose square is 2
7
Solutions to exercises
1. Consider the following statement: "All basketball players are tall".
This statement uses the following predicates:
basketball_player(x)
tall(x)
In predicate logic the statement can be represented as:
(1) x, basketball_player(x) → tall(x).
Consider now the following sentences and determine which of them are equivalent to (1):
a. Every basketball player is tall:
 x, basketball_player(x) → tall(x)
This is equivalent to (1).
b. Among all the basketball players, some are tall:
 x, basketball_player(x) Λ tall(x).
This sentence is not equivalent to (1). It claims the property "tall" only for some of the basketball
players, so we may assume that there are basketball players that are not tall.
c. Some of all the tall people are basketball players:
 x, tall(x) Λ basketball_player(x).
This sentence is not equivalent to (1). It claims the property " basketball_player " only for some
of the tall people, so we may assume that there are tall people that are not basketball players.
d. Anyone who is tall is a basketball player:
 x, tall(x) → basketball_player(x)
This sentence is not equivalent to (1). The logical form is the converse of (1)
e. All people who are basketball players are tall:
 x, basketball_player(x) → tall(x)
This is equivalent to (1).
f. Anyone who is a basketball player is a tall person.
 x, basketball_player(x) → tall(x)
This is equivalent to (1).
8
2. Represent each of the following statements as quantified expressions
a. All dinosaurs are extinct
 x, dinosaur (x) → extinct (x)
b. Every real number is positive, negative or zero
 x, real_number (x) → positive (x) V negative (x) V zero(x)
Or:
 x, real_number (x) → x > 0 V x < 0 V x = 0
c.
Some problems have answers
 x, problem(x) Λ has_answer(x)
d. Some real numbers are rational
 x, real_number(x) Λ rational(x)
e. Some polynomial functions are not continuous
 x, polynomial_function(x) Λ ~continuous (x)
f.
There is a noncontinuous polynomial function
 x, polynomial_function(x) Λ ~continuous (x)
g. No tests are easy :
 x, test (x) → ~easy (x)
h. No horses fly:
 x, horse (x) → ~fly (x)
3. Consider the following statement: x, real(x) Λ x = 2
2
Which of the following are equivalent ways of expressing this statement?
a. The square of each real number is 2
 x, real_number (x) → x = 2
2
Not equivalent
b. Some real numbers have square 2
x, real(x) Λ x = 2
2
c.
Equivalent
2
if x is a real number, then x = 2
 x, real_number (x) → x = 2
2
Not equivalent
d. There is at least one real number whose square is 2
x, real(x) Λ x = 2
2
Equivalent
9