Declarative source debugging

  • Miguel Calejo
  • Luís Moniz Pereira
Diagnosis And Repair
Part of the Lecture Notes in Computer Science book series (LNCS, volume 541)


We explore the idea of basing declarative debugging on the search for buggy textual formulas in the program, rather than on the search for computed buggy formula instances. The motivation is to build declarative debuggers requiring less oracle queries, at the cost of loosing information about the variable bindings of the diagnosis. This new approach we call declarative source debugging, as opposed to declarative execution debugging.

A motivating example for pure Prolog is given, consisting of an append computation with a wrong solution. Afterwards we present a declarative source debugging algorithm, and simulate it on some other examples. Under an (aparently reasonable) assumption the number of queries needed to derive a diagnosis is logarithmic with the number of program source clauses, rather than with the number of derivation nodes as in conventional declarative debugging, when using no case-dependent information.

Our conclusions carry over easily to other bug symptom types not exemplified and to impure Prolog, by adopting the conceptual framework of [Pereira Calejo 88, 89] and thereby uniformizing their treatment. This is reported in [Calejo 91].


Logic Program Query Performance Query Algorithm Oracle Query Wrong Solution 
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. [Calejo 91]
    Miguel Calejo, A Framework for Declarative Prolog Debugging, PhD thesis, Universidade Nova de Lisboa (in preparation)Google Scholar
  2. [Calejo Pereira 89]
    Miguel Calejo and Luís Moniz Pereira, The HyperTracer Debugging Environment, technical report, DI/UNLGoogle Scholar
  3. [Drabent et al. 88]
    W. Drabent, S. Nadjm-Tehrani and J. Maluszynski, “Algorithmic Debugging with Assertions” in MET A88 Proceedings (eds. J. Lloyd), MIT Press, Bristol, 1988.Google Scholar
  4. [Lichtenstein Shapiro 88]
    Y. Lichtenstein and E. Shapiro, “Abstract algorithmic debugging” in 5 th International Conference and Symposium on Logic Programming (eds. K. Bowen and R.A. Kowalski), MIT Press, Seattle, 1315–1336, 1988.Google Scholar
  5. [Pereira 86]
    Luís Moniz Pereira, Rational debugging in logic programming, in Procs. of the 3rd International Logic Programming Conference, E.Shapiro (ed.), Lecture Notes in Computer Science 225, Springer Verlag 1986.Google Scholar
  6. [Pereira Calejo 88]
    Luís Moniz Pereira and Miguel Calejo, A framework for Prolog debugging, Procs. 5th Int. Conf. on Logic Programming, Kowalski and Bowen (eds.), MIT Press 1988.Google Scholar
  7. [Pereira Calejo 89]
    Luís Moniz Pereira and Miguel Calejo, Algorithmic Debugging of Prolog Side-Effects, Procs. of the 4th Portuguese AI Conference, J.P.Martins and E. Morgado (eds.), Lecture Notes in Artificial Intelligence, Springer-Verlag 1989.Google Scholar
  8. [Shapiro 82]
    Ehud Y. Shapiro, Algorithmic Program Debugging, MIT Press 1982.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • Miguel Calejo
    • 1
  • Luís Moniz Pereira
    • 1
  1. 1.Logic Programming and Artificial Intelligence GroupUniversidade Nova de Lisboa (UNL)Monte da CaparicaPortugal

Personalised recommendations