Reflections on reflections

  • Gilles Barthel
  • John Hatcliff
  • Morten Heine Sørensen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1292)


In the functional programming literature, compiling is often expressed as a translation between source and target program calculi. In recent work, Sabry and Wadler proposed the notion of a reflection as a basis for relating the source and target calculi. A reflection elegantly describes the situation where there is a kernel of the source language that is isomorphic to the target language. However, we believe that the reflection criteria is so strong that it often excludes the usual situation in compiling where one is compiling from a higher-level to a lower-level language.

We give a detailed analysis of several translations commonly used in compiling that fail to be reflections. We conclude that, in addition to the notion of reflection, there are several relations weaker a reflection that are useful for characterizing translations. We show that several familiar translations (that are not naturally reflections) form what we call a reduction correspondence. We introduce the more general notion of a (R1, R2, R3, R4)-correspondence as a framework for describing relations between source and target calculi.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Andrew W. Appel. Compiling with Continuations. Cambridge University Press, 1992.Google Scholar
  2. 2.
    Gilles Barthe, John Hatcliff, and Morten Heine Sørensen. Reflections on Reflections (full version). Forthcoming DIKU Technical Report. Available at Scholar
  3. 3.
    P. N. Benton. Strictness Analysis of Lazy Functional Programs. PhD thesis, Computer Laboratory, University of Cambridge, Cambridge, England, 1995.Google Scholar
  4. 4.
    Geoffrey Burn and Daniel Le Métayer. Proving the correctness of compiler optimisations based on a global program analysis. Technical report Doc 92/20, Department of Computing, Imperial College of Science, Technology and Medicine, London, England, 1992.Google Scholar
  5. 5.
    Olivier Danvy. Back to direct style. Science of Computer Programming, 22(3):183–195, 1994. Special Issue on ESOP'92, the Fourth European Symposium on Programming, Rennes, February 1992.Google Scholar
  6. 6.
    Olivier Danvy and Andrzej Filinski. Representing control, a study of the CPS transformation. Mathematical Structures in Computer Science, Vol. 2, No. 4, pages 361–391. Cambridge University Press, December 1992.Google Scholar
  7. 7.
    Olivier Danvy and John Hatcliff. CPS transformation after strictness analysis. ACM Letters on Programming Languages and Systems, 1(3):195–212, 1993.Google Scholar
  8. 8.
    B. A. Davey and H. A. Priestley. Introduction to Lattices and Order. Cambridge University Press, 1990.Google Scholar
  9. 9.
    Michael J. Fischer. Lambda-calculus schemata. In Talcott [28]. An earlier version appeared in the Proceedings of the ACM Conference on Proving Assertions about Programs, SIGPLAN Notices, Vol. 7, No. 1, January 1972.Google Scholar
  10. 10.
    Cormac Flanagan, Amr Sabry, Bruce F. Duba, and Matthias Felleisen. The essence of compiling with continuations. In David W. Wall, editor, Proceedings of the ACM SIGPLAN'93 Conference on Programming Languages Design and Implementation, SIGPLAN Notices, Vol. 28, No 6, pages 237–247, Albuquerque, New Mexico, June 1993. ACM Press.Google Scholar
  11. 11.
    Pascal Fradet and Daniel Le Métayer. Compilation of functional languages by program transformation. ACM Transactions on Programming Languages and Systems, 13:21–51, 1991.Google Scholar
  12. 12.
    John Hatcliff and Olivier Danvy. A generic account of continuation-passing styles. In Hans Boehm, editor, Proceedings of the Twenty-first Annual ACM Symposium on Principles of Programming Languages, Portland, Oregon, January 1994. ACM Press.Google Scholar
  13. 13.
    John Hatcliff and Olivier Danvy. Thunks and the λ-calculus. Journal of Functional Programming, 1995. (in press). The extended version of this paper appears as DIKU-Report 95/3.Google Scholar
  14. 14.
    John Hatcliff and Olivier Danvy. A computational formalization for partial evaluation. Mathematical Structures in Computer Science, 1996. (in press). To appear in a special issue devoted to selected papers from the Workshop on Logic, Domains, and Programming Languages. Darmstadt, Germany. May, 1995.Google Scholar
  15. 15.
    P. Z. Ingerman. Thunks, a way of compiling procedure statements with some comments on procedure declarations, Communications of the ACM, 4(1):55–58, 1961.Google Scholar
  16. 16.
    J. Kamperman and H. Walters. Minimal term rewriting systems. In M. Haveraaen, O. Owe, and O.-J. Dahl, editors, Recent Trends in Data Type Specification, volume 1130 of Lecture Notes in Computer Science, pages 274–290, 1996.Google Scholar
  17. 17.
    Julia L. Lawall and Olivier Danvy. Separating stages in the continuation-passing style transformation. In Susan L. Graham, editor, Proceedings of the Twentieth Annual ACM Symposium on Principles of Programming Languages, pages 124–136, Charleston, South Carolina, January 1993. ACM Press.Google Scholar
  18. 18.
    Julia L. Lawall and Peter Thíemann. Sound specialization in the presence of computational effects. To appear in the Proceedings of TACS'97.Google Scholar
  19. 19.
    Eugenio Moggi. Notions of computation and monads. Information and Computation, 93:55–92, 1991.Google Scholar
  20. 20.
    Chris Okasaki, Peter Lee, and David Tarditi. Call-by-need and continuation-passing style. In Talcott [28].Google Scholar
  21. 21.
    Gordon D. Plotkin. Call-by-name, call-by-value and the γ-calculus. Theoretical Computer Science, 1:125–159, 1975.Google Scholar
  22. 22.
    Amr Sabry and Matthias Felleisen. Reasoning about programs in continuation-passing style. In Talcott [28], pages 289–360.Google Scholar
  23. 23.
    Amr Sabry and Philip Wadler. A reflection on call-by-value. In Proceedings of the 1996 ACM SIGPLAN International Conference on Functional Programming, April 1996.Google Scholar
  24. 24.
    Amr Sabry and Philip Wadler. A reflection on call-by-value. Technical Report CIS-TR-96-08, Department of Computing and Information Sciences, University of Oregon, Eugene, Oregon, April 1996.Google Scholar
  25. 25.
    Amr Sabry and Philip Wadler. Personal communication. June 4, 1997.Google Scholar
  26. 26.
    Morten Heine Sørensen. Strong normalization from weak normalization in typed λ-calculi. Information and Computation, 133(1):35–71, 1997.Google Scholar
  27. 27.
    Guy L. Steele Jr. Rabbit: A compiler for Scheme. Technical Report AI-TR-474, Artificial Intelligence Laboratory, Massachusetts Institute of Technology, Cambridge, Massachusetts, May 1978.Google Scholar
  28. 28.
    Carolyn L. Talcott, editor. Special issue on continuations, LISP and Symbolic Computation, Vol. 6, Nos. 3/4. Kluwer Academic Publishers, 1993.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1997

Authors and Affiliations

  • Gilles Barthel
    • 1
  • John Hatcliff
    • 2
  • Morten Heine Sørensen
    • 3
  1. 1.Centrum voor Wiskunde en Informatica (CWI)GB AmsterdamThe Netherlands
  2. 2.Computer Science DepartmentOklahoma State UniversityStillwaterUSA
  3. 3.Department of Computer ScienceUniversity of Copenhagen (DIKU)CopenhagenDenmark

Personalised recommendations