Prolog Tutorials


Before we start on the tutorials, there are a few things you should know about the environment we'll be using...

Different Programs

One feature of the UNIX system is that instead of having large, monolithic programs that duplicate many features, it is more usual to have a number of smaller programs, each suited to a particular task, that co-operate with each other.

For example, when you used an environment like Borland (or Microsoft) C++ on windows NT, you ran a single program that allowed you to edit, and run your C programs, copy files etc.

In UNIX we will be using separate programs to do these tasks - we will use:

Interpreters vs. Compilers

When you want to write programs using a language, there are two main approaches: Compilers are useful when speed of execution is important, while interpreters are helpful for debugging your code.

Traditionally, low-level languages like C tend to use compilers, which higher-level languages use interpreters. However, modern environments can make compilers look a little like interpreters, and many interpreted systems also come with a compiler.

In this course we'll be using a Prolog interpreter; this means that when you run Prolog you get a prompt that waits for you to type in bits of Prolog code, and then executes them. This means that you don't have to test all your program in one you - you can type in pieces of it, and try them out individually.

Copyright and acknowledgement

The tutorials listed opposite are were prepared by James Power in 1995, and enhanced and modified by Alex Monaghan in 1996, but are released under the GNU Free Documentation License.

If you'd like to copy the tutorials, a zip file of all of them might be useful.

Copyright (c) 1995-2006 James F. Power
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".