Skip to main content

A Declarative Debugger for Sequential Erlang Programs

  • Conference paper
Tests and Proofs (TAP 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7942))

Included in the following conference series:

Abstract

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.

Research supported by MICINN Spanish projects StrongSoft (TIN2012-39391-C04-04), FAST-STAMP (TIN2008-06622-C03-01) and LEVITY (TIN2008-06622-C03-02), Comunidad de Madrid program PROMETIDOS (S2009/TIC-1465), and Generalitat Valenciana program PROMETEO (2011/052). Salvador Tamarit was partially supported by MICINN Spanish FPI grant (BES-2009-015019).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 72.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Alpuente, M., Ballis, D., Correa, F., Falaschi, M.: An integrated framework for the diagnosis and correction of rule-based programs. Theoretical Computer Science 411(47), 4055–4101 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  2. Armstrong, J., Williams, M., Wikstrom, C., Virding, R.: Concurrent Programming in Erlang, 2nd edn. Prentice-Hall, Englewood Cliffs (1996)

    Google Scholar 

  3. Arts, T., Benac Earle, C., Sánchez Penas, J.J.: Translating Erlang to muCRL. In: Proceedings of the International Conference on Application of Concurrency to System Design, ACSD 2004, pp. 135–144. IEEE Computer Society Press (June 2004)

    Google Scholar 

  4. Benac Earle, C., Fredlund, L.A.: Recent improvements to the McErlang model checker. In: Proceedings of the 8th ACM SIGPLAN Workshop on ERLANG, ERLANG 2009, pp. 93–100. ACM, New York (2009)

    Google Scholar 

  5. Caballero, R.: A declarative debugger of incorrect answers for constraint functional-logic programs. In: Antoy, S., Hanus, M. (eds.) Proceedings of the 2005 ACM SIGPLAN Workshop on Curry and Functional Logic Programming, WCFLP 2005, Tallinn, Estonia, pp. 8–13. ACM Press (2005)

    Google Scholar 

  6. Caballero, R., Hermanns, C., Kuchen, H.: Algorithmic debugging of Java programs. In: López-Fraguas, F. (ed.) Proceedings of the 15th Workshop on Functional and (Constraint) Logic Programming, WFLP 2006, Madrid, Spain. Electronic Notes in Theoretical Computer Science, vol. 177, pp. 75–89. Elsevier (2007)

    Google Scholar 

  7. Caballero, R., Martin-Martin, E., Riesco, A., Tamarit, S.: A calculus for sequential erlang programs. Technical Report 03/13, Departamento de Sistemas Informáticos y Computación (April 2013)

    Google Scholar 

  8. Carlsson, R.: An introduction to Core Erlang. In: Proceedings of the Erlang Workshop 2001, In Connection with PLI (2001)

    Google Scholar 

  9. Carlsson, R., Gustavsson, B., Johansson, E., Lindgren, T., Nyström, S.-O., Pettersson, M., Virding, R.: Core Erlang 1.0.3 language specification (November 2004), http://www.it.uu.se/research/group/hipe/cerl/doc/core_erlang-1.0.3.pdf

  10. Carlsson, R., Rémond, M.: EUnit: a lightweight unit testing framework for Erlang. In: Proceedings of the 2006 ACM SIGPLAN Workshop on Erlang, ERLANG 2006, p. 1. ACM, New York (2006)

    Chapter  Google Scholar 

  11. Christakis, M., Sagonas, K.: Static detection of race conditions in Erlang. In: Carro, M., Peña, R. (eds.) PADL 2010. LNCS, vol. 5937, pp. 119–133. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  12. Christensen, N.H.: Domain-specific languages in software development - and the relation to partial evaluation. PhD thesis, DIKU, Dept. of Computer Science, University of Copenhagen, Denmark (July 2003)

    Google Scholar 

  13. Claessen, K., Svensson, H.: A semantics for distributed Erlang. In: Proceedings of the 2005 ACM SIGPLAN Workshop on Erlang, ERLANG 2005, pp. 78–87. ACM, New York (2005)

    Chapter  Google Scholar 

  14. David, R., Mounier, G.: An intuitionistic lambda-calculus with exceptions. Journal of Functional Programming 15(1), 33–52 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  15. de Groote, P.: A simple calculus of exception handling. In: Dezani-Ciancaglini, M., Plotkin, G.D. (eds.) TLCA 1995. LNCS, vol. 902, pp. 201–215. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

  16. Fredlund, L.-A.: A Framework for Reasoning about Erlang Code. PhD thesis, The Royal Institute of Technology, Sweden (August. 2001)

    Google Scholar 

  17. Hähnle, R., Baum, M., Bubel, R., Rothe, M.: A visual interactive debugger based on symbolic execution. In: Pecheur, C., Andrews, J., Nitto, E.D. (eds.) 25th IEEE/ACM International Conference on Automated Software Engineering, ASE 2010, pp. 143–146. ACM (2010)

    Google Scholar 

  18. Huch, F.: Verification of erlang programs using abstract interpretation and model checking. SIGPLAN Not. 34(9), 261–272 (1999)

    Article  Google Scholar 

  19. Hughes, J.: QuickCheck testing for fun and profit. In: Hanus, M. (ed.) PADL 2007. LNCS, vol. 4354, pp. 1–32. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  20. Insa, D., Silva, J.: An algorithmic debugger for Java. In: Lanza, M., Marcus, A. (eds.) Proceedings of the 26th IEEE International Conference on Software Maintenance, ICSM 2010, pp. 1–6. IEEE Computer Society (2010)

    Google Scholar 

  21. Lindahl, T., Sagonas, K.: Detecting software defects in telecom applications through lightweight static analysis: A war story. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 91–106. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  22. MacLarty, I.: Practical declarative debugging of Mercury programs. Master’s thesis, University of Melbourne (2005)

    Google Scholar 

  23. Naish, L.: Declarative diagnosis of missing answers. New Generation Computing 10(3), 255–286 (1992)

    Article  Google Scholar 

  24. Naish, L.: A declarative debugging scheme. Journal of Functional and Logic Programming 1997(3) (1997)

    Google Scholar 

  25. Nilsson, H.: How to look busy while being as lazy as ever: the implementation of a lazy functional debugger. Journal of Functional Programming 11(6), 629–671 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  26. Nilsson, H., Sparud, J.: The evaluation dependence tree as a basis for lazy functional debugging. Automated Software Engineering 4, 121–150 (1997)

    Article  Google Scholar 

  27. Papadakis, M., Sagonas, K.: A PropEr integration of types and function specifications with property-based testing. In: Proceedings of the 2011 ACM SIGPLAN Erlang Workshop, pp. 39–50. ACM Press (2011)

    Google Scholar 

  28. Pope, B.: Declarative debugging with Buddha. In: Vene, V., Uustalu, T. (eds.) AFP 2004. LNCS, vol. 3622, pp. 273–308. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  29. Pope, B.: A Declarative Debugger for Haskell. PhD thesis, The University of Melbourne, Australia (2006)

    Google Scholar 

  30. Riesco, A., Verdejo, A., Martí-Oliet, N., Caballero, R.: Declarative debugging of rewriting logic specifications. Journal of Logic and Algebraic Programming 81(7-8), 851–897 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  31. Sagonas, K., Silva, J., Tamarit, S.: Precise explanation of success typing errors. In: Proceedings of the ACM SIGPLAN 2013 Workshop on Partial Evaluation and Program Manipulation, PEPM 2013, pp. 33–42. ACM, New York (2013)

    Chapter  Google Scholar 

  32. Shapiro, E.Y.: Algorithmic Program Debugging. ACM Distinguished Dissertation. MIT Press (1983)

    Google Scholar 

  33. Silva, J.: A comparative study of algorithmic debugging strategies. In: Puebla, G. (ed.) LOPSTR 2006. LNCS, vol. 4407, pp. 143–159. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  34. Silva, J.: A survey on algorithmic debugging strategies. Advances in Engineering Software 42(11), 976–991 (2011)

    Article  Google Scholar 

  35. Svensson, H., Fredlund, L.-A.: A more accurate semantics for distributed Erlang. In: Proceedings of the 2007 SIGPLAN Workshop on ERLANG Workshop, ERLANG 2007, pp. 43–54. ACM, New York (2007)

    Chapter  Google Scholar 

  36. Tessier, A., Ferrand, G.: Declarative diagnosis in the CLP scheme. In: Deransart, P., Hermenegildo, M.V., Maluszynski, J. (eds.) DiSCiPl 1999. LNCS, vol. 1870, pp. 151–174. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Caballero, R., Martin-Martin, E., Riesco, A., Tamarit, S. (2013). A Declarative Debugger for Sequential Erlang Programs. In: Veanes, M., Viganò, L. (eds) Tests and Proofs. TAP 2013. Lecture Notes in Computer Science, vol 7942. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-38916-0_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-38916-0_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-38915-3

  • Online ISBN: 978-3-642-38916-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics