Because the best way to learn a language is to immerse yourself in it, this supplement is larger than the others, and shows Prolog at work in a number of different situations. The final section introduces a trading game, in which the aim is to program an automatic trader to buy and sell so as to make the greatest possible profit. This is open-ended; the game itself can be extended in many ways, while building truly adaptable traders involves a number of principles from A.I.
As you work through this, please bear in mind the logical meaning of each Prolog clause you encounter. If you have any difficulty understanding it, try applying the translation rules given in Lesson 4.