Advertisement

Specifying Prolog Trace Models with a Continuation Semantics

  • Erwan Jahier
  • Mireille Ducassé
  • Olivier Ridoux
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2042)

Abstract

Byrd’s box model is a fine-grained Prolog execution model that can be the basis of high-level debugging tools. In this article, we provide a formal specification of Byrd’s box model, based on an already existing operational and denotational continuation semantics for Prolog with cut. We show how this specification can be extended to specify richer Prolog trace models. To be able to experiment with trace models, we translate these specifications into ?Prolog. This translation leads to a Prolog interpreter that performs execution traces. We have hence a formal framework to specify, prototype, and validate Prolog trace models.

Keywords

Logic Program Operational Semantic Semantic Function Denotational Semantic Trace Model 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    R. Bahlke, B. Moritz, and G. Snelting. A generator for language-specific debugging systems. ACM SIGPLAN Notices, 22(7):92–101, 1987.CrossRefGoogle Scholar
  2. 2.
    R. Bahlke and G. Snelting. The PSG system: From formal language definition to interactive programming environments. ACM Transactions on Programming Languages and Systems, 8(4):547–576, 1986.CrossRefGoogle Scholar
  3. 3.
    C. Belleannée, P. Brisset, and O. Ridoux. A pragmatic reconstruction of ?Prolog. Journal of Logic Programming, 41(1):67–102, 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    K. L. Bernstein and E. W. Stark. Operational semantics of a focusing debugger. In ENCS, editor, 11th Conf. on the Mathematical Foundations of Programming Semantics, 1995.Google Scholar
  5. 5.
    D. Berry. Generating program animators from programming language semantics. PhD thesis, University of Edinburgh, 1991.Google Scholar
  6. 6.
    P. Brisset and O. Ridoux. The compilation of ?Prolog and its execution with MALI. PI 687, IRISA, 1992.Google Scholar
  7. 7.
    P. Brisset and O. Ridoux. Continuations in ?Prolog. In David S. Warren, editor, Tenth Int. Conf. Logic Programming, pages 27–43. The MIT Press, 1993.Google Scholar
  8. 8.
    G. Brooks, G. J. Hansen, and S. Simmons. A new approach to debugging optimized code. In SIGPLAN’ 92 Conf. on Programming Language Design and Implementation, pages 1–11, 1992.Google Scholar
  9. 9.
    L. Byrd. Understanding the control flow of Prolog programs. In S.-A. Tärnlund, editor, Logic Programming Workshop, 1980.Google Scholar
  10. 10.
    C. Consel and S. C. Khoo. Semantics-directed generation of a Prolog compiler. In J. Maluszynski and M. Wirsing, editors, 3rd Int. Symp. on Programming Language Implementation and Logic Programming, volume 528 of LNCS, pages 135–146. Springer-Verlag, 1991.Google Scholar
  11. 11.
    A. de Bruin and E. P. de Vink. Continuation semantics for Prolog with cut. In TAPSOFT’89: Int. Joint Conf. on Theory and Practice of Software Development, LNCS. Springer-Verlag, 1989.Google Scholar
  12. 12.
    S. K. Debray and P. Mishra. Denotational and operational semantics for Prolog. Journal of Logic Programming, 5:61–91, 1988.CrossRefzbMATHMathSciNetGoogle Scholar
  13. 13.
    M. Ducassé. Opium: An extendable trace analyser for Prolog. Journal of Logic programming, 39:177–223, 1999. Special issue on Synthesis, Transformation and Analysis of LogicPrograms, A. Bossi and Y. Deville (eds).Google Scholar
  14. 14.
    M. Ducassé and J. Noyé. Tracing Prolog programs by source instrumentation is efficient enough. Journal of Logic Programming, 43(2), 2000. Tech. Notes.Google Scholar
  15. 15.
    M. Eisenstadt. A powerful Prolog trace package. In 6th European Conf. on Artificial Intelligence. North-Holland, 1984.Google Scholar
  16. 16.
    E. Jahier and M. Ducassé. A genericap proach to monitor program executions. In D. De Schreye, editor, Int. Conf. on Logic Programming, pages 139–153. MIT Press, 1999.Google Scholar
  17. 17.
    N. D. Jones and A. Mycroft. Stepwise development of operational and denotational semantics for Prolog. In Int. Symp. Logic Programming, pages 281–288. IEEE, Computer Society Press, 1984.Google Scholar
  18. 18.
    G. Kahn. Natural semantics. In Symp. on Theoretical Aspects of Computer Science, volume 247 of LNCS. Springer-Verlag, 1987. The paper is also available as INRIA Report 601, February, 1987.Google Scholar
  19. 19.
    A. Kishon and P. Hudak. Semantics directed program execution monitoring. Journal of Functional Programming, 5(4):501–547, 1995.CrossRefGoogle Scholar
  20. 20.
    A. Kishon, P. Hudak, and C. Consel. Monitoring semantics: a formal framework for specifying, implementing and reasoning about execution monitors. ACM Sigplan Notices, 26(6):338–352, 1991.CrossRefGoogle Scholar
  21. 21.
    D. Miller and G. Nadathur. A logicp rogramming approach to manipulating formulas and programs. In Fifth Int. Conf. and Symp. Logic Programming. IEEE, Computer Society Press, 1987.Google Scholar
  22. 22.
    S. Moroshita and M. Numao. Prolog computation model BPM and its debugger PROEDIT2. In 5th Int. Conf. Logic Programming, pages 147–158. Springer-Verlag, 1986.Google Scholar
  23. 23.
    G. Nadathur and D. A. Miller. An overview of ?Prolog. In R. A. Kowalski and K. A. Bowen, editors, Joint Int. Conf. and Symp. Logic Programming, pages 810–827. MIT Press, 1988.Google Scholar
  24. 24.
    T. Nicholson and N. Foo. A denotational semantics for Prolog. ACM Transactions on Programming Languages and Systems, 11(4):650–665, 1989.CrossRefGoogle Scholar
  25. 25.
    A. Pettorossi and M Proietti. Transformation of logicpro grams: Foundations and techniques. Journal of Logic Programming, 19 & 20:261–320, 1994.CrossRefMathSciNetGoogle Scholar
  26. 26.
    G. D. Plotkin. A structural approach to operational semantics. Technical Report DAIMI FN-19, Computer Science Department, Aarhus University, 1981.Google Scholar
  27. 27.
    M. Proietti and A. Pettorossi. Semantics preserving transformation rules for Prolog. In Symp. on Partial Evaluation and Semantics-Based Program Manipulation, pages 274–284. ACM Press, 1991. Sigplan Notices 26:9.Google Scholar
  28. 28.
    A. Schleiermacher and J. F. H. Winkler. The implementation of ProTest, a Prolog Debugger for a refined box model. Software Practice and Experience, 20, 1990.Google Scholar
  29. 29.
    F. Q. B. Da Silva. Correctness Proofs of Compilers and Debuggers: an Approach Based on Structural Operational Semantics. PhD thesis, Univ. of Edinburgh, 1991.Google Scholar
  30. 30.
    G. Tobermann and C. Beckstein. What’s in a trace: The box model revisited. In Peter Fritzon, editor, AADEBUG, volume 749 of LNCS. Springer-Verlag, 1993.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Erwan Jahier
    • 1
  • Mireille Ducassé
    • 1
  • Olivier Ridoux
    • 1
  1. 1.IRISA-INSA-IFSICCampus Universitaire de BeaulieuRENNES CedexFrance

Personalised recommendations