First Order Logic
First Order Logic
First Order Logic
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Oefening 7.2<br />
Artificiële Intelligentie 1<br />
<strong>First</strong> <strong>Order</strong> <strong>Logic</strong><br />
5 november 2002<br />
Represent the following sentences in first-order logic, using a consistent vocabulary<br />
(which you must define):<br />
a. Not all students take both History and Biology.<br />
b. Only one student failed History.<br />
c. Only one student failed both History and Biology.<br />
d. The best score in History was better than the best score in Biology.<br />
e. Every person who dislikes all vegetarians is smart.<br />
f. No person likes a smart vegetarian.<br />
g. There is a woman who likes all men who are not vegetarians.<br />
h. There is a barber who shaves all men in town who do not shave themselves.<br />
i. No person likes a professor unless the professor is smart.<br />
j. Politicians can fool some of the people all of the time, and they can fool all<br />
of the people some of the time, but they can’t fool all of the people all of the time.<br />
Oplossing<br />
a. ∃x(Student(x) ∧ ¬(T ake(x, Biology) ∧ T ake(x, History)))<br />
b. ∃x(Student(x) ∧ F ailed(x, History) ∧ ∀y(F ailed(y, History) ⇒ x = y))<br />
c. ∃x(Student(x)∧F ailed(x, History)∧F ailed(x, Biology)∧(∀y((F ailed(y, History)∧<br />
F ailed(y, Biology)) ⇒ x = y)))<br />
d. ∃x(HistoryScore(x) ∧ ¬∃y(BiologyScore(y) ∧ Higher(y, x))<br />
e. ∀x(P erson(x) ∧ ∀y(V egetarian(y) ⇒ Dislikes(x, y)) ⇒ Smart(x))<br />
f. ¬∃x(P erson(x) ∧ ∃y(V egetarian(y) ∧ smart(y) ∧ Likes(x, y))<br />
g. ∃x(W oman(x) ∧ ∀y((Man(y) ∧ ¬V egetarian(y)) ⇒ Likes(x, y)))<br />
h. ∃xBarber(x) ∧ ∀y((Man(y) ∧ ¬Shaves(y, y)) ⇒ Shaves(x, y)))<br />
i. ∀y(P rofessor(y) ∧ ¬Smart(y)) ⇒ ¬∃x(Likes(x, y))<br />
j. ∀xP oliticain(x) ⇒ ((∃y∀t(T ime(t) ∧ (P eople(y)) ⇒ F ools(x, y, t))<br />
∨ (∃t∀y(T ime(t) ∧ P eople(y)) ⇒ F ools(x, y, t))<br />
∧ ¬∀x∀t(T ime(t) ∧ people(y) ⇒ F ools(x, y, t)))<br />
Oefening 7.5<br />
Represent the sentence “All Germans speak the same languages“ in predicate<br />
calculus. Use Speaks(x, l), meaning that person x speaks language l.<br />
1
Oplossing<br />
∀x, y, lGerman(x) ∧ German(y) ⇒ (Speaks(x, l) ⇔ Speaks(y, l))<br />
Oefening 7.6<br />
Write axioms describing the predicates GrandChild, GreatGrandparent, Brother,<br />
Sister, Daughter, Son, Aunt, Uncle, BrotherInLaw and SisterInLaw.<br />
Oplossing<br />
a. GrandChild(x, y) ≡ ∃z(Child(x, z) ∧ Child(z, y))<br />
b. GreatGrandP arent(x, y) ≡ ∃a, b(Child(y, a) ∧ Child(b, a) ∧ Child(b, x))<br />
c. Brother(x, y) ≡ ∃z(Child(x, z) ∧ Child(y, z) ∧ Male(x))<br />
d. Sister(x, y) ≡ ∃z(Child(x, z) ∧ Child(y, z) ∧ female(x))<br />
e. Daughter(x, y) ≡ F emale(x) ∧ Child(x, y)<br />
f. Son(x, y) ≡ F emale(x) ∧ Child(x, y)<br />
g. Aunt(x, y) ≡ ∃z(Sister(x, z) ∧ Child(y, z))<br />
h. Uncle(x, y) ≡ ∃z(Brother(x, z) ∧ Child(y, z))<br />
i. BrotherInLaw(x, y) ≡ ∃z(Brother(x, z) ∧ (Spouse(z, y) ∨ Spouse(y, z)))<br />
j. SisterInLaw(x, y) ≡ ∃z(Sister(x, z) ∧ (Spouse(z, y) ∨ Spouse(y, z)))<br />
Oefening 7.9<br />
This exercise can be done without the computer, although you may find it useful<br />
to use a backward chainer to check your proof for the last part. The idea is to<br />
formalize the blocks world domain using the situation calculus. The objects in<br />
this domain are blocks, tables, and situations. The predicates are<br />
On(x, y, s) ClearTop(x, s) Block(x) Table(x)<br />
The only action is PutOn(x, y), where x must be a block whose top is clear<br />
of any other blocks, and y can be either the table or a different block with a<br />
clear top. The initial situation S0 has A on B on C on the table.<br />
a. Write an axiom or axioms describing PutOn.<br />
b. Describe the initial state, S0, in which there is a stack of three blocks, A on<br />
B on C, where C is on the table, T.<br />
c. Give the appropriate query that a theorem prover can solve to generate a<br />
plan to build a stack where C is on top of B and B is on top of A. Write down<br />
the solution that the theorem prover should return. (Hint: The solution will be<br />
a situation described as the result of doing some actions to S0.)<br />
d. Show formally that the solution fact follows from your description of the<br />
situation and the axioms for PutOn.<br />
2