 
Kurssin materiaali
Online Resources
Course Topics
1. Introduction. Facts, Rules and Queries.
 Lecture Notes
 Practical work.

Assignment 1: Facts, Rules and Queries.
2. Logic and Control. Matching and Proof Search.
 Lecture Notes
 Practical work.

Read
Search from Introduction to Prolog (Leeds)*.
Do Exercises 67. Check your answers.

Read
Matching and Proof Search from Learn Prolog Now!.
Do the Exercises and Practical Session 2.

Assignment 2: Matching and Proof Search.
3. Recursion. Lists. Genealogy Assignment.
 Lecture Notes
 Practical work.

Read
Recursion from Introduction to Prolog (Leeds)*.
Do Exercise 8. Check your answers.

Read
Recursion from Learn Prolog Now!
Do the Exercises and Practical Session 3.

Assignment 3: Royal Genealogy.
4. More Lists. Arithmetic.
 Lecture Notes
 Practical work.

Read
Lists from Introduction to Prolog (Leeds)*.
Do Exercise 9. Check your answers.

Read
Lists,
Arithmetic and
More Lists from Learn Prolog Now!
Do the Exercises and Practical Sessions.

Assignment 4: List Processing.
5. Difference Lists. Definite Clause Grammars.
 Lecture Notes
 Practical work.
Write 3 versions of a CFG which recognizes
the cat sat and
the cat sat on the mat:

First, write
catapp.pl with
CFG rules in Prolog using append/3 as in
7.1.1.

Second, write
catdiff.pl with
CFG rules using difference lists as in
7.1.2.

Third, write
catdcg.pl using DCG format as in
7.2.1.
Optionally, extend the grammar to recognize
the fat fat cat sat on the flat flat mat.
6. Metalevel Programming. Expert Systems.
7. Backtracking, Cuts and Negation. Final Assignment.
© Graham Wilcock 2004.

