JUCS - Journal of Universal Computer Science 15(14): 2836-2880, doi: 10.3217/jucs-015-14-2836
A Debugging System Based on Natural Semantics
expand article infoAlberto de la Encina, Luis Llana, Fernando Rubio
‡ Universidad Complutense de Madrid, Madrid, Spain
Open Access
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
parallel functional programming, debugging, semantics, abstract machines