Week 45
Announcements
There will be no official printed course book. I will supply lecture notes covering the course as we advance through the topics.
For the part on logic programming, the book Logic, Programming and Prolog can be obtained free of charge from the web site of Ulf Nilsson. This book covers the contents of the course from a more theoretical starting point.
For the part on functional programming, the book Real World Haskell is avilable from its website. This book covers the practical aspects of programming in Haskell and is a nice read in case you want to expand your practical command of Haskell.
Lecture Tuesday (03.11.2009)
The first lecture started with a short introduction about programming languages focusing on the differences between imperative and declarative languages.
The main part of the lecture was an introduction to the logic programming language Prolog.
Topics
course organization, declarative languages, facts, queries, rules
Reading
Lecture Notes in Blackboard (Course Documents)
Exercise Wednesday (04.11.2009)
The file family.pl contains a
slightly extended version of the knowledge base from the lecture.
That is, you can assume that the following predicates are fully defined:
1) Write clauses that define the following predicates:
2) Try to produce all answers of isMother(X). by repeatedly pressing semicolon. Do you see any answer ocurring more than once? What is the reason?
3) How does the behaviour of diff change if we replace \== by \= in its defining rule? Do your predicates using diff still work?
Lecture Thursday (05.11.2009)
The second lecture formalized Prolog evaluation and focused on unification. At the end we briefly introduced predicate logic.
Topics
Prolog evaluation, unification, Robinson's algorithm, termination of Robinson's algorithm, SLD tree, predicate logic
Reading
Lecture Notes in Blackboard (Course Documents)