A Declarative Debugger for Sequential Erlang Programs

Declarative debuggers are semi-automatic debugging tools that abstract the execution details to focus on the program semantics. Erroneous computations are represented by suitable trees, which are traversed by asking questions to the user until a bug is found. This paper applies declarative debugging to the sequential subset of the language Erlang. The debugger takes the intermediate representation generated by Erlang systems, known as Core Erlang, and an initial error detected by the user, and locates an erroneous program function responsible for the error. In order to represent the erroneous computation, a semantic calculus for sequential Core Erlang programs is proposed. The debugger uses an abbreviation of the proof trees of this calculus as debugging trees, which allows us to prove the soundness of the approach. The technique has been implemented in a debugger tool publicly available.

[1]  Lee Naish A Declarative Debugging Scheme , 1997, J. Funct. Log. Program..

[2]  Gérard Ferrand,et al.  Declarative Diagnosis in the CLP Scheme , 2000, Analysis and Visualization Tools for Constraint Programming.

[3]  Adrián Riesco,et al.  Declarative Debugging of Rewriting Logic Specifications , 2008, WADT.

[4]  Parosh Aziz Abdulla,et al.  Static Detection of Race Conditions in Erlang , 2009 .

[5]  Koen Claessen,et al.  A semantics for distributed Erlang , 2005, ERLANG '05.

[6]  Frank Huch,et al.  Verification of Erlang programs using abstract interpretation and model checking , 1999, ICFP '99.

[7]  John Hughes,et al.  QuickCheck Testing for Fun and Profit , 2007, PADL.

[8]  Bernard James Pope,et al.  A declarative debugger for Haskell , 2006 .

[9]  Ehud Shapiro,et al.  Algorithmic Program Debugging , 1983 .

[10]  Lee Naish Declarative diagnosis of missing answers , 2009, New Generation Computing.

[11]  Rafael Caballero A declarative debugger of incorrect answers for constraint functional-logic programs , 2005, WCFLP '05.

[12]  Josep Silva,et al.  A Comparative Study of Algorithmic Debugging Strategies , 2006, LOPSTR.

[13]  Konstantinos Sagonas,et al.  A PropEr integration of types and function specifications with property-based testing , 2011, Erlang Workshop.

[14]  Bernard J. Pope Declarative Debugging with Buddha , 2004, Advanced Functional Programming.

[15]  René David,et al.  An intuitionistic λ-calculus with exceptions , 2004, Journal of Functional Programming.

[16]  Konstantinos Sagonas,et al.  Precise explanation of success typing errors , 2013, PEPM '13.

[17]  Josep Silva A survey on algorithmic debugging strategies , 2011, Adv. Eng. Softw..

[18]  Lars-Åke Fredlund,et al.  A framework for reasoning about Erlang code , 2001 .

[19]  Richard Carlsson,et al.  EUnit: a lightweight unit testing framework for Erlang , 2006, ERLANG '06.

[20]  Reiner Hähnle,et al.  A visual interactive debugger based on symbolic execution , 2010, ASE '10.

[21]  Konstantinos Sagonas,et al.  Detecting Software Defects in Telecom Applications Through Lightweight Static Analysis: A War Story , 2004, APLAS.

[22]  Henrik Nilsson,et al.  How to look busy while being as lazy as ever: the Implementation of a lazy functional debugger , 2001, Journal of Functional Programming.

[23]  Lars-Åke Fredlund,et al.  A more accurate semantics for distributed erlang , 2007, ERLANG '07.

[24]  Philippe de Groote,et al.  A Simple Calculus of Exception Handling , 1995, TLCA.

[25]  Herbert Kuchen,et al.  Algorithmic Debugging of Java Programs , 2007, WFLP.

[26]  Richard Carlsson An introduction to Core Erlang , 2001 .

[27]  Claes Wikström,et al.  Concurrent programming in ERLANG (2nd ed.) , 1996 .

[28]  Thomas Arts,et al.  Translating Erlang to /spl mu/CRL , 2004, Proceedings. Fourth International Conference on Application of Concurrency to System Design, 2004. ACSD 2004..

[29]  Josep Silva,et al.  An algorithmic debugger for Java , 2010, 2010 IEEE International Conference on Software Maintenance.

[30]  Henrik Nilsson,et al.  The Evaluation Dependence Tree as a Basis for Lazy Functional Debugging , 1997, Automated Software Engineering.

[31]  Lars-Åke Fredlund,et al.  Recent improvements to the McErlang model checker , 2009, Erlang Workshop.

[32]  María Alpuente,et al.  An integrated framework for the diagnosis and correction of rule-based programs , 2010, Theor. Comput. Sci..