Chapter 7. Prolog

By now, we have seen procedural, object-oriented, and functional languages, but there is yet another promising approach to programming: "programming in logic" as embodied in the Prolog programming language. As you can imagine, the main area of application for a "logical" programming language is the so-called "artificial intelligence". While the data structures and algorithms of AI can be implemented in any language, we will see that Prolog allows for very natural and elegant solutions for these tasks. One remark you will find when looking for Prolog is that Lisp is the assembly language and Prolog the high level language of AI.

Prolog was invented in 1972 by the Alan Colmeraurer at the University of Marseilles as a theorem prover implementing the ideas of Robert Kowalski (University of Edinburgh). The first efficient Prolog compilers were developed by David Warren (also at the University of Edinburgh). Prolog has been primarily used in research, most notably as part of the Japan's ICOT Fifth Generation Computer Systems Initiative. A successful implementation was Borland's Turbo Prolog in the 1980's. In 1995, Prolog became an ISO standard.

7.1. Software and Installation

For the examples in this chapter, I have used the GNU implementation of prolog (version 1.2.18) by Daniel Diaz. It is a Prolog compiler (based on the Warren Abstract Machine) and implements most of the ISO standard. Calling gprolog takes us the the interactive shell.

GNU Prolog 1.2.18
By Daniel Diaz
Copyright (C) 1999-2003 Daniel Diaz
| ?- 

Another popular open source Prolog compiler is SWI-Prolog by Jan Wielemaker.

Bibliography

[BRATKO01]> .

Ivan Bratko, Pearson Education, 2001, 0-201-40375-7, Prolog Programming for Artificial Intelligence: Third Edition.