All code examples in Prolog and C/C++ are provided for personal and educational use only. You may modify or distribute the code in source or compiled form for similar purposes so long as the original source is clearly identified.
These code examples were written for the First Edition of the AI Book, and have been modified minimally since then to cope with changes to run with Tau-Prolog, so that you can try them out within the browser.
If you wish to use any of the code examples, in part or whole, for commercial purposes please contact Alan Dix.
Most are written principally with ease of comprehension in mind and are not necessarily the most efficient coding of the algorithm. In particular, Prolog code, especially the early examples, try to avoid ‘clever’ Prolog tricks. However, the nature of the examples, means that sequential code achieved using cuts and mutable store achieved using assert/retract is often necessary.
Code examples are being added incrementally. If you have any problems with the existing code, or if critical examples are too slow appearing, please contact Alan Dix who will try to correct/add to the code as appropriate in a reasonable time!
Some of the prolog examples use predicates defined in utility files.