Logic Programming: Semester 1, 2015-16
Announcements
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:
- 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
Semester 1.
(Note that there are no lectures in week 3, i.e., no
lectures on 5th and 8th October.)
Tutorials
Tutorials are weekly starting in week 3.
Tutorial group membership and times
Coursework
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:
- 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
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
- Lecture 1 (Definite Clause Propositional Logic), October 26;
(slides (PDF))
- Lecture 2 (Definite Clause propositional logic and search), October 29;
(PDF)
- Lecture 3 (Definite Clause Predicate Logic), November 2;
(slides (PDF))
- Lecture 4 (Unification, least fix point), November 5;
(slides (PDF))
- Lecture 5 (In)completenss and Herbrand models, November 9th;
(slides (PDF))
- Lecture 6 (Mini interpreter, meta predicates, closed world assumption,
November 12th;
(slides (PDF))
- Lecture 7 CWA, Clark completion, November 16
(slides (PDF))
- Lecture 8 Higher-order logic programming, November 19
(slides (PDF))
Higher-order Logic Programming
Examples, implementations,
documentation on varieties of lambdaProlog, including examples
from the course.
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
-
Tutorial for week 3
and the file that you should download for it:
simpsons.pl,
and solution.
-
Tutorial for week 4 and the file
that you should download for it: deck.pl,
and solution.
- Tutorial for week 5 and
some code to download: rot13.pl,
and db.pl, and
solution.
- Tutorial for week 6
and solution.
- Tutorial for week 7, and
solution.
- Tutorial for week 8, and
solution.
- Tutorial for week 9, and
solution.
- Tutorial for week 10, and
solution.
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.
- 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
after submission.
Previous Exams