Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Dana Asbury
November 12, 2015
Problem 1.a. B551 is a course at IU.
C(x, y) = x is a course at y
C(B551, IU ) = B551 is a course at IU
Problem 1.b. Mary likes all pastries except donuts.
Likes(x, y) = x likes y
P astry(x) = x is a pastry
Donut(x) = x is a donut
xP astry(x) Donut(x) Likes(M ary, x)
Problem 1.c. If a printer doesnt print its broken, unless its unplugged.
P rinter(x) = x is a printer
P rints(x) = x prints
Broken(x) = x is broken
U nplugged(x) = x is unplugged
xP rinter(x) P rints(x) Broken(x) U nplugged(x)
Problem 1.d. No student likes expensive textbooks.
Student(x) = x is a student
Expensive(x) = x is expensive
Book(x) = x is a book
Likes(x, y) = x likes y
xy(Student(x) Book(y) Expensive(y) Likes(x, y))
Problem 1.e. Teach someone to fish and she/he will have fish forever.
T each(x, y, z) = x teaches y to z
Has(x, y) = x has y forever
F ish(x) = x is fish
xyz(T each(x, y, z) F ish(z) Has(y, z))
Problem 2. From Horses are animals, it follows that The head of a horse is the head
of an animal. Demonstrate that this inference is valid by carrying out the following steps:
Problem a. Translate the premise and the conclusion into the language of first-order logic.
Use three predicates:
Head(h, x) = h is the head of x
Horse(x) = x is a horse
Animal(x) = x is an animal
Premise: x(Horse(x) Animal(x))
Conclusion: xy(Head(x, y) Horse(x) z(Head(x, z) Animal(z)))
Problem b. Negate the conclusion, and convert the premise and the negated conclusion
into conjunctive normal form.
Conclusion: xy((Head(x, y) Horse(x) z(Head(x, z) Animal(z)))) =
= xyz(((Head(x, y) Horse(x)) z(Head(x, z) Animal(z)))) =
= xyz(((Head(x, y) Horse(x)) (Head(x, z) Animal(z)))) =
= Head(X, Y ) Horse(X) (Head(X, z) Animal(z))
Premise: x(Horse(x) Animal(x)) =
= x(Horse(x) Animal(x)) = Horse(x) Animal(x)
Note that X and Y are Skolem constants.
So we have the four premises:
1. Head(X, Y )
2. Horse(X)
3. Head(X, z) Animal(z)
4. Horse(x) Animal(x)
Problem c. Use resolution to show that the conclusion follows from the premise.
Resolving 1. and 3. results in 5. Animal(z)
Resolving 5. and 4. results in 6. Horse(x)
Resolving 6. and 2. results in a contradiction, and thus we have proved our conclusion.
Problem b. To generate a successor to the current state we will try to apply a rule to a
logical expression (possibly another rule) in our state. So if the antecedent of a rule matches
an expression in memory, then we can add the consequent of the rule to our state and that
becomes our new successor state. So to generate all successor states we must try to apply
each rule to every expression in our state, and for each successful application of the rule to
the current set of expressions, we have generated a new state with one additional expression
(namely the consequent of the successful rule application).