Brayshaw & Eisenstadt: "Abstractions in the Transparent Prolog Machine" 1 To appear in K. Bowen & R. Kowalski, (Eds.), Proceedings of the Fifth International Conference Symposium on Logic Programming. Cambridge, MA: MIT Press, 1988.
ADDING DATA AND PROCEDURE ABSTRACTION TO THE
TRANSPARENT PROLOG MACHINE (TPM)
M. BRAYSHAW and M. EISENSTADT
Human Cognition Research Laboratory
The Open University
Milton Keynes MK7 6AA, UK
The Transparent Prolog Machine (TPM) provides a vehicle for visualising the execution of Prolog programs in a manner which is faithful to the underlying behaviour of the Prolog interpreter. Although this fidelity is useful for teaching and debugging purposes, it can be inappropriate when a programmer wishes to view a program at a 'higher level', i.e. in terms of data or procedure abstractions which are not necessarily close to the underlying behaviour of the interpreter. We show how TPM can be extended to deal with the 'collection' abstraction inherent in higher-order predicates such as setof. In addition we discuss ways of allowing the user to customise the trace to produce the correct procedural abstraction for the task at hand.
The Transparent Prolog Machine (TPM) was presented by Eisenstadt and Brayshaw [4,6] as a way of visualising the execution of Prolog programs. TPM is aimed at both novice and expert users: novices have access to textbook diagrams and video animation sequences , and experts have access to a graphics workstation implementation that allows them to home in quickly (and visually) on the source of a bug . Of great importance to the expert debugging environment is the ability of TPM to provide both coarse-grained and fine-grained views of program execution involving very large search spaces.
The original conception of TPM emphasised fidelity to the underlying workings of the Prolog interpreter. This meant that fine-grained details such as clause head matching, including unresolved (non-unifying) clauses, had to be made available for both novice and expert users. For 'programming in the large', it is apparent that there is a trade-off between fidelity to the inner workings of the machine, on the one hand, and presenting a higher-level 'abstract' view of execution appropriate to the programmers own plans and intentions. TPM has