next up previous contents
Next: Exercise Chapter 3.2 Up: Solutions and Comments Previous: Solutions and CommentsChapter 2

Exercise Chapter 3.1

In this set of exercises, the solutions are slightly abbreviated. Even so, it is likely that your solution is a subset of the solutions proposed here. The most difficult issue is what happens on failure.


  1. The goal is solved in a very straightforward way. There is no backtracking.


  2. Here, we have a simple case where a failure forces the use of the second half of the definition for b/2.


  3. This is much harder because in trying to solve b(3,Y),c(Y) we have the first subgoal succeed then the second fail twice over before running out of options. We then backtrack to try the remaining option for solving the top level goal which is the subgoal c(3) but this also fails.


  4. A little simpler because no subgoal succeeds at all.



Paul Brna
Mon May 24 20:14:48 BST 1999