Prolog

Prolog files

Introduction to Prolog

Prolog is a well known example of a programming paradigm known as declarative programming.  That is, the language is created using functionality, without specifying how.  Other examples include Haskell and HTML. For more on these programming paradigms, see section 20.1.  I recommend using SWIsh, or downloading the free SWI Prolog interpreter from here.

Your task is to work through a chosen tutorial and then complete the Prolog worksheet found in the links at the bottom of the page.  You have a few weeks to complete this work.

Tutorials

I have given a number of tutorials below but recommend following the SWIsh tutorial linked below.

Alternatively, I have linked to two different Prolog resources: One a text book on Prolog, below (in files section), another a presentation given at the University of Totonto also below in the files section.  There is also an online tutorial here.

Finally, here is a YouTube tutorial on Prolog.

SWIsh Tutorial

There is a free online Prolog interpreter called SWIsh, based on the free SWI downloadable program.  Its functionality is limited, but sufficient to meet the requirements of the specification.  The following screenshots show how to get started.

1. On opening, click to create a new program

2. You will then be presented with two panels.  One to write your Prolog statements and one to query the facts.

3.  An example taken from the tutorial linked below.

SWI have produced a handy Prolog page called LPN (Learn Prolog Now) which can be found here