CS322 Fall 1997
Assignment 2

Due: 1:30pm, Friday 19 September 1997.

Question 1

[10 marks] Consider the following knowledge base:
r(a).
r(e).
p(c).
q(b).
s(a,b).
s(d,b).
s(e,d).
p(X) <- q(X) & r(X).
q(X) <- s(X,Y) & q(Y).
Show the set of ground atomic formulae derivable from this KB. Assume that a bottom-up proof procedure is used and that at each iteration the first applicable clause is selected in the order shown. Furthermore, applicable constant substitutions are chosen in "alphabetic order" if more than one applies to a given clause; for example, if X/a and X/b are both applicable for a clause at some iteration, derive q(a) first. In what order are consequences derived?

Question 2

[10 marks] Using CILog syntax, write axioms to show how an overhead projector can be added to the electrical domain. The overhead projector needs to be plugged in to a live power outlet, the projector needs to be turned on, and the projector needs to be OK for it to be lit. The mirror needs to be in place and the projector focused in order to see a transparency that is on the projector. Your axiomatization should allow for multiple overhead projectors.

You need to:

We need the source program that included the intended interpretation of all symbols, and evidence that it runs.

CILog code for the electrical environment is available from the web (under assignments) and from

~cs322/cilog/elect.cil