Exercises from the book Adventures in Prolog