Log in

Automatic debugging of Prolog programs in a Prolog Intelligent Tutoring System

  • Published:
Instructional Science Aims and scope Submit manuscript

Abstract

This paper describes an approach to the debugging of student Prolog programs in a Prolog Intelligent Tutoring System (PITS) that detects errors in them and proposes the corrections necessary to fix them. It proposes the use of multiple sources of expertise to analyse Prolog programs for tutoring purposes, and the collaboration of these sources for understanding student programs, detection of bugs and suggesting fixes to buggy student programs. It also demonstrates the use of a heuristic bestfirst search of the program decomposition space to parse a Prolog program into a hierarchical structure of predicate definitions, clauses, subgoals, arguments and terms. This article illustrates the merits of an algorithm-based approach supplemented by multiple sources of expertise for program debugging by showing that APROPOS2 is an effective, realistic and useful tool for program debugging. It then highlights the difficulties inherent in debugging Prolog programs and discusses the limitations of our algorithm-based approach.

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

Access this article

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price includes VAT (Germany)

Instant access to the full article PDF.

Similar content being viewed by others

References

  • Bratko, I. (1986). Prolog programming for artificial intelligences. Wokingham: Addison Wesley.

    Google Scholar 

  • Bma, P., Bundy, A., Pain, H. and Lynch, L. (1987). Programming tools for Prolog environments. in J. Hallam and C. Mellish (Eds.), Advances in artificial intelligence, pp. 251–264. Chichester: John Wiley and Sons.

    Google Scholar 

  • Bma, P., Bundy, A., Dodd, T., Elsenstadt, M., Looi, C. K., Pain, H., Robertson, D., Smith, B. and van Someren, M. (1991). Prolog programming techniques. Instructional Science, this issue.

  • Brough, D. R. and Hogger, C. J. (September 1986). The treatment of loops in logic programming. Research Report 86/16, Department of Computing, Imperial College of Science and Technology, London.

    Google Scholar 

  • Clark, K. L. and Tamlund, S-A. (1977). A first order theory of data and programs. In B. Gilchrist (Ed.), Information Processing, 77, 939–944.

  • Covington, M. A. (1985). Eliminating unwanted loops in Prolog. ACM SIGPLAN Notices, 20(1).

  • Debray, S. K. (1985). Dataflow analysis of logic programs. Department of Computer Science, State University of New York at Stony Bridge.

  • Debray, S. K. and Warren, D. S. (1988). Automatic mode inference for Prolog programs. Proceedings of the 1988 Symposium on Logic Programmung, pp. 78–88.

  • Dershowitz, N. and Lee, Y. (1987). Deductive debugging. Proceedings of the 1987 Logic Programming Symposium, pp. 298–306.

  • Ehrlich, K. and Soloway, E. (1983). An empirical investigation of the tacit plan knowledge in programming. In J. Thomas and M. L. Schneider (Eds.), Human factors in computer systems. Norwood, NJ: Ablex Inc.

    Google Scholar 

  • Hansson, A. and Tarnlund, S-A. (1979). A natural programming calculus. Proceedings of the Sixth International Joint Conference on Artificial Intelligence, pp. 348–355.

  • Hart, P. E., Nilsson, N. J. and Raphael, B. (1968). A formal basis for the heuristic determination of minimum cost paths. IEEE Transactions on SSC. 4(2), 100–107.

    Google Scholar 

  • Hart, P. E., Nilsson, N. J. and Raphael, B. (1972). Correction to A Formal Basis for the Heuristic Determination of Minimum Cost Paths. SIGART Newsletter, Vol 37.

  • Hutchings, A. M. J. (1986). Edinburgh Prolog: the new implementation (NIP) user's manual. AI Applications Institute, University of Edinburgh.

  • Johnson, W. L. (1985). Intention-based diagnosis of errors in novice programs. PhD Thesis, Yale University.

  • Kanamori, T. and Horiuchi, K. (1984). Type inference in Prolog and its applications. ICOT Research Center TR-095.

  • Kanamori, T. and Seki, H. (1984). Verification of Prolog programs using an extension of execution, ICOT Research Center TR-096.

  • Lloyd, J. W. (1986). Declarative error diagnosis. Department of Computer Science, University of Melbourne, Technical Report 86/3.

  • Looi, C. K. (1988). Automatic program analysis for a Prolog Intelligent Teaching System. PhD Thesis, University of Edinburgh.

  • Mellish, C. S. (1981). The automatic generation of mode declarations for Prolog programs. Research Paper No. 163, Department of Artificial Intelligence, University of Edinburgh.

  • Mishra, P. (1984). Towards a theory of types in Prolog. Proceedings of the 1984 Symposium on Logic Programming, pp. 187–197.

  • Murray, W. R. (1986). Automatic program debugging forIntelligent Tutoring Systems, TR 86-27. AI Laboratory, University of Texas at Austin.

  • Mycroft, A. and O'Keefe, R.A. (1984). A polymorphic type system for Prolog. Artifical Intelligence, 23(3), 289–298.

    Google Scholar 

  • Nilsson, N. (1980). Principles of AI. Palo Alto, CA: Tioga Press.

    Google Scholar 

  • Pereira, L. M. (1986). Rational debugging in logic programming. Proceedings of the Third Logic Programming Conference, London. pp. 203–210.

  • Rich, C. (1981). Inspection methods in programming. Technical Report AI-TR-604, Massachusetts Institute of Technology.

  • Ross, P. (1987). Some thoughts on the design of an Intelligent Teaching System for Prolog. AISB Quarterly, 62, (Summer).

  • Shapiro, E. (1983). Algorithmic program debugging. Cambridge, MA: MIT Press.

    Google Scholar 

  • Soloway, E. and Ehrlich, K. (1984). Empirical investigations of programming knowledge. IEEE Transactions of Software Engineering, SE-10, 5.

    Google Scholar 

  • Soloway, E., Ehrlich, K., Bonar, J. and Greenspan, J. (1982). What do novices know about programming? In A. Badre and B. Schneiderman (Eds.), Directions in human-computer interactions. Norwood, NJ: Ablex Inc.

    Google Scholar 

  • Soloway, E., Bonar, J. and Ehrlich, K., (1983). Cognitive strategies and loo** constructs: an empirical study. Communications of the ACM, 26, (November).

  • Sterling, L. and Shapiro, E. Y. (1986). The art of Prolog. Cambridge, MA: MIT Press.

    Google Scholar 

  • Tamlund, S-A., (1981). Logic programming: language based on a natural deduction system. UPMAIL Technical Report No. 6.

  • Warren, D. H. D., Pereira, F. and Pereira, L. (1977). PROLOG: the language and its implementation compared with LISP. SIGPLAN Notices, 12(8), 109–115.

    Google Scholar 

  • Waters, R. C. (1985). KBEmacs: a step toward the Programmer's Apprentice. MIT AI Laboratory, Technical Report 753.

  • Yardeni, E. and Shapiro, E. (1987). A type system for logic programs. Department of Computer Science, The Weizmann Institute of Science, Rehovot, Israel.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Looi, CK. Automatic debugging of Prolog programs in a Prolog Intelligent Tutoring System. Instr Sci 20, 215–263 (1991). https://doi.org/10.1007/BF00120883

Download citation

  • Issue Date:

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

Keywords

Navigation