Skip to main content

Proving the correctness of compiler optimisations based on strictness analysis

  • Conference paper
  • First Online:
Progamming Language Implementation and Logic Programming (PLILP 1993)

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

Abstract

We show that compiler optimisations based on strictness analysis can be expressed formally in the functional framework using continuations. This formal presentation has two benefits: it allows us to give a rigorous correctness proof of the optimised compiler; and it exposes the various optimisations made possible by a strictness analysis.

The first author was partially funded by ESPRIT BRA 3124 (Semantique) and SERC grant GR/H 17381 (Using the Evaluation Transformer Model to make Lazy Functional Languages more Efficient). The second author was on leave from INRIA/IRISA and was partially funded by the SERC Visiting Fellowship GR/H 19330.

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. A. W. Appel. Compiling with Continuations. Cambridge University Press, 1992.

    Google Scholar 

  2. P.N. Benton. Strictness logic and polymorphic invariance. In A. Nerode and M. Taitslin, editors, Proceedings of the International Symposium on Logical Foundations of Computer Science, pages 33–44, Tver, Russia, 20–24 July 1992. Springer-Verlag LNCS620.

    Google Scholar 

  3. G.L. Burn, C.L. Hankin, and S. Abramsky. Strictness analysis for higherorder functions. Science of Computer Programming, 7:249–278, November 1986.

    Google Scholar 

  4. G.L. Burn. Using projection analysis in compiling lazy functional programs. In Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pages 227–241, Nice, France, 27–29 June 1990.

    Google Scholar 

  5. G.L. Burn. The evaluation transformer model of reduction and its correctness. In S. Abramsky and T.S.E. Maibaum, editors, Proceedings of TAPSOFT'91, Volume 2, pages 458–482, Brighton, UK, 8–12 April 1991. Springer-Verlag LNCS 494.

    Google Scholar 

  6. G.L. Burn. Lazy Functional Languages: Abstract Interpretation and Compilation. Research Monographs in Parallel and Distributed Computing. Pitman in association with MIT Press, 1991. 238pp.

    Google Scholar 

  7. P. Cousot and R. Cousot. Systematic design of program analysis frameworks. In Proceedings of the Sixth Annual Symposium on Principles of Programming Languages, pages 269–282. ACM, January 1979.

    Google Scholar 

  8. P. Cousot and R. Cousot. Abstract interpretation and application to logic programs. Journal of Logic Programming, 13(2–3):103–179, 1992.

    Google Scholar 

  9. P. Cousot and R. Cousot. Abstract interpretation frameworks. Journal of Logic and Computation, 2(4), 1992. Special Issue on Abstract Interpretation.

    Google Scholar 

  10. G. Cousineau, P.-L. Curien, and M. Mauny. The categorical abstract machine. Science of Computer Programming, 8:173–202, 1987.

    Google Scholar 

  11. O. Danvy and A. Filinski. Representing control: a study of the cps transformation. Technical Report TR CIS-91-2, Kansas State University, 1991.

    Google Scholar 

  12. O. Danvy and J. Hatcliff. CPS transformation after strictness analysis. Technical report, Kansas State University, 1992.

    Google Scholar 

  13. P. Dybjer. Using domain algebras to prove the correctness of a compiler. In Proceedings of STACS85, pages 98–108. Springer-Verlag LNCS182, 1985.

    Google Scholar 

  14. M. J. Fischer. Lambda calculus schemata. In ACM Conference on Proving Assertions about Programs, pages 104–109, New Mexico, January 1972. ACM Sigplan Notices 7(1).

    Google Scholar 

  15. P. Fradet and D Le Métayer. Compilation of functional languages by program transformation. ACM Transactions on Programming Languages and Systems, 13(1):21–51, January 1991.

    Google Scholar 

  16. S.L. Gerhart. Correctness-preserving program transformations. In Proceedings of POPL75, pages 54–66. ACM, 1975.

    Google Scholar 

  17. C.A. Gunter. Semantics of Programming Languages: Structures and Techniques. Foundations of Computing. MIT Press, 1992.

    Google Scholar 

  18. L.S. Hunt. Abstract Interpretation of Functional Languages: From Theory to Practice. PhD thesis, Department of Computing, Imperial College of Science, Technology and Medicine, University of London, 1991.

    Google Scholar 

  19. T. P. Jensen. Abstract Interpretation in Logical Form. PhD thesis, Imperial College, University of London, November 1992.

    Google Scholar 

  20. T.P. Jensen. Disjunctive strictness analysis. In Proceedings of the 7th Symposium on Logic In Computer Science, pages 174–185, Santa Cruz, California, 22–25 June 1992. Computer Society Press of the IEEE.

    Google Scholar 

  21. S.L. Peyton Jones and J. Launchbury. Unboxed values as first class citizens in a non-strict functional language. In J. Hughes, editor, Proceedings of the Conference on Functional Programming and Computer Architecture, pages 636–666, Cambridge, Massachussets, USA, 26–28 August 1991. Springer-Verlag LNCS523.

    Google Scholar 

  22. D.A. Kranz, R. Kelsey, J.A. Rees, P. Hudak, J. Philbin, and N.I. Adams. Orbit: An optimising compiler for scheme. In Proceedings of the SIGPLAN '86 Symposium on Compiler Construction, pages 219–233. ACM, June 1986.

    Google Scholar 

  23. Tsung-Min Kuo and P. Mishra. Strictness analysis: a new perspective based on type inference. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture, pages 260–272, London, 11–13 September 1989. ACM.

    Google Scholar 

  24. D.A. Kranz. Orbit: An Optimising Compiler for Scheme. PhD thesis, Department of Computer Science, Yale University, February 1988. Report Number YALEU/DCS/RR-632.

    Google Scholar 

  25. D. Lester. The G-machine as a representation of stack semantics. In G. Kahn, editor, Proceedings of the Functional Programming Languages and Computer Architecture Conference, pages 46–59. Springer-Verlag LNCS 274, September 1987.

    Google Scholar 

  26. D.R. Lester. Combinator Graph Reduction: A Congruence and its Applications. DPhil thesis, Oxford University, 1988. Also published as Technical Monograph PRG-73.

    Google Scholar 

  27. A. Leung and P. Mishra. Reasoning about simple and exhaustive demand in higher-order languages. In J. Hughes, editor, Proceedings of the Conference on Functional Programming and Computer Architecture, pages 329–351, Cambridge, Massachussets, USA, 26–28 August 1991. Springer-Verlag LNCS523.

    Google Scholar 

  28. F.L. Morris. Advice on structuring compilers and proving them correct. In Proceedings of POPL73, pages 144–152. ACM, 1973.

    Google Scholar 

  29. P.D. Mosses. A constructive approach to compiler correctness. In Proceedings of ICALP80, pages 449–462. Springer-Verlag LNCS85, 1980.

    Google Scholar 

  30. A. Meyer and M. Wand. Continuation semantics in the typed lambdacalculus. In Proceedings of Logics of Programs, pages 219–224, Berlin, 1985. Springer-Verlag LNCS 193.

    Google Scholar 

  31. A. Mycroft. Abstract Interpretation and Optimising Transformations for Applicative Programs. PhD thesis, University of Edinburgh, Department of Computer Science, December 1981. Also published as CST-15-81.

    Google Scholar 

  32. F. Nielson. Program transformations in a denotational setting. ACM TOPLAS, 7:359–379, 1985.

    Google Scholar 

  33. F. Nielson. Strictness analysis and denotational abstract interpretation. Inform. and Comput., 76:29–92, 1988.

    Google Scholar 

  34. F. Nielson. Two-level semantics and abstract interpretation. Theoretical Computer Science, 69:117–242, 1989.

    Google Scholar 

  35. H Riis Nielson and F. Nielson. Two-level semantics and code generation. TCS, 56:59–133, 1988.

    Google Scholar 

  36. H. Nielson and F. Nielson. Context information for lazy code generation. In Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pages 251–263, Nice, France, 27–29 June 1990.

    Google Scholar 

  37. F. Nielson and H. Riis Nielson. The tensor product in Wadler's analysis of lists. In B. Krieg-Brückner, editor, Proceedings of ESOP'92, pages 351–370, Rennes, France, February 1992. Springer-Verlag LNCS582. Preliminary version of Chapter 8 of Two-level Functional Languages, CUP, 1992.

    Google Scholar 

  38. G.D. Plotkin. Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science, 1:125–159, 1975.

    Article  Google Scholar 

  39. J.C. Reynolds. On the relation between direct and continuation semantics. In Proceedings of the Second Colloquium on Automata, Languages and Programming, pages 141–156, Saarbrucken, 1974. Springer-Verlag.

    Google Scholar 

  40. D.A. Schmidt. State transition machines for lambda-calculus expressions. In Proceedings of the Semantics-Directed Compiler Generation Workshop, pages 415–440. Springer-Verlag LNCS94, 1980.

    Google Scholar 

  41. A. Sabry and M. Felleisen. Reasoning about programs in continuationpassing style. Technical Report TR 92-180, Rice University, 1992.

    Google Scholar 

  42. G.L. Steele Jr. Rabbit: A compiler for scheme. Technical Report AI Tech. Rep. 474, MIT, Cambridge, Mass., 1978.

    Google Scholar 

  43. J.W. Thatcher, E.G Wagner, and J.B. Wright. More advice on structuring compilers and proving them correct. Theoretical Computer Science, 15:223–249, 1981.

    Google Scholar 

  44. P.L. Wadler. Strictness analysis on non-flat domains (by abstract interpretation over finite domains). In S. Abramsky and C.L. Hankin, editors, Abstract Interpretation of Declarative Languages, chapter 12, pages 266–275. Ellis Horwood Ltd., Chichester, West Sussex, England, 1987.

    Google Scholar 

  45. M. Wand. Deriving target code as a representation of continuation semantics. ACM Transactions on Programming Languages and Systems, 4(3):496–517, July 1982.

    Google Scholar 

  46. P. Wadler and R. J. M. Hughes. Projections for strictness analysis. In G. Kahn, editor, Proceedings of the Functional Programming Languages and Computer Architecture Conference, pages 385–407. Springer-Verlag LNCS 274, September 1987.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Maurice Bruynooghe Jaan Penjam

Rights and permissions

Reprints and permissions

Copyright information

© 1993 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Burn, G., Le Métayer, D. (1993). Proving the correctness of compiler optimisations based on strictness analysis. In: Bruynooghe, M., Penjam, J. (eds) Progamming Language Implementation and Logic Programming. PLILP 1993. Lecture Notes in Computer Science, vol 714. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57186-8_90

Download citation

  • DOI: https://doi.org/10.1007/3-540-57186-8_90

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-57186-5

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics