Ivan Bratko

Prolog Programming for Artificial Intelligence, 4th edn.

Pearson Addison Wesley, 2012

 

Here are additional materials for the book

 

(1) Programs from the book, one zip file

 

The files with the programs are organized as follows. Most of the programs directly correspond to figures in the book. For easy identification, a file named figNN.pl contains the program that appears in Figure NN in the book. A comment of the form

 

% Figure NN

 

was inserted at the beginning of each program. For example, the file fig18_8.pl contains the program that appears as Figure 18.8 in the book. "pl" is the usual extension of Prolog program files.

 

File frequent.pl contains definitions of some frequently used predicates such as member/2 and conc/3. These are often used by other programs in the book. So to run a program, it is easiest to first load the file frequent.pl (by consulting or compiling this file). The file frequent.pl includes some predicates that may already be included among the built-in predicates, depending on the implementation of Prolog. For example, negation as failure

written as not Goal is also included below for compatibility with Prologs that only use the notation \+ Goal instead. When loading into Prolog the definition of a predicate that is already built-in, Prolog will typically just issue a warning message and ignore the new definition.

 

(2) Additional exercises, and solutions to selected exercises

        Exercises in Bayesian networks

        Exercises in DCG grammars

        Exercises in Qualitative reasoning