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.

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.

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.

- Wikipedia page on
*Propositional calculus* - Wikipedia page on
*First-order logic* - Wikipedia page on
*Structure (mathematical logic)* - Introductory slides (pdf) on
*Predicate logic and quantifiers*from University of Nebraska

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).
**

- Lecture 1 (Getting started), September 21:
slides (PDF);
Reading: LPN chapter 1.
(Accompanying code: simpsons.pl)

- Lecture 2 (Terms, unification and proof search), September 24: slides (PDF); Reading: LPN chapter 2.
- Lecture 3 (Recursion, lists and data structures), September 28: slides PDF; Reading: LPN chapter 3 and chapter 4.
- Lecture 4 (Nonlogical features), October 1: slides (PDF); Reading: LPN chapter 5 and chapter 10.
- Lecture 5 (Nonlogical features, continued), October 12 slides (PDF); Reading: LPN chapter 10 and chapter 11.
- Lecture 6 (Parsing and definite clause grammars), October 15: slides (PDF) ; Reading: LPN chapter 7 and 8.
- Lecture 7 (Search strategies), October 19: slides (PDF) ; Reading: Bratko chapters 8, 11, 12, 13.
- Lecture 8 (Term manipulation, meta-programming), October 22: slides (PDF); meta-interpreter code; Reading: LPN chapter 9, Bratko chapter 23.

- 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))

- Coursework 1 (programming)
programming coursework
**Due: 3pm October 26.**

- Coursework 2 (theory)
Courework 2 (theory) was made available November 9: theory coursework

**Due: 3pm November 23.**

- 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
- Tutorial for week 10

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).

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 |