LearnProlog chapter 5