CS 540-1: Introduction To Artificial Intelligence: Exam 2: 7:15-9:15pm, April 13, 1998
CS 540-1: Introduction To Artificial Intelligence: Exam 2: 7:15-9:15pm, April 13, 1998
Write your answers on these pages and show your work. If you feel that a question is not fully
specified, state any assumptions you need to make in order to solve the problem. You may use
the backs of these sheets for scratch work.
Write your name on this and all other pages of this exam. Make sure your exam contains seven
problems on eight pages.
Name ________________________________________________
Student ID ________________________________________________
1 _____ 25
2 _____ 10
3 _____ 15
4 _____ 10
5 _____ 15
6 _____ 15
7 _____ 10
(over)
CS 540-1 2 Name ____________________
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Currently, apples cost more per pound than any other fruit.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
(over)
CS 540-1 3 Name ____________________
findClosestObject
{
closestObject(?object1, ?direction1, ?distance1)
sensor(?object2, ?direction2, ?distance2)
lessThan(?distance2, ?distance1)
⇒
retract(closestObject(?object1, ?direction1, ?distance1))
assert( closestObject(?object2, ?direction2, ?distance2))
}
The conflict resolution strategy is to execute the matching rule that has the most preconditions.
Also assume that a rule will never be executed more than once with the same variable bindings.
Negation-by-failure is used, and lessThan is a procedurally defined predicate.
List below, in order, the changes to working memory that this production system will make.
(When there are multiple ways to match sensor(), break ties by choosing the lowest
numbered direction.)
(over)
CS 540-1 4 Name ____________________
?- r(2, 2).
h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
?- r(V, W).
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Show below the search tree that Prolog explores when given the r(2, 2) query. Number the
nodes to indicate the order they were visited.
(over)
CS 540-1 5 Name ____________________
There are three kinds of computers: mainframe, mini, and personal (PCs).
All computers run Unix.
Windows95 only runs on personal computers.
The price of mainframes is high, of minicomputers is moderate, and of PCs is low.
The XYZ brand of personal computers has a very low price, but does not run Windows95.
(over)
CS 540-1 6 Name ____________________
If a logical reasoning system never produces anything that does not logically following from
its axioms ("givens"), then we say that system is _______________.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
(over)
CS 540-1 7 Name ____________________
WFF Justification
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
(B) Circle one (1) frame axiom in the above (just circle its identifying number).
(over)
CS 540-1 8 Name ____________________
(over)