Declarative Debugging of Rewriting Logic Specifications

  • Adrian Riesco
  • Alberto Verdejo
  • Rafael Caballero
  • Narciso Martí-Oliet
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5486)


Declarative debugging is a semi-automatic technique that starts from an incorrect computation and locates a program fragment responsible for the error by building a tree representing this computation and guiding the user through it to find the wrong statement. This paper presents the fundamentals for the declarative debugging of rewriting logic specifications, realized in the Maude language, where a wrong computation can be a reduction, a type inference, or a rewrite. We define appropriate debugging trees obtained as the result of collapsing in proof trees all those nodes whose correctness does not need any justification. Since these trees are obtained from a suitable semantic calculus, the correctness and completeness of the debugging technique can be formally proved. We illustrate how to use the debugger by means of an example and succinctly describe its implementation in Maude itself thanks to its reflective and metalanguage features.


Inference Rule Proof Tree Intended Interpretation Equational Logic Transitivity Inference 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bouhoula, A., Jouannaud, J.-P., Meseguer, J.: Specification and proof in membership equational logic. Theoretical Computer Science 236, 35–132 (2000)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Bruni, R., Meseguer, J.: Semantic foundations for generalized rewrite theories. Theoretical Computer Science 360(1), 386–414 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Caballero, R.: A declarative debugger of incorrect answers for constraint functional-logic programs. In: Proceedings of the 2005 ACM SIGPLAN Workshop on Curry and Functional Logic Programming (WCFLP 2005), pp. 8–13. ACM Press, Tallinn (2005)CrossRefGoogle Scholar
  4. 4.
    Caballero, R., Hermanns, C., Kuchen, H.: Algorithmic debugging of Java programs. In: López-Fraguas, F.J. (ed.) 15th Workshop on Functional and (Constraint) Logic Programming, WFLP 2006, Madrid. Electronic Notes in Theoretical Computer Science, vol. 177, pp. 75–89. Elsevier, Amsterdam (2007)Google Scholar
  5. 5.
    Caballero, R., Martí-Oliet, N., Riesco, A., Verdejo, A.: Declarative debugging of membership equational logic specifications. In: Degano, P., De Nicola, R., Meseguer, J. (eds.) Concurrency, Graphs and Models. LNCS, vol. 5065, pp. 174–193. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  6. 6.
    Caballero, R., Martí-Oliet, N., Riesco, A., Verdejo, A.: A declarative debugger for Maude functional modules. In: Roşu, G. (ed.) Proceedings Seventh International Workshop on Rewriting Logic and its Applications, WRLA 2008, Budapest. Electronic Notes in Computer Science, vol. 238, pp. 63–81. Elsevier, Amsterdam (2009)Google Scholar
  7. 7.
    Caballero, R., Rodríguez-Artalejo, M.: DDT: A declarative debugging tool for functional-logic languages. In: Kameyama, Y., Stuckey, P.J. (eds.) FLOPS 2004. LNCS, vol. 2998, pp. 70–84. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  8. 8.
    Caballero, R., Rodríguez-Artalejo, M., del Vado Vírseda, R.: Declarative diagnosis of missing answers in constraint functional-logic programming. In: Garrigue, J., Hermenegildo, M.V. (eds.) FLOPS 2008. LNCS, vol. 4989, pp. 305–321. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  9. 9.
    Chitil, O., Luo, Y.: Structure and properties of traces for functional programs. In: Mackie, I. (ed.) Proceedings of the Third International Workshop on Term Graph Rewriting (TERMGRAPH 2006). Electronic Notes in Theoretical Computer Science, vol. 176, pp. 39–63. Elsevier, Amsterdam (2007)Google Scholar
  10. 10.
    Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.: All About Maude: A High-Performance Logical Framework. LNCS, vol. 4350. Springer, Heidelberg (2007)zbMATHGoogle Scholar
  11. 11.
    Clavel, M., Meseguer, J., Palomino, M.: Reflection in membership equational logic, many-sorted equational logic, Horn logic with equality, and rewriting logic. Theoretical Computer Science 373(1-2), 70–91 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Lloyd, J.W.: Declarative error diagnosis. New Generation Computing 5(2), 133–154 (1987)CrossRefzbMATHGoogle Scholar
  13. 13.
    MacLarty, I.: Practical declarative debugging of Mercury programs. Master’s thesis, University of Melbourne (2005)Google Scholar
  14. 14.
    Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theoretical Computer Science 96(1), 73–155 (1992)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Meseguer, J.: Membership algebra as a logical framework for equational specification. In: Parisi-Presicce, F. (ed.) WADT 1997. LNCS, vol. 1376, pp. 18–61. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  16. 16.
    Naish, L.: Declarative diagnosis of missing answers. New Generation Computing 10(3), 255–286 (1992)CrossRefGoogle Scholar
  17. 17.
    Naish, L.: A declarative debugging scheme. Journal of Functional and Logic Programming 1997(3) (1997)Google Scholar
  18. 18.
    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)CrossRefzbMATHGoogle Scholar
  19. 19.
    Nilsson, H., Fritzson, P.: Algorithmic debugging of lazy functional languages. Journal of Functional Programming 4(3), 337–370 (1994)CrossRefGoogle Scholar
  20. 20.
    Pope, B.: A Declarative Debugger for Haskell. PhD thesis, The University of Melbourne, Australia (2006)Google Scholar
  21. 21.
    Riesco, A., Verdejo, A., Caballero, R., Martí-Oliet, N.: Declarative debugging of Maude modules. Technical Report SIC-6/2008, Dpto. Sistemas Informáticos y Computación, Universidad Complutense de Madrid (2008),
  22. 22.
    Riesco, A., Verdejo, A., Martí-Oliet, N., Caballero, R.: A declarative debugger for Maude. In: Meseguer, J., Roşu, G. (eds.) AMAST 2008. LNCS, vol. 5140, pp. 116–121. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  23. 23.
    Shapiro, E.Y.: Algorithmic Program Debugging. In: ACM Distinguished Dissertation. MIT Press, Cambridge (1983)Google Scholar
  24. 24.
    Silva, J.: A comparative study of algorithmic debugging strategies. In: Puebla, G. (ed.) LOPSTR 2006. LNCS, vol. 4407, pp. 143–159. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  25. 25.
    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)CrossRefGoogle Scholar
  26. 26.
    Viry, P.: Equational rules for rewriting logic. Theoretical Computer Science 285(2), 487–517 (2002)MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Adrian Riesco
    • 1
  • Alberto Verdejo
    • 1
  • Rafael Caballero
    • 1
  • Narciso Martí-Oliet
    • 1
  1. 1.Facultad de InformáticaUniversidad Complutense de MadridSpain

Personalised recommendations