A Debugging System Based on Natural Semantics
Alberto de la Encina (Universidad Complutense de Madrid, Spain)
Luis Llana (Universidad Complutense de Madrid, Spain)
Fernando Rubio (Universidad Complutense de Madrid, Spain)
Abstract: Due to the absence of side effects, reasoning about functional programsis simpler than reasoning about their imperative counterparts. However, because of the absence of practical debuggers, finding bugs in lazy functional languages has beenmore complex until quite recently. One of the easiest to use Haskell debuggers is Hood. Its behavior is based on the concept of observation of intermediate data structures.However, although using Hood can be simple when observing some structures, it is known that it can be hard to understand how it works when dealing with complexsituations. In fact, the author of Hood recognizes that it is necessary to formalize its behavior to explain better what should be expected, and also to allow to check whetherthe different implementations work properly.
In this paper, we formalize the behavior of the Hood debugger by extending Sestoft'snatural semantics. Moreover, we also show how to derive an abstract machine including such debugging information. By doing so, we do not only provide a formal foundation,but we also provide an alternative method to implement debuggers. In fact, we have already made a prototype of the abstract machine presented in this paper.
Keywords: abstract machines, debugging, parallel functional programming, semantics
Categories: D.2.5, D.3.1, D.3.2, F.3.2