Declarative Debugging with Buddha

Bernie Pope (University of Melbourne)

Haskell is a very safe language, particularly because of its type system. However, there will always be programs that do the wrong thing. This lecture is about the use and implementation of a debugger, called buddha, which helps Haskell programmers understand why their programs misbehave. Traditional debugging tools that examine the program execution step-by-step are not suitable for Haskell because of its unorthodox evaluation strategy. Instead, a different approach is taken, which abstracts away the evaluation order of the program, and focuses on its high-level logical meaning.

This style of debugging is called Declarative Debugging, and it has its roots in the Logic Programming community. At the heart of the debugger is a tree which records information about the evaluation of the program in a manner which is easy to relate to the structure of the source code. It resembles a call graph annotated with the arguments and results of function applications, shown in their most evaluated form. Logical relationships between entities in the source are reflected in the links between nodes in the tree. An error diagnosis algorithm is applied to the tree in a top-down fashion in the search for causes of bugs.

The following points will be the focus of the lecture:

  1. How to use buddha effectively to find bugs in your program.
  2. Implementation (how buddha works)
  3. Outstanding issues that need more attention, such as debugging I/O intensive programs (future research potential).

More information about buddha can be found on its homepage:
http://www.cs.mu.oz.au/~bjpop/buddha/


Last update 12 April 2004