Theoretical Foundations for the Declarative Debugging of Lazy Functional Logic Programs

  • Rafael Caballero
  • Francisco J. López-Fraguas
  • Mario Rodrìguez-Artalejo
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2024)


The aim of this paper is to provide theoretical foundations for the declarative debugging of wrong answers in lazy functional logic programming. We rely on a logical framework which formalizes both the intended meaning and the execution model of programs in a simple language which combines the expressivity of pure Prolog and a significant subset of Haskell. As novelties w.r.t. to previous related approaches, we deal with functional values both as arguments and as results of higher order functions, we obtain a completely formal specification of the debugging method, and we extend known soundness and completeness results for the debugging of wrong answers in logic programming to a substantially more difficult context. A prototype implementation of a working debugger is planned as future work.


Logic Programming Computation Tree Logical Framework Proof Tree Intended Model 
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.
    S. Antoy, R. Echahed, M. Hanus. A Needed Narrowing Strategy. 21st ACM Symp. on Principles of Programming Languages, Portland, ACM Press, pp. 268–279, 1994.Google Scholar
  2. 2.
    G. Ferrand. Error Diagnosis in Logic Programming, an Adaptation of E.Y. Shapiro’s Method. The Journal of Logic Programming 4(3), pp. 177–198, 1987.CrossRefzbMATHMathSciNetGoogle Scholar
  3. 3.
    M. Falaschi, G. Levi, M. Martelli, C. Palamidessi. A Model-theoretic Reconstruction of the Operational Semantics of Logic Programs. Information and Computation 102(1). pp. 86–113, 1993.CrossRefMathSciNetGoogle Scholar
  4. 4.
    J.C. González-Moreno, M.T. Hortalá-González, M. Rodrìguez-Artalejo. A Higher Order Rewriting Logic for Functional Logic Programming. Procs. of ICLP’97, The MIT Press, pp. 153–167, 1997.Google Scholar
  5. 5.
    J.C. González-Moreno, M.T. Hortalá-González, F.J. López-Fraguas, M. Rodrìguez-Artalejo. An Approach to Declarative Programming Based on a Rewriting Logic, Journal of Logic Programming 40(1), pp. 47–87, 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    M. Hanus. The Integration of Functions into Logic Programming: A Survey. J. of Logic Programming 19-20, special issue ‘Ten Years of Logic Programming’, pp. 583–628, 1994.CrossRefMathSciNetGoogle Scholar
  7. 7.
    M. Hanus (ed.), Curry: an Integrated Functional Logic Language, Version 0.7, February 2, 2000. Available at
  8. 8.
    J. W. Lloyd. Declarative Error Diagnosis. New Generation Computing 5(2), pp. 133–154, 1987.zbMATHCrossRefGoogle Scholar
  9. 9.
    R. Loogen, F.J. López-Fraguas, M. Rodrìguez-Artalejo. A Demand Driven Computation Strategy for Lazy Narrowing. Procs. of PLILP’93, Springer LNCS 714, pp. 184-200, 1993.Google Scholar
  10. 10.
    F.J. López-Fraguas, J. Sánchez-Hernández.T OY: A Multiparadigm Declarative System, in Proc. RTA’99, Springer LNCS 1631, pp 244–247, 1999. Available at Scholar
  11. 11.
    L. Naish. Declarative dDebugging of Lazy Functional Programs. Australian Computer Science Communications, 15(1), pp. 287–294, 1993.Google Scholar
  12. 12.
    L. Naish. A Declarative Debugging Scheme. J. of Functional and Logic Programming, 1997-3.Google Scholar
  13. 13.
    L. Naish, T. Barbour. A Declarative Debugger for a Logical-Functional Language. In Graham Forsyth and Moonis Ali, eds. Eight International Conference on Industrial and Engineering Applications of Artificial Intelligence and Expert Systems Invited and additional papers, Vol. 2, pp. 91–99, 1995. DSTO General Document 51.Google Scholar
  14. 14.
    L. Naish, T. Barbour. Towards a Portable Lazy Functional Declarative Debugger. Australian Computer Science Communications, 18(1), pp. 401–408, 1996.Google Scholar
  15. 15.
    H. Nilsson, P. Fritzson. Algorithmic Debugging of Lazy Funcional Languages. The Journal of Functional Programming, 4(3), pp. 337–370, 1994.Google Scholar
  16. 16.
    H. Nilsson, J. Sparud. The Evaluation Dependence Tree as a Basis for Lazy Functional Debugging. Automated Software Engineering, 4(2), pp. 121–150, 1997.CrossRefGoogle Scholar
  17. 17.
    H. Nilsson. Declarative Debugging for Lazy Functional Languages. Ph.D. Thesis. Dissertation No. 530. Univ. Linkóping, Sweden. 1998.Google Scholar
  18. 18.
    J. Peterson, K. Hammond (eds.), Report on the Programming Language Haskell 98, A Non-strict, Purely Functional Language, 1 February 1999.Google Scholar
  19. 19.
    E.Y. Shapiro. Algorithmic Program Debugging. The MIT Press, Cambridge,Mass., 1982.Google Scholar
  20. 20.
    L. Sterling, E. Shapiro. The Art of Prolog. The MIT Press, 1986.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Rafael Caballero
    • 1
  • Francisco J. López-Fraguas
    • 1
  • Mario Rodrìguez-Artalejo
    • 1
  1. 1.Departamento de Sistemas Informáticos yProgramaciónUniversidad Complutense de MadridSpain

Personalised recommendations