Development of a Prolog Tracer by Stepwise Enhancement

Arun Lakhotia, Leon Sterling and Dimitar Bojantchev

Abstract

A PROLOG tracer is essentially a PROLOG interpreter extended to provide features, such as retry, fail, leap, skip, and quasi-skip, to trace the computational flow of a program. This paper describes how a PROLOG tracer may be built by stepwise enhancement. Using this method, first a collection of partial-tracers are developed, each partial-tracer providing only a part of the tracer's functionality. The partial-tracers are then composed to yield a single tracer with the composite functionality of the partial-tracers.

Stepwise enhancement provides an alternative to stepwise refinement and iterative enhancement in scenarios where the "natural" subproblems do not correspond to distinct subprograms. This typically happens, as in the case of a PROLOG tracer, when different subprograms require the same program flow due to the constraint that their computations be performed simultaneously.

Stepwise enhancement eases the development and extension of a tracer, and also makes it customizable. A user may customize her tracer by composing only the partial tracers providing the desired functionality. New features may be added by developing a partial-tracer that provides the desired behavior and composing it with other partial tracers.

Full paper