Uploaded by Prince Raj

6 2021 11 20!01 49 56 AM

advertisement
Artificial Intelligence Sheet One
Prepared By: Dr Muhanad Tahrir Younis
Q1)Represent the following English sentences using predicate calculus:
a) All purple mushrooms are poisonous.
∀X (mushroom(X) Λ purple(X) ⇒ poisonous(X))
b) No purple mushroom is poisonous.
∀X (mushroom(X) Λ purple(X) ⇒ ¬ poisonous(X))
c) All mushrooms are either purple or poisonous.
∀X (mushroom(X) ⇒( purple(X) ν poisonous(X)))
d) All mushrooms are either purple or poisonous but not both.
∀X (mushroom(X) ⇒( purple(X) Λ ¬ poisonous(X)) ν (¬purple(X) ν poisonous(X)))
e) All purple mushrooms except one are poisonous.
ƎX (purple(X) Λ mushroom(X) Λ ¬ poisonous(X)) Λ
(∀Y(purple(Y) Λ mushroom(Y) Λ ¬equal(X,Y)) ⇒poisonous(Y))
f) There are exactly two purple mushrooms.
ƎX ƎY (purple(X) Λ mushroom(X) Λ purple(Y) Λ mushroom(Y) Λ ¬equal(X,Y)
Λ (∀Z( mushroom(Z) Λ purple(Z) ) ⇒(equal(Z, X) ν equal(Z, Y))
g) Not all students take both history and biology.
¬∀X (student(X) ⇒ [takes(X, history) ^ takes(X, biology)])
h) No person likes a smart vegetarian.
∀X ∀Y (person(X) ^ vegetarian(Y) ^ smart(Y)
⇒ ¬likes(x, y))
i)There is a woman who likes all men who are not vegetarians.
ƎX woman(X) ^ (∀Y man(Y) ^ ¬vegetarian(Y) ⇒ likes(X, Y))
j) The best score in history was better than the best score in biology.
∀X ∀Y (best_score(history, X) ^ best_score(biology, Y) )
2
⇒ better(X ,Y))
Artificial Intelligence Sheet One
Prepared By: Dr Muhanad Tahrir Younis
k) Every person who dislikes all vegetarians is smart.
∀X (person(X) ^ ∀Y [vegetarian(Y)
⇒ ¬likes(X, Y)]) ⇒ smart(X)
l) There is a barber who shaves all men in town who do not shave
themselves.
ƎX barber(X) ^ (∀Y townman(Y) ^ ¬shaves(Y, Y) ) ⇒ shaves(X, Y))
m) No person likes a professor unless the professor is smart.
∀X ∀Y [person(X) ^ professor(Y)]
⇒ [likes(X, Y) ) ⇒ smart(y)]
n) Only one student failed both history and biology.
ƎX student(X) ^ (∀Y student(Y) ⇒ equal(X,Y)) ^ failed(X, history) ^
failed(X, biology)
o) Politicians can fool some of the people all the time, and they can fool all
of the people some of the time, but they cannot fool all of the people all
of the time.
∀X politician(X)
⇒
{[ƎY people(Y) ^ (∀T time(T) ⇒ fool(X, Y, T))] ^
[ƎT time(T) ^ (∀Y people(Y) ⇒ fool(X, Y, T))] ^
¬ [∀Y ∀T people(Y) ^ time(T) ⇒ fool(X, Y, T)]}
Ex: Represent the following English sentences using predicate calculus:
1- For every action, there is an equal and opposite reaction.
X action(X)Y
reaction(Y, X)  equal (magnitude(X), magnitude(Y)) 
opposite (direction(X), direction(Y))
2- Everyone loves someone who loves everyone.
x y z (loves(X, Y)  loves(Z, X))
3- We all live in a yellow submarine
x y( submarine(X)  yellow(X)  among-us (Y)  live_in (Y, X))
3
Artificial Intelligence Sheet One
Prepared By: Dr Muhanad Tahrir Younis
Q2) Represent the following English paragarphes using predicate calculus:
a) "All people that are not poor and are smart are happy. Those people
that read are not stupid. John can read and is wealthy. Happy people
have exciting lives."
We assume ∀X (smart (X)
and get:
≡ ¬ stupid (X)) and ∀Y (wealthy (Y) ≡ ¬ poor (Y)),
∀X (¬ poor (X) Λ smart (X) ⇒ happy (X))
∀Y (read (Y) ⇒ smart (Y))
read (john) Λ ¬ poor (john)
∀Z (happy (Z) ⇒ exciting (Z))
b) "Animals can outrun any animals that they eat. Carnivores eat other
animals. If x can outrun y and y can outrun z, than x can outrun
z. Lions eat zebras. Zebras can outran dogs. Dogs are Carnivores."
∀X ∀Y(eat(X,Y)⇒outrun(X,Y))
∀X∀Y(carnivores(X)⇒eat(X,Y))
∀X∀Y∀Z(outrun(X,Y) Λ outrun(Y, Z)⇒ outrun(X,Z))
eat(lion, zebra)
outrun(zebra, dog)
carnivores(dog)
4
Artificial Intelligence Sheet One
Prepared By: Dr Muhanad Tahrir Younis
Q3) consider the following:
5
Artificial Intelligence Sheet One
Prepared By: Dr Muhanad Tahrir Younis
Q4) Write down the steps for converting an arbitrary predicate logic
sentence into clausal form, and apply them to the following sentence:
X ∀Y p(X, Y)  Z q(X, Z)  ¬r(Y, Z)
6
Download