Skip to main content

Mechanically verifying the correctness of an offline partial evaluator

  • Conference paper
  • First Online:
Programming Languages: Implementations, Logics and Programs (PLILP 1995)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 982))

Abstract

We show that using deductive systems to specify an offline partial evaluator allows one to specify, prototype, and mechanically verify correctness via meta-programming — all within a single framework.

For a λ-mix-style partial evaluator, we specify binding-time constraints using a natural-deduction logic, and the associated program specializer using natural (aka “deductive”) semantics. These deductive systems can be directly encoded in the Elf programming language — a logic programming language based on the LF logical framework. The specifications are then executable as logic programs. This provides a prototype implementation of the partial evaluator.

Moreover, since deductive system proofs are accessible as objects in Elf, many aspects of the partial evaluator correctness proofs (e.g., the correctness of binding-time analysis) can be coded in Elf and mechanically checked.

This work is supported by the Danish Research Academy and by the DART project (Design, Analysis and Reasoning about Tools) of the Danish Research Councils.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Yves Bertot and Ranan Fraer. Reasoning with executable specifications. In TAP-SOFT'95 [27], pages 531–545.

    Google Scholar 

  2. Sandrine Blazy and Philippe Facon. Formal specification and prototyping of a program specializer. In TAPSOFT'95 [27], pages 666–680.

    Google Scholar 

  3. Charles Consel and Olivier Danvy. Tutorial notes on partial evaluation. In Susan L. Graham, editor, Proceedings of the Twentieth Annual ACM Symposium on Principles of Programming Languages, pages 493–501, Charleston, South Carolina, January 1993. ACM Press.

    Google Scholar 

  4. Rowan Davies and Frank Pfenning. A modal analysis of staged compuation. In Proceedings of the Workshop on Types for Program Analysis, Aarhus, Denmark, 1995.

    Google Scholar 

  5. Jöelle Despeyroux. Proof of translation in natural semantics. In Proceedings of the First Annual IEEE Symposium on Logic in Computer Science, pages 193–205, Cambridge, Massachusetts, 1986. IEEE Computer Society Press.

    Google Scholar 

  6. Robert Glück and Jesper Jørgensen. Efficient multi-level generating extensions. 1995. To appear in The Proceedings of the Seventh International Symposium on Programming Languages, Implementations, Logics and Programs. Utrecht, The Netherlands, September 20–22, 1995.

    Google Scholar 

  7. Carsten K. Gomard and Neil Jones. A partial evaluator for the untyped lambdacalculus. Journal of Functional Programming, 1(1):21–69, 1991.

    Google Scholar 

  8. Carl A. Gunter. Semantics of Programming Languages: Structures and Techniques. MIT Press, 1992.

    Google Scholar 

  9. John Hannan. Extended natural semantics. Journal of Functional Programming, 3(2):123–152, 1993.

    Google Scholar 

  10. John Hannan and Dale Miller. Deriving mixed evaluation from standard evaluation for a simple functional language. In J. van de Snepscheut, editor, Mathematics of Program Construction, number 375 in Lecture Notes in Computer Science, pages 239–255, 1989.

    Google Scholar 

  11. John Hannan and Frank Pfenning. Compiler verification in LF. In Proceedings of the Seventh Symposium on Logic in Computer Science, pages 407–418. IEEE, 1992.

    Google Scholar 

  12. Robert Harper, Furio Honsell, and Gordon Plotkin. A framework for defining logics. Journal of the ACM, 40(1):143–184, 1993. A preliminary version appeared in the proceedings of the First IEEE Symposium on Logic in Computer Science, pages 194–204, June 1987.

    Google Scholar 

  13. John Hatcliff. Mechanically verifying the correctness of an offline partial evaluator (extended version). DIKU Report 95/14, University of Copenhagen, Copenhagen, Denmark, 1995.

    Google Scholar 

  14. John Hatcliff and Olivier Danvy. A computational formalization for partial evaluation. DIKU Report 95/15, University of Copenhagen, Copenhagen, Denmark, 1995. Presented at the Workshop on Logic, Domains, and Programming Languages. Darmstadt, Germany. May, 1995.

    Google Scholar 

  15. Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall International, 1993.

    Google Scholar 

  16. Julia L. Lawall and Olivier Danvy. Continuation-based partial evaluation. Technical Report CS-95-178, Computer Science Department, Brandeis University, Waltham, Massachusetts, January 1995. An earlier version appeared in the proceedings of the 1994 ACM Conference on Lisp and Functional Programming.

    Google Scholar 

  17. Spiro Michaylov and Frank Pfenning. Natural semantics and some of its metatheory in Elf. Report MPI-I-91-211, Max-Planck-Institute for Computer Science, Saarbrücken, Germany, August 1991.

    Google Scholar 

  18. T. Mogensen. Self-applicable partial evaluation for the pure lambda calculus. In Charles Consel, editor, ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, Research Report 909, Department of Computer Science, Yale University, pages 116–121, San Francisco, California, June 1992.

    Google Scholar 

  19. Jens Palsberg. Correctness of binding-time analysis. Journal of Functional Programming, 3(3):347–363, 1993.

    Google Scholar 

  20. Frank Pfenning. Logic programming in the LF logical framework. In Gérard Huet and Gordon Plotkin, editors, Logical Frameworks, pages 149–181. Cambridge University Press, 1991.

    Google Scholar 

  21. Frank Pfenning. A proof of the church-rosser theorem and its representation in a logical framework. Technical Report CMU-CS-92-186, Carnegie Mellon University, Pittsburgh, Pennsylvania, September 1992. To appear in Journal of Automated Reasoning.

    Google Scholar 

  22. Frank Pfenning and Conal Elliott. Higher-order abstract syntax. In Proceedings of the ACM SLGPLAN'88 Conference on Programming Languages Design and Implementation, pages 199–208, June 1988.

    Google Scholar 

  23. Frank Pfenning and Ekkehard Rohwedder. Implementing the meta-theory of deductive systems. In D. Kapur, editor, Proceedings of the 11th Eleventh International Conference on Automated Deduction, number 607 in Lecture Notes in Artificial Intelligence, pages 537–551, Saratoga Springs, New York, 1992. Springer-Verlag.

    Google Scholar 

  24. Dag Prawitz. Natural Deduction. Almquist and Wiksell, Uppsala, 1965.

    Google Scholar 

  25. David Sands. Total correctness by local improvement in program transformation. In Ron Cytron, editor, Proceedings of the Twenty-first Annual ACM Symposium on Principles of Programming Languages, pages 221–232, San Francisco, California, January 1995. ACM Press.

    Google Scholar 

  26. Morten Heine Sørensen, Robert Glück, and Neil Jones. Towards unifying partial evaluation, deforestation, supercompilation, and GPC. In Proceedings of the Fifth European Symposium on Programming, pages 485–500, Edinburgh, U.K., April 1994.

    Google Scholar 

  27. TAPSOFT '95: Theory and Practice of Software Development, number 915 in Lecture Notes in Computer Science, Aarhus, Denmark, May 1995.

    Google Scholar 

  28. Mitchell Wand. Specifying the correctness of binding-time analysis. Journal of Functional Programming, 3(3):365–387, 1993.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Manuel Hermenegildo S. Doaitse Swierstra

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hatcliff, J. (1995). Mechanically verifying the correctness of an offline partial evaluator. In: Hermenegildo, M., Swierstra, S.D. (eds) Programming Languages: Implementations, Logics and Programs. PLILP 1995. Lecture Notes in Computer Science, vol 982. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0026826

Download citation

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

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-60359-7

  • Online ISBN: 978-3-540-45048-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics