|
Lecture 4: Search and non-determinism
- iteration can be rewritten in recursion;
- search trees and strategies with reference to
searching acyclic directed graphs;
- searching cyclic directed graphs is considered.
|
|
How to prepare
|
|
|
- Ensure you understand that recursion requires (at least):
-
one base (terminating) case;
-
one recursive case.
- Consider searching for a route through a network where there
is a gap between two nodes. What would Prolog place on the
stack? When the search reached the gap in the network and so
was blocked, how would Prolog recover from the situation and
find an alternative path through the network?
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|