Important notes:
• Scope of the quantifier:
– the variable X may refer to different objects in the same argument
as follows:
∀ X planet (X) ^ distant (X) ∃X moon(X)
XOne object
• Bound and free variables: Xanother object
∀X . p(X,Y)
free variable
bound variable
• Types of values:
– When a variable is quantified, we should associate it with a type
or domain as follows:
∀Y:person (Y)
• Free variables are not allowed in quantified
expressions.
9
• Examples:
– Ali is a teacher and a good man
goodman (ali) ^ isa (ali, teacher)
– Nobody likes taxes:
∃X [ likes (X , taxes) ]
– Every dog is an animal:
∀ X ( dog (x) animal (X))
– Every student has a pen:
∀ X (student(x) ∃Y (pen (Y) ^ owns (X,Y))) or
∀ X (∃Y(student(x) (pen (Y) ^ owns (X,Y)))
10
5
A common mistake to avoid
• Typically, is the main connective with
• Common mistake: using as the main
connective with :
∀ x At(x,AlAzhar_Univ) Smart(x)
means “Everyone is at AlAzhar_Univ and everyone is
smart”
• ∀ x At(x, AlAzhar_Univ) Smart(x)
11
Another common mistake to avoid
• Typically, is the main connective with ∃
• Common mistake: using as the main connective
with ∃:
•
∃x At(x, AlAzhar_Univ) Smart(x)
is true if there is anyone who is not at
AlAzhar_Univ!
• ∃x At(x, AlAzhar_Univ) Smart(x)
12
6
Examples for expressing English sentences into
predicate formulae
• Everybody is an adult or a child
∀ X ( adult(X) v child (X))
• Everybody is tall but there are children
(∀X tall(X)) ^ (∃X child (X))
• Although all adults are tall, they are not clever.
∀ X (( adult(X)tall(X)) ^ (adult (X)~clever (X)))
• All first-year students are clever.
∀ X (student (X) ^first_year (X) clever(X) )
• No one can be clever without being hardworking
∃
~ X (clever (X) ) ^ ~hardworking (X))
• Not being lazy is equivalent to being hardworking.
∀ X (~lazy(X)hardworking (X)) 13
Examples for expressing predicate formulae in
English
• ∀X (child(X)^ clever(X)∃Y loves(Y,X) ):
– Clever children are loved.
• ∀X (child(X)^ clever(X)∃Y (adult (Y) ^loves(Y,X))):
– Clever children are loved by adults.
• ∀X (clever(X)∃Y cleverer(X,Y) ):
– One can not be clever without being cleverer than someone.
• Tall(samir) ^ ~∃Y loves(Y,samir) ^ ∀X (respects( X,
samir)) :
– Samir is tall and nobody loves him although everybody
respects him.
• ~ ∃X ( person (X) ^ (X ~=samir) ^
speaks_slowly(X):
– Nobody, except Samir, speaks slowly.
14
7
Some predicate calculus equivalences
Assume p and q are predicates and X,Y are variables:
1. ∃X p(X)
∃Y p(Y)
2. ∀X p(X)
∀Y p(Y)
3. ¬ ∃X p(X) ∀X ¬
p(X)
¬ ∀X (p(X)
4. 5.∀X p(X) ^ q(X)) ∃X ¬∀X p(X) ^
∀Y qY
() p(X)
6.∃X ( p(X) v q(X) ) ∃X p(X) v
∃Y q
Y
()
15
Inference rules
Predicate calculus
equivalence:
• Modus Ponens: Given:
Given :PQ and P are true
∀X p(X) q(X) and
Conclusion: Q is true
Example: p(a)
PQ: “If I am in Cairo then I’m in Egypt” Conclusion: q(a)
P=“I am in Cairo“
Q=“I’m in Egypt” added to PQ and P Using substitution X=a
Predicate calculus
• Modus Tolens: equivalence:
Given :PQ and Q is false
Given:
Conclusion: P is false
Example: ∀X p(X) q(X) and
PQ: “If I am in Cairo then ¬ q(a)
I’m in Egypt”
¬ Q=“I’m not in Egypt” Conclusion: ¬
¬ P=“I am not in Cairo“ p(a)
added to PQ and ¬ Q Using substitution
X=a
16
8
Class Exercieses 2
• Construct truth tables for the compound proposition:
– p v (q ^ r) (p ^q) v r
• Test Validity of the following rule
– (p v q) ^ ~pq
• Express the following in predicate logic
– Although the tree is tall, it has no leaves.
– If x is the father of y or mother of y then x is a parent of y
– If y and x have same parent then they are sibling
– If x and y are parents of z then they are married.
– Every Muslim does prayer.
– Nobody likes taxes
– All students like AI
• Evaluate the truth of the following assuming the data given in slide 17
– X:male(X)^(~ greedy(X) v ~kind (X))
– ( X:~male(X) ^ kind (X))(X:male(X)~kind (X))
17