Logic Programming
06-25433
Autumn 2012

 

 

 

Lecture 15: Writing meta-circular interpreters in Prolog

So far it's been assumed that Prolog runs with its search procedure _ top-down, depth first. This lecture is intended to show that programs don't have to be run this way (although Prolog might be a practical compromise). Even sticking to top-down execution, there are a variety of ways in which Prolog’s search can be changed to alter the order in which solutions are found.

Three meta-interpreters are given:

  • simplest;
  • vanilla;
  • Pure Prolog with control over the scheduling of search.
How to prepare

  Revise your knowledge of stacks and queues, and depth-first and breadth-first search. Look through the second program (prove) in Lecture 14 to understand how a goal can be executed from within a Prolog program.

Video

  Recording of the lecture (Vimeo)

Slides

  If you really want the slides from the lecture ... but don't forget printing the slides is not the same as understanding them.

Summary

  Summary and programs with commentary from the lecture

Programs from the lecture

 
Example 1 - simplest meta-interpreter Example 2 - vanilla meta-interpreter Example 3 - Pure Prolog meta-circular meta-interpreter

Individual study suggestions and further reading

 

Further information about meta-interpreters is given in:

Assessed work associated with this lecture

  Tutorial sheet 5