Logic Programming Fall term 2014
The aim of this course is to introduce you to the theory and practice
of logic programming. We teach it in two parts:
- Logic programming - theory: lectures given by
- Logic programming - programming: lectures given by James Cheney
There will be 18 lectures, starting Monday 15th September 2014.
Lectures are in Lecture Theatre 4 of 7 Bristo Square.
Lectures take place 1510-1600 on Mondays and Thursdays in weeks 1-4 and 6-10 of Semester 1. (Note that
there are no lectures in week 5, i.e., no lectures on 13th and 16th October.)
Tutorials are held in weeks 3-10.
(Note that tutorials take place as usual in Week 5.)
There will be two, summatively assessed, coursework exercises; each worth 10% of the final grade.
|| Tut 1
|| Tut 2
|| CW1 handed out: Mon 6
|| Tut 3
|| Prog 6
|| Theory 4
|| Tut 4
|| CW1 deadline: 3pm Mon 20
|| Theory 5
|| Tut 5
|| CW2 handed out: Mon 27
|| 3 Nov
|| Theory 6
|| Prog 7
|| Tut 6
|| 10 Nov
|| Theory 7
|| Prog 8
|| Tut 7
|| CW2 deadline: 3pm Mon 10
|| 17 Nov
|| Theory 8
|| Prog 9
|| Tut 8
The course lecturers are available (during Semester 1) for discussion of course material
at the following hours.
- Richard Mayr (IF 4.11): TBA.
- James Cheney (IF 5.29): TBA.
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.
There is a good emacs mode for editing Prolog code and interacting
with execution. To enable this mode for Prolog, add the following
line to your .emacs file:
(load "/opt/sicstus-4.2.0/lib/sicstus-4.2.0/emacs/sicstus_emacs_init" t)
Then consulting a Prolog file will bring up a menu for Prolog features.
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 this and previous years were recorded on video so if you want a re-run
of those lectures then visit the
for the full lectures; clips of smaller segments; and instructions on
how to view them on the Informatics DICE system.
Programming Lecture Slides
Theory Lecture Slides
- Lecture 1 (Definite Clause Propositional Logic), September 15
- Lecture 2 ((In)completeness for Propositional Prolog), September 29 (PDF)
- Lecture 3 (Definite Clause Predicate Logic), October 6
- Lecture 4 (Proof Search for Definite Clause Predicate Logic), October 23
- Lecture 5 ((In)completeness for Definite Clause Predicate Logic), October 27
- Lecture 6 (Fixed Points and Herbrand Models), November 3
- Lecture 7 (Negation as Failure), November 10
- Lecture 8 (Extensions of Predicate Logic), November 17
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.
Tutorials start Week 3 (September 30).
See tutorial groups
with times and membership.
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.
- Week 5 quiz tutorial and
Supplementary material: 2012 Week 5
tutorial (2012_tutorial3.pdf) and outline solutions
- Tutorial for week 6,
with some associated code: rot13.pl.
- Tutorial for week 7 and
- Tutorial for week 8
- Tutorial for week 9
- Tutorial for week 10
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.
- New this year: The week 5 tutorial will be a quiz tutorial. Solutions will be marked and discussed in tutorial.
- Both lecturers have office hours (see above) in which they are available 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 after submission.