Declarative Diagnosis of Wrong Answers in Constraint Functional-Logic Programming

  • Rafael Caballero
  • Mario Rodríguez Artalejo
  • Rafael del Vado Vírseda
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4079)


Debugging tools are a practical need for diagnosing the causes of erroneous computations. Declarative programming paradigms involving complex operational details, such as constraint solving and lazy evaluation, do not fit well to traditional debugging techniques relying on the inspection of low-level computation traces. As a solution to this problem, declarative diagnosis uses Computation Trees (shortly, CTs) in place of traces. CTs are built a posteriori to represent the structure of a computation whose top level outcome is regarded as an error symptom by the user. Each node in a CT represents the computation of some observable result, depending on the results of its children nodes. Declarative diagnosis explores a CT looking for a so-called buggy node which computes an incorrect result from children whose results are correct; such a node must point to an incorrect program fragment. The search for a buggy node can be implemented with the help of an external oracle (usually the user with some semiautomatic support) who has a reliable declarative knowledge of the expected program semantics, the so-called intended interpretation.


Proof Tree Constraint Logic Programming Functional Logic Lazy Evaluation Debug Tool 
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.


  1. 1.
    Caballero, R.: Declarative Debugger of Incorrect Answers for Constraint Functional-Logic Programs. In: Proc. WCFLP 2005, ACM SIGPLAN, pp. 8–13 (2005)Google Scholar
  2. 2.
    Caballero, R., Rodríguez-Artalejo, M.: A Declarative Debugging System for Lazy Functional Logic Programs. In: ENTCS, vol. 64, 63 pages (2002)Google Scholar
  3. 3.
    Caballero, R., Rodríguez-Artalejo, M.: \(\mathcal{DDT}\). In: Kameyama, Y., Stuckey, P.J. (eds.) FLOPS 2004. LNCS, vol. 2998, pp. 70–84. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  4. 4.
    Ferrand, G., Lesaint, W., Tessier, A.: Towards declarative diagnosis of constraint programs over finite domains. ArXiv Computer Science e-prints (2003)Google Scholar
  5. 5.
    Hermenegildo, M., Puebla, G., Bueno, F., López-García, P.: Abstract Verification and Debugging of Constraint Logic Programs. In: Proc. CSCLP 2002, pp. 1–14 (2002)Google Scholar
  6. 6.
    López-Fraguas, F.J., Rodríguez-Artalejo, M., del Vado-Vírseda, R.: A New Generic Scheme for Functional Logic Programming with Constraints. Journal Higher-Order and Symbolic Computation (to appear, 2006) Extended version of Constraint Functional Logic Programming Revisited, WRLA 2004, ENTCS 117, pp. 5–50 (2005)Google Scholar
  7. 7.
    Fraguas, F.J.L., Hernández, J.S.: TOY: A Multiparadigm Declarative System. In: Narendran, P., Rusinowitch, M. (eds.) RTA 1999. LNCS, vol. 1631, pp. 244–247. Springer, Heidelberg (1999), CrossRefGoogle Scholar
  8. 8.
    Naish, L.: A Declarative Debugging Scheme. Journal of Functional and Logic Programming (1997-3)Google Scholar
  9. 9.
    Pope, B., Naish, L.: Practical aspects of declarative debugging in Haskell 98. In: Proc. PPDP 2003, pp. 230–240. ACM Press, New York (2003)CrossRefGoogle Scholar
  10. 10.
    Shapiro, E.Y.: Algorithmic Program Debugging. The MIT Press, Cambridge (1982)Google Scholar
  11. 11.
    Tessier, A., Ferrand, G.: Declarative Diagnosis in the CLP Scheme, ch. 5. LNCS, vol. 1870, pp. 151–174. Springer, Heidelberg (2000)Google Scholar
  12. 12.
    del Vado Vírseda, R.: Declarative Constraint Programming with Definitional Trees. In: Gramlich, B. (ed.) FroCos 2005. LNCS (LNAI), vol. 3717, pp. 184–199. Springer, Heidelberg (2005)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Rafael Caballero
    • 1
  • Mario Rodríguez Artalejo
    • 1
  • Rafael del Vado Vírseda
    • 1
  1. 1.Dep. Sistemas Informáticos y ProgramaciónUniv. Complutense de Madrid 

Personalised recommendations