Skip to main content
Log in

Declarative diagnosis of missing answers

  • Regular Papers
  • Published:
New Generation Computing Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Clark, K. L., “Negation as Failure,” inLogic and Data Bases (H. Gallaire and J. Minker, eds.), Plenum Press, pp. 293–322, 1978.

  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.

  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.

  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.

  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.

  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.

    Article  MATH  MathSciNet  Google Scholar 

  7. Huntbach, M. M., “Algorithmic Parlog Debugging,”Proceedings of the 4th IEEE Symposium on Logic Programming, San Francisco, California, pp. 288–297, August 1987.

  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. Kowalski, R. A.,Logic for Problem Solving, North Holland, New York, 1980.

    Google Scholar 

  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. 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. Lloyd, J. W., “Declarative Error Diagnosis,”New Generation Computing, 5, 2, pp. 133–154, 1987.

    Article  MATH  Google Scholar 

  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. 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. Naish, L., “Automating Control of Logic Programs,”Journal of Logic Programming, 2, 3, pp. 167–183, October 1985.

    Article  MATH  Google Scholar 

  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.

  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.

  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. 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.

  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.

  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.

  22. Plaisted, D. A., “An Efficient Bug Location Algorithm,”Proceedings of the 2nd International Logic Programming Conference, Uppsala, Sweden, pp. 151–157, July 1984.

  23. Shapiro, E. Y.,Algorithmic Program Debugging, MIT Press, Cambridge, Massachusetts, 1983.

    Google Scholar 

  24. Sterling, L. and Shapiro, E.,The Art of Prolog: Advanced Programming Techniques, MIT Press, Cambridge, Massachusetts, 1986.

    MATH  Google Scholar 

  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. 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. 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.

Download references

Author information

Authors and Affiliations

Authors

About this article

Cite this article

Naish, L. Declarative diagnosis of missing answers. New Gener Comput 10, 255–285 (1992). https://doi.org/10.1007/BF03037939

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF03037939

Keywords

Navigation