Homework 11, due Monday, 19 May 2008
1. Exercise 4.62, page 453.
2. Exercise 4.64, page 466.
3. Exercise 4.65, page 467.
4. Exercise 4.68, page 468. The book suggests using append-to-form in
your answer. This is an easy solution, but there is another easy solution
that does not use append-to-form. Instead, you write rules for another
auxiliary relation. Either solution will be accepted.
A Word of Caution
If you try to use querysys.scm to test your solutions to the above
exercises, load querysys.scm into DrScheme, run it and then type
(query-r-e-p) to start the query system. Use assert
instead of the book's assert! to assert facts and rules into
the database. Most importantly, assert your facts and rules in the
opposite order from the order in which you want them to be used. In other
words, if you assert fact or rule A and then assert fact or rule B, the
query system will try to use B to answer a query before it tries to use A
to answer the query. I have noticed that querysys.scm may not always
stop running after finding a correct answer, so if you see the correct
result appearing but the query system continues to look for more results,
that is the fault of the query system and not of your facts and rules.