Logic Programming: Semester 1, 2015-16
Coursework 2 available
; due 23rd November, 3:00
The aim of this course is to introduce you to the theory and practice
of logic programming.
The course has two components:
- Logic programming - theory
- Logic programming - programming
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
(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.
The course lecturer is available (during Semester 1) for discussion of course material
at the following hours:
- Alan Smaill (IF 2:10a): Thursday 11:30-12:30.
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
- Programming in Prolog by Clocksin and Mellish, Springer.
(There are many copies of this in the University library.)
- The Art of Prolog by Sterling
and Shapiro, MIT Press
- Prolog Programming for Artificial Intelligence
by Ivan Bratko, Addison Wesley.
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 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
These refer to the Prolog programs:
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
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
- Lecture 1 (Definite Clause Propositional Logic), October 26;
- Lecture 2 (Definite Clause propositional logic and search), October 29;
- Lecture 3 (Definite Clause Predicate Logic), November 2;
- Lecture 4 (Unification, least fix point), November 5;
- Lecture 5 (In)completenss and Herbrand models, November 9th;
- Lecture 6 (Mini interpreter, meta predicates, closed world assumption,
- Lecture 7 CWA, Clark completion, November 16
- Lecture 8 Higher-order logic programming, November 19
Higher-order Logic Programming
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.
Tutorial for week 3
and the file that you should download for it:
Tutorial for week 4 and the file
that you should download for it: deck.pl,
- Tutorial for week 5 and
some code to download: rot13.pl,
and db.pl, and
- Tutorial for week 6
- Tutorial for week 7, and
- Tutorial for week 8, and
- Tutorial for week 9, and
- Tutorial for week 10, and
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:
- Interaction with tutors in tutorials provides general feedback on understanding.
- One tutorial will be a quiz tutorial:
solutions will be marked and discussed in tutorial.
- The lecturer is available in office hours (see above) to discuss
any aspect of the course. You are very welcome to drop in either
individually or in small groups (up to 3 students at a time).
In addition, both summatively assessed coursework exercises will be
marked, commented and made available for students to collect 2 weeks