Logic Programming: Semester 1, 2015-16


Programming exam A pdf version of the sicstus manual will be available during the exam;

also a short description of some built-in predicates.;

The course

The aim of this course is to introduce you to the theory and practice of logic programming.

The course has two components:

Lectures are given by Alan Smaill (A.Smaill@ed.ac.uk, Informatics Forum 2:10a). There will be 18 lectures, starting Monday 21st September 2015.

Lectures are in Seminar Room 1, Chrystal Macmillan Building (north-east corner of George Square).

Lectures take place 1510-1600 on Mondays and Thursdays in weeks 1-2 and 4-10 of Semester 1. (Note that there are no lectures in week 3, i.e., no lectures on 5th and 8th October.)


Tutorials are weekly starting in week 3.

Tutorial group membership and times


There will be two, summatively assessed, coursework exercises; each worth 10% of the final grade.

Office hours

The course lecturer is available (during Semester 1) for discussion of course material at the following hours:

Meetings outside these hours are also possible by appointment.

Course Text and Supplementary Material

The primary book for the programming side of the course is Learn Prolog Now, by Blackburn, Bos and Striegnitz. The book is strongly recommended, and is available free on-line.

Other useful books on prolog programming are

For the theory lectures, the following background material on propositional and predicate will be useful for students who have not previously encountered propositional and predicate logic.

SICStus Prolog

SICStus Prolog is recommended for use in the course and will be used for the final exam. Any DICE machine (i.e. any Linux machine in an Informatics computer lab) should have SICStus installed; type sicstus at a command prompt to start.

The School also has a site license for student use, in case you would prefer to install and run SICStus on your own computer. Contact Computing Support in person or via this form to arrange this. Please specify which operating system you are running when requesting Sicstus (so Computing Support can send you the login details and appropriate OS license info in one response).

Introductory Prolog Programming Notes

To get you quickly informed of the essential aspects of the Prolog programming language, read the Quick Prolog notes. These refer to the Prolog programs: ancestors.pl, dcg.pl, declar_v_proc.pl and mapcolour.pl.

Prolog Programming Lecture Videos

Some lectures from previous years were recorded on video, so if you want to see alternative presentations of the material then visit the video site for the full lectures; clips of smaller segments; and instructions on how to view these on the Informatics DICE system.

Programming Lecture Slides

Theory Lecture Slides

Higher-order Logic Programming

Examples, implementations, documentation on varieties of lambdaProlog, including examples from the course.


There will be two, summatively assessed, coursework exercises; each worth 10% of the final grade. Once marked, the coursework will be returned to students with feedback.


  1. Tutorial for week 3 and the file that you should download for it: simpsons.pl, and solution.
  2. Tutorial for week 4 and the file that you should download for it: deck.pl, and solution.
  3. Tutorial for week 5 and some code to download: rot13.pl, and db.pl, and solution.
  4. Tutorial for week 6 and solution.
  5. Tutorial for week 7, and solution.
  6. Tutorial for week 8, and solution.
  7. Tutorial for week 9, and solution.
  8. Tutorial for week 10, and solution.


Formative feedback provides students with feedback on performance and understanding in time to assist with the assessed aspects of the course (coursework and exam).

Logic programming offers the following formative feedback:

In addition, both summatively assessed coursework exercises will be marked, commented and made available for students to collect 2 weeks after submission.

Previous Exams

Home : Teaching : Courses 

Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: school-office@inf.ed.ac.uk
Please contact our webadmin with any comments or corrections. Logging and Cookies
Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh