Advertisement

New Generation Computing

, Volume 10, Issue 3, pp 255–285 | Cite as

Declarative diagnosis of missing answers

  • Lee Naish
Regular Papers

Abstract

This paper investigates algorithms for declarative diagnosis of missing answers in Prolog programs, especially programs which use coroutines. The logic of the problem is first presented, in the form of the simplest possible debugger. Next, we compare several previously published declarative debuggers based on Shapiro’s work. Examples showing incompleteness, incorrectness and equivalence of debuggers are given. Several enhancements to these debuggers are presented which can reduce the number and complexity of questions asked of the oracle, while still supporting coroutines. Although no debugger considered is best in all cases, the new algorithms are a practical contribution. Finally, we discuss diagnosis algorithms based more on Pereira’s work. These algorithms ask easier questions than Shapiro’s algorithms but rely on the standard left to right computation rule. We discuss possible ways to adapt these algorithms to handle coroutining. Completeness of debuggers is also discussed.

Keywords

Debugging Coroutines Failure Programming Environments 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1).
    Clark, K. L., “Negation as Failure,” inLogic and Data Bases (H. Gallaire and J. Minker, eds.), Plenum Press, pp. 293–322, 1978.Google Scholar
  2. 2).
    Dershowitz, N. and Lee, Y., “Deductive Debugging,”Proceedings of the 4th IEEE Symposium on Logic Programming, San Francisco, California, pp. 298–306, August 1987.Google Scholar
  3. 3).
    Drabent, W., Nadjm-Tehrani, S. and Maluszynski, J., “The Use of Assertions in Algorithmic Debugging,”Proceedings of the 1988 International Conference on Fifth Generation Computer Systems, Tokyo, Japan, pp. 573–581, December 1988.Google Scholar
  4. 4).
    Drabent, W., Nadjm-Tehrani, S. and Maluszynski, J., “Algorithmic Debugging with Assertions,” inMeta-Programming in Logic Programming (J. W. Lloyd, eds.), MIT Press, 1989.Google Scholar
  5. 5).
    Edman, A. and Tärnlund, S.-Å., “Mechanization of an Oracle in a Debugging System,”Proceedings of 8th IJCAI, Karlsruhe, Germany, pp. 553–555, August 1983.Google Scholar
  6. 6).
    Ferrand, G., “Error Diagnosis in Logic Programming, an Adaptation of E. Y. Shapiro’s Method,”Journal of Logic Programming 4, 3, pp. 177–198, September 1987.MATHCrossRefMathSciNetGoogle Scholar
  7. 7).
    Huntbach, M. M., “Algorithmic Parlog Debugging,”Proceedings of the 4th IEEE Symposium on Logic Programming, San Francisco, California, pp. 288–297, August 1987.Google Scholar
  8. 8).
    Kanamori, T., Kawamura, T., Maeji, M. and Horiuchi, K., “Logic Program Diagnosis from Specification,”ICOT Technical Report, TR-447, Institute for New Generation Computer Technology, Tokyo, Japan, March 1989.Google Scholar
  9. 9).
    Kowalski, R. A.,Logic for Problem Solving, North Holland, New York, 1980.Google Scholar
  10. 10).
    Lichtrenstein, Y., “Algorithmic Debugging of Flat Concurrent Prolog,”M. Sc. thesis, Department of Computer Science, Weizmann Institute of Science, Rehovot, Israel, August 1987.Google Scholar
  11. 11).
    Lloyd, J. and Takeuchi, A., “A Framework for Debugging GHC,”ICOT Technical Report, TR-186, Institute for New Generation Computer Technology, Tokyo, Japan, 1986.Google Scholar
  12. 12).
    Lloyd, J. W., “Declarative Error Diagnosis,”New Generation Computing, 5, 2, pp. 133–154, 1987.MATHCrossRefGoogle Scholar
  13. 13).
    Maeji, M. and Kanamori, T., “Top-Down Zooming Diagnosis of Logic Programs,”ICOT Technical Report, TR-290, Institute for New Generation Computer Technology, Tokyo, Japan, August 1987.Google Scholar
  14. 14).
    Nadjm-Tehrani, S., “Contributions to the Declarative Approach to Debugging Prolog Programs,”thesis No. 187, Department of Computer and Information Sciences, University of Linköping, Linköping, Sweden, 1989.Google Scholar
  15. 15).
    Naish, L., “Automating Control of Logic Programs,”Journal of Logic Programming, 2, 3, pp. 167–183, October 1985.MATHCrossRefGoogle Scholar
  16. 16).
    Naish, L., “Negation and Quantifiers in NU-Prolog,”Proceedings of the 3rd International Conference on Logic Programming, Imperial College of Science and Technology, London, England, pp. 624–634, July 1986, published asLecture Notes in Computer Science 255 by Springer-Verlag.Google Scholar
  17. 17).
    Naish, L., Dart, P. W. and Zobel, J., “The NU-Prolog Debugging Environment,”Proceedings of the 6th International Conference on Logic Programming, Lisboa, Portugal, June 1989.Google Scholar
  18. 18).
    Naish, L., “Types and the Intended Meaning of Logic Programs,”Technical Report, 90/4, Department of Computer Science, University of Melbourne, Melbourne, Australia, February 1990. to appear inTypes in Logic Programming, MIT press.Google Scholar
  19. 19).
    Nicholson, A. E., “Declarative Debugging of the Parallel Logic Programming Language GHC,”Proceedings of the 11th Australian Computer Science Conference, Brisbane, Australia, pp. 225–236, February 1988.Google Scholar
  20. 20).
    Pereira, L. M., “Rational Debugging in Logic Programming,”Proceedings of the 3rd International Conference in Logic Programming, London, England, pp. 203–210, July 1986, published asLecture Notes in Computer Science 225 by Springer-Verlag.Google Scholar
  21. 21).
    Pereira, L. M. and Calejo, M., “A Framework for Prolog Debugging,”Proceedings of the 5th International Conference/Symposium on Logic Programming, Seattle, Washington, pp. 481–495, August 1988.Google Scholar
  22. 22).
    Plaisted, D. A., “An Efficient Bug Location Algorithm,”Proceedings of the 2nd International Logic Programming Conference, Uppsala, Sweden, pp. 151–157, July 1984.Google Scholar
  23. 23).
    Shapiro, E. Y.,Algorithmic Program Debugging, MIT Press, Cambridge, Massachusetts, 1983.Google Scholar
  24. 24).
    Sterling, L. and Shapiro, E.,The Art of Prolog: Advanced Programming Techniques, MIT Press, Cambridge, Massachusetts, 1986.MATHGoogle Scholar
  25. 25).
    Takeuchi, A., “Algorithmic Debugging of GHC Programs and Its Implementation in GHC,”ICOT Technical Report, TR-185, Institute for New Generation Computer Technology, Tokyo, Japan, 1986.Google Scholar
  26. 26).
    Thom, J. and Zobel, J. eds., “NU-Prolog Reference Manual, Version 1.0,”Technical Report, 86/10, Department of Computer Science, University of Melbourne, Melbourne, Australia, 1986.Google Scholar
  27. 27).
    Yan S. Y. and Naish, L., “Completeness of an Improved Declarative Debugger,” inAdvances in Computing and Information, Canadian Scholar’s Press, pp. 132–135, May 1990, to appear inApplied Mathematical Letters.Google Scholar

Copyright information

© Ohmsha, Ltd. and Springer 1992

Authors and Affiliations

  • Lee Naish
    • 1
  1. 1.Department of Computer ScienceUniversity of MelbourneParkvilleAustralia

Personalised recommendations