Logic Programming
(V3 + Ü2, SS 2013)


The first lecture took place on Friday, April 12.
If you have any question, please write to lp13@i2.informatik.rwthaachen.de!
News
 The result of the second exam are now available. In the following two documents (V3B, V3M) you can see the points associated to your Public ID. The Public ID is shown on the first page of the exercise system (after logging in). To find out your degree, please consider the following table.
Grade  Points 
1.0  5760 
1.3  5456.5 
1.7  5153.5 
2.0  4850.5 
2.3  4547.5 
2.7  4244.5 
3.0  3941.5 
3.3  3638.5 
3.7  3335.5 
4.0  3032.5 
5.0  029.5 
 Second exam: On September 16th at 2pm (14:00) the second exam will take place in room Aula 2. The lecture takes 120 minutes.
The exam inspection will take place in room AH 1 on September 25th, 10am to 11am.
 The result of the first exam are now available. In the following two documents (V3B, V3M) you can see the points associated to your Public ID. The Public ID is shown on the first page of the exercise system (after logging in). To find out your degree, please consider the following table.
Grade  Points 
1.0  5760 
1.3  5456.5 
1.7  5153.5 
2.0  4850.5 
2.3  4547.5 
2.7  4244.5 
3.0  3941.5 
3.3  3638.5 
3.7  3335.5 
4.0  3032.5 
5.0  029.5 
 Exam admissions: We finished correcting all exercise sheets and determined the final scores. In this list you can find the public IDs of all students that are admitted to the exam.
You can find your public ID in the exercise system on the front page after logging in.
If you notice any problems, please send us a mail.
 You can find the exercise system here.
Language
English
Course Notes
The course notes are available here (in German): Course Notes (Version of March 22, 2013).
You can also find inofficial video recordings provided by Fachschaft I/1 MPI.
Contents
In addition to a short introduction to the programming language Prolog, the
lecture deals with the foundations of logic programming, with programming
techniques in these languages, with the implementation of logic
programming languages, and with their application in several areas.
More precisely, these are the topics of the lecture:
 Prerequisites from predicate logic
 Unification
 Resolution
 Horn clauses and SLDresolution

Logic programs
 Operational and denotational semantics
 Evaluation strategies

The programming language Prolog
 Syntax and semantics
 Negation as failure
 Nonlogical components of Prolog
 Programming techniques
 Applications and extensions of logic programming
Versions of the Lecture
Not all material of the lecture is needed for all students. More precisely, there are two versions of the lecture:
 V3B This version consists of a subset of the full lecture (with 3 hours per week). It
is relevant for students in Bachelor Informatik, Master Mathematik, and Master TK.
The following material is missing
in V3B:
 Section 4.1.3 (fixpoint semantics of logic programming)
 Section 4.2 (universality of logic programming)
 Section 4.3 up to Example 4.3.3 (exchangement lemma)
 Section 6 (constraint logic programming)
 V3M This version also consists of a subset of the full lecture (with 3 hours per week). It
is relevant for students in Master Informatik and Master SSE. This is also the version that is relevant for those students in Bachelor Informatik who already want to attend the masterversion of this course (they can transfer the credits obtained here as soon as they enter the master program).
The following material is missing
in V3M:
 Section 5.5 (input and output)
 Section 5.6 (meta programming)
 Section 5.7 (difference lists and definite clause grammars)
 Section 6 (constraint logic programming)
References
 K. R. Apt: From logic programming to Prolog, Prentice Hall, 1997.
 I. Bratko: Prolog Programming for Artificial Intelligence, AddisonWesley, 2001.
 W. F. Clocksin, C. S. Mellish: Programming in Prolog, Springer, 2003.
 T. Frühwirth, S. Abdennadher:
Essentials of Constraint Programming, Springer, 2003.
 M. Hanus: Problemlösen mit Prolog, Teubner, 1987.
 J. W. Lloyd: Foundations of Logic Programming, Springer, 1987.
 K. Marriott, P. J. Stuckey:
Programming with Constraints, MIT Press, 1998.
 P. H. Schmitt: Theorie der logischen Programmierung, Springer, 1992.
 U. Schöning: Logik für Informatiker, Spektrum Akademischer Verlag, 2000.
 L. Sterling, E. Shapiro: The art of Prolog, MIT Press, 2000.
Area
Theoretical Computer Science, Area of Specialization
Software
To write Prologprograms, we recommend the SWI Prolog System.
An alternative to SWIProlog is GNU
Prolog:
50% of the points on the exercise sheets are
needed in order to take part in the final written exam. The written exam will be on
August 21, 2013. If you fail this exam, there will be a second written exam on
September 16, 2013.
In order to take part in the exercises, please sign
up here.
The exercise sheets must be solved in groups of three. The solutions
can be handed in at the beginning of the exercise class on Wednesdays.
Transparencies
Here are the transparencies used in the lecture.
 Slide 1 (April 12, 2013)
 Slide 2 (April 15, 2013)
 Slide 3 (April 19, 2013)
 Slide 4 (April 25, 2013)
 Slide 5 (May 3, 2013)
 Slide 6 (May 3, 2013)
 Slide 7 (May 3, 2013)
 Slide 8 (May 10, 2013)
 Slide 9 (May 10, 2013)
 Slide 10 (May 13, 2013)
 Slide 11 (May 27, 2013)
 Slide 12 (June 3, 2013)
 Slide 13 (June 7, 2013)
 Slide 14 (June 7, 2013)
 Slide 15 (June 28, 2013)
 Slide 16 (July 1, 2013)
Old exams
Here you find two exams from the 2006, 2008, and 2010 lectures on logic
programming (partially in German). However, as the computer science curriculum has
been changed after the 2008 lecture took place, the conditions for 2006 and 2008 exams
were different from the ones for 2010 and the exam we will have in this lecture.
First, the old exams were not designed to determine the final grade for
the logic programming course, but only for the acquisition of the
Übungsschein. Second, they only took 90 minutes, while the exams from 2010 and 2013
took/will take 120 minutes. Third, we will have two different exams
(according to the two versions of the lecture) instead of just one in 2006 and 2008 or three in 2010.
Keep these differences in mind when practicing with the old exams.
Furthermore, we strongly recommend that you solve the old exams without
looking into the solutions first and that you also respect the time
limit of 90 minutes.
 Exam 2006, Solution 2006
 Exam 2008, Solution 2008
 Exam V3B 2010, Solution V3B 2010
 Exam V3M 2010, Solution V3M 2010
 Exam V4 2010, Solution V4 2010
 Exam V3B 2010 (2nd), Solution V3B 2010 (2nd)
 Exam V3M 2010 (2nd), Solution V3M 2010 (2nd)
 Exam V4 2010 (2nd), Solution V4 2010 (2nd)
 Exam V3B 2013, Solution V3B 2013
 Exam V3M 2013, Solution V3M 2013
 Exam V3B 2013 (2nd), Solution V3B 2013 (2nd)
 Exam V3M 2013 (2nd), Solution V3M 2013 (2nd)