|
Lecture 7: Processing lists in Prolog
This lecture begins by revisiting the example of iteration expressed as recursion.
Lists are introduced as a versatile data structure then the essentials
of list processing in Prolog are demonstrated.
This lecture will:
- explain why lists offer versatility;
- describe the syntax of lists in Prolog;
- show how Prolog unifies lists;
- introduce three common patterns of termination in list processing:
- when a certain number of list elements have been scanned;
- when the end of a list is reached (ald so all elements scanned);
- when a given element is found.
|
|
How to prepare
|
|
|
Revise you knowledge of basic list processing either by:
or
|
|
|
|
|
Slides
|
|
|
If you really want the slides from the lecture ...
but don't forget printing the slides is not the same as understanding them.
|
|
|
|
|
Programs from the lecture
|
|
|
|
|
|
Individual study suggestions and further reading
|
|
|
Topics on
lists
to be studied include:
List processing is covered in:
|
|
|
|