|
Lecture 5: manipulating atomics and clauses
- reading input from the keyboard using recursion;
- looking words up in a dictionary;
- building a simple morphological analyser using sub_atom/5;
- using Prolog's operator notation to make code more readable;
- using clause/2 to access clauses in the Prolog program,
for instance to display them in some helpful layout.
|
|
How to prepare
|
|
|
- Ensure you understand why recursion requires (at least):
-
one base (terminating) clause
-
one recursive clause;
-
find definitions of functor/3, arg/3 and clause/2;
-
try examples of these predicates by typing queries in the Prolog interpreter.
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|