Logic Programming 201314
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  programming: lectures given by
Alan Smaill
 Logic programming  theory: lectures given by Alex Simpson
There will be 18 lectures, starting Monday 16th September.
Lectures are in Lecture Theatre 3 of 7 Bristo Square.
Lectures take place 15101600 on Mondays and Thursdays in weeks 14 and 610 of Semester 1. (Note that
there are no lectures in week 5, i.e., no lectures on 14th and 17th October.)
Tutorials are held in weeks 310.
(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.
Course timetable
Week

Begins

Mon Lec

Thu Lec

Tutorials

Coursework (CW)

1 
16 Sep 
Prog 1 
Theory 1 


2 
23 Sep 
Prog 2 
Prog 3 


3 
30 Sep 
Theory 2 
Prog 4 
Tut 1 

4 
7 Oct 
Theory 3 
Prog 5 
Tut 2 
CW1 handed out: Mon 7 
5 
14 Oct 


Tut 3 

6 
21 Oct 
Prog 6 
Theory 4 
Tut 4 
CW1 deadline: 3pm Mon 21 
7 
28 Oct 
Theory 5 
STRIKE 
Tut 5 
CW2 handed out: Mon 28 
8 
4 Nov 
Theory 6 
Prog 7 
Tut 6 

9 
11 Nov 
Theory 7 
Prog 8 
Tut 7 
CW2 deadline: 3pm Mon 11 
10 
18 Nov 
Theory 8 
Prog 9 
Tut 8 

Office hours
The course lecturers are available (during Semester 1) for discussion of course material
at the following hours.
 Alan Smaill (IF 2.03): Thursdays 10:3011:30
 Alex Simpson (IF 5.25): Tuesdays 11.3012.30 (Weeks 37,912).
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
online.
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
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/sicstus4.2.0/lib/sicstus4.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 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 this and previous years were recorded on video so if you want a rerun
of those lectures then visit the
video site
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 19
(PDF)
 Lecture 2 ((In)completeness for Propositional Prolog), September 30 (PDF)
 Lecture 3 (Definite Clause Predicate Logic), October 7
(PDF)
 Lecture 4 (Proof Search for Definite Clause Predicate Logic), October 24
(PDF)
 Lecture 5 ((In)completeness for Definite Clause Predicate Logic), October 28
(PDF)
 Lecture 6 (Fixed Points and Herbrand Models), November 4
(PDF)
 Lecture 7 (Negation as Failure), November 11
(PDF)
 Lecture 8 (Extensions of Predicate Logic), November 18
(PDF)
Coursework
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
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:
simpsons.pl.

Tutorial for week 4 and the file
that you should download for it: deck.pl.
 Week 5 quiz tutorial and
solutions
Supplementary material: 2012 Week 5
tutorial (2012_tutorial3.pdf) and outline solutions
(2012_tutorial3_solutions.txt).
 Tutorial for week 6,
with some associated code: rot13.pl.
 Tutorial for week 7 and
solutions.
 Tutorial for week 8
 Tutorial for week 9
and solutions.txt.
 Tutorial for week 10
and solutions.txt.
Feedback
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:
 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.
Previous Exams