Declarative Debugging of Lazy Functional Programs.
Lee Naish · 1992
This paper is organized as follows. First a simple declarative debugger for diagnosing incorrect answers in pure Prolog programs is presented. The debugger is somewhat more abstract than other published debuggers and is written in a subset of NU-Prolog which has well defined declarative semantics. Next a simple functional programming language with (initially) non-lazy evaluation is described. We show how such a language can be debugged in an equivalent way to Prolog. Lazy evaluation is then introduced and we show how the debugger can be generalised to handle this. A refinement which reduces the complexity of questions to the user is also presented. The functional programming language we use is implemented by transformation into Prolog. Though our discussion is based on this language and implementation, we hope it will be obvious how the ideas can be adapted. A summary of the debugging algorithm in abstract terms is given after the description of our implementation. Finally, we consider related work and possible extensions then conclude. 2 Declarative debugging of logic programs