Skip to main content
×
×
Home

Proving the correctness of compiler optimisations based on a global analysis: a study of strictness analysis

  • Geoffrey Burn (a1) and Daniel Le Métayer (a2)
Abstract
Abstract

A substantial amount of work has been devoted to the proof of correctness of various program analyses but much less attention has been paid to the correctness of compiler optimisations based on these analyses. In this paper we tackle the problem in the context of strictness analysis for lazy functional languages. 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.

Copyright
References
Hide All
Appel A. W.(1992) Compiling with Continuations. Cambridge University Press.
Benton P. N.(1992) Strictness Logic and Polymorphic Invariance. In: Nerode A. and Taitslin M., editors, Proc. Int. Symposium on Logical Foundations of Computer Science, pp. 3344. Tver, Russia. Springer-Verlag.
Burn G. L.(1990) Using projection analysis in compiling lazy functional programs. In: Proc. ACM Conference on Lisp and Functional Programming, pp. 227241. ACM Press.
Burn G. L.(1991a) The Evaluation Transformer Model of reduction and its correctness. In: Abramsky S. and Maibaum T. S. E., editors, Proc, TAPSOFT'91, Vol 2, pp. 458482, Brighton, UK. Springer-Verlag.
Burn G. L.(1991b) Lazy Functional Languages: Abstract Interpretation and Compilation. Research Monographs in Parallel and Distributed Computing. Pitman (in association with MIT Press).
Burn G. L., Hankin C. L. and Abramsky S. (1986) Strictness analysis of higher-order functions. Science of Computer Programming, 7(November): 249278.
Cousineau G., Curien P.-L. and Mauny M. (1987) The categorical abstract machine. Science of Computer Programming, 8: 173202.
Cousot P. and Cousot R. (1979) Systematic Design of program analysis frameworks. In: Proc. 6th Ann. Symposium on Principles of Programming Languages, pp. 269282. ACM Press.
Cousot P. and Cousot R. (1992a) Abstract interpretation and application to logic programs. J. Logic Programming, 13 (2–3: 103179.
Cousot P. and Cousot R. (1992b) Abstract interpretation frameworks. J. Logic and Computation, 2(4).
Danvy O. and Filinski A. (1991) Representing Control: a Study of the Cps Transformation. Technical Report TR CIS-91-2, Kansas State University.
Danvy O. and Hatcliff J. (1993) CPS Transformation after strictness analysis. ACM Letters on Programming Languages and Systems, 1(3): 195212.
Danvy O. and Hatcliff J. (1994) A generic account of continuation-passing styles. In: Proc. 21st ACM Sigplan-Sigact Symposium on Principles Of Programming Languages. ACM Press.
Dybjer P. (1985) Using domain algebras to prove the correctness of a compiler. In: Proc. STACS85, pp. 98108. Springer-Verlag.
Finne S. O. and Burn G. L.(1993) Assessing the Evaluation Transformer Model of reduction on the spineless G-machine. In: Proc. Conf. Functional Programming and Computer Architecture, pp. 331340. ACM Press.
Fischer M. J.(1972) Lambda calculus schemata. In: ACM Conf. on Proving Assertions about Programs, pp. 104109, New Mexico. (ACM Sigplan Notices 7(1).)
Fischer M. J.(1993) Lambda calculus schemata. Lisp and Symbolic Computation, 6(3/4): 259287.
Flanagan C., Sabry A., Duba B. F. and Felleisen M. (1993)The essence of compiling with continuations. In: ACM Sigplan '93 Conf. on Programming Language Design and Implementation pp. 237247, Albuquerque, NM. (ACM Sigplan Notices, 28(6).)
Fradet P. (1988) Compilation des langages fonctionnels par transformation de programmes. PhD thesis, Université de Rennes I.
Fradet P. and Le Métayer D. (1991) Compilation of functional languages by program transformation. ACM Trans. Programming Languages and Systems, 13(1): 2151.
Gerhart S. L.(1975) Correctness-preserving program transformations. In: Proc. POPL75, pp. 5466. ACM Press.
Giorgi J. F. and Le Métayer D. (1990) Continuation-based parallel implementation of functional programming languages. In: Proc. ACM Conf. on Lisp and Functional Programming, pp. 227241.
Gunter C. A.(1992) Semantics of Programming Languages: Structures and Techniques. MIT Press.
Hunt L. S.(1991) Abstract Interpretation of Functional Languages: From Theory to Practice. PhD thesis, Department of Computing, Imperial College, University of London.
Jensen T. P. (1992a) Abstract Interpretation in Logical Form. PhD thesis, Imperial College, University of London.
Jensen T. P.(1992b) Disjunctive strictness analysis. In: Proc. 7th Symposium on Logic In Computer Science, pp. 174185, Santa Cruz, CA. IEEE Press.
Kranz D. A. (1988) Orbit: An Optimising Compiler for Scheme. PhD thesis, Department of Computer Science, Yale University. (Report Number YALEU/DCS/RR-632.)
Kranz D., Kelsey R., Rees J. A., Hudak P., Philbin J. and Adams N. I. (1986) Orbit: an optimising compiler for Scheme. In: Proc. SIGPLAN '86 Symposium on Compiler Construction, pp. 219233. ACM Press.
Kuo T.-M. and Mishra P. (1989) Strictness analysis: a new perspective based on type inference. In: Proc. Conf. on Functional Programming Languages and Computer Architecture, pp. 260272, London, UK. ACM Press.
Lester D. R. (1987) The G-machine as a representation of stack semantics. In: Kahn G., editor, Proc. Functional Programming Languages and Computer Architecture Conf., pp. 4659. Springer-Verlag.
Lester D. R. (1988) Combinator Graph Reduction: A Congruence and its Applications. DPhil thesis, Oxford University. (Also published as Technical Monograph PRG-73.)
Leung A. and Mishra P. (1991) Reasoning about simple and exhaustive demand in higherorder languages. In: Hughes J., editor, Proc. Conference on Functional Programming and Computer Architecture, pp. 329351, Cambridge, MA. Springer-Verlag.
Meyer A. and Wand M. (1985) Continuation semantics in the typed lambda-calculus. In: Proc. Logics of Programs, pp. 219224. Springer-Verlag.
Morris F. L. (1973) Advice on structuring compilers and proving them correct. In: Proc. POPL73, pp. 144152ACM Press.
Mosses P. D. (1980) A constructive approach to compiler correctness. In: Proc. ICALP80, pp. 449462. Springer-Verlag.
Muylaert Filho J. and Burn G. L. (1993) Continuation passing transformation and abstract intrepretation. In: Burn G. L., Gay S. J.Ryan M. D., editors, Theory and Formal Methods 1993: Proceedings of the First Imperial College, Department of Computing, Workshop on Theory and Formal Methods. Workshops in Computer Science. Sussex, UK. Springer-Verlag.
Mycroft A. (1981) Abstract Interpretation and Optimising Transformations for Applicative Programs. PhD thesis, University of Edinburgh, Department of Computer Science. (Also published as CST-15-81.)
Nielson F. (1985) Program transformations in a denotational setting. ACM TOPLAS, 7: 359379.
Nielson F. (1988) Strictness analysis and denotational abstract interpretation. Inform. and Comput., 76: 2992.
Nielson F. (1989) Two-level semantics and abstract interpretation. Theoretical Computer Science, 69: 117242.
Nielson F. and Nielson H. R.(1992) The tensor product in Wadler's Analysis of Lists. In: Krieg-Brückner B., editor, Proceedings of ESOP'92, pp. 351370,Rennes, France. Springer-Verlag.
Nielson H. R. and Nielson F. (1988) Two-level Semantics and Code Generation. Theoretical Computer Science, 56: 59133.
Peyton Jones S. L. and Launchbury J. (1991) Unboxed values as first class citizens in a non-strict functional language. In: Hughes J., editor, Proc. Conference on Functional Programming and Computer Architecture, pp. 636666, Cambridge, MA. Springer-Verlag.
Plotkin G. D. (1975) Call-by-name, Call-by-value and the λ-calculus. Theoretical Computer Science, 1: 125159.
Reynolds J. C. (1974) On the relation between direct and continuation semantics. In: Proc. 2nd Colloquium on Automata, Languages and Programming, pp. 141156. Springer-Verlag.
Sabry A. and Felleisen M. (1992) Reasoning about Programs in Continuation-Passing Style. Technical Report TR 92-180, Rice University.
Sabry A. and Felleisen M. (1993) Reasoning about programs in continuation-passing style. Lisp and Symbolic Computation, 6(3/4).
Schmidt D. A. (1980) State transition machines for lambda-calculus expressions. In: Proc. Semantics-Directed Compiler Generation Workshop, pp. 415440. Springer-Verlag.
Steele G. L. Jr (1978) Rabbit: A Compiler for Scheme. Technical report, AI Tech. Rep. 474. MIT, Cambridge, MA.
Thatcher J., Wagner E. G. and Wright J. B. (1981) More advice on structuring compilers and proving them correct. Theoretical Computer Science, 15: 223249.
Wadler P. and Hughes R. J. M. (1987) Projections for strictness analysis. In: Kahn G., editor, Proc. Functional Programming Languages and Computer Architecture Conf., pp. 385407. Springer-Verlag.
Wadler P. L.(1987) Strictness analysis on non-flat domains (by abstract interpretation over finite domains). In: Abramsky S. and Hankin C. L., editors, Abstract Interpretation of Declarative Languages, pp. 266275. Ellis Horwood.
Wand M. (1982) Deriving target code as a representation of continuation semantics. ACM Trans. Programming Languages and Systems, 4(3): 496517.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 4 *
Loading metrics...

Abstract views

Total abstract views: 59 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 24th January 2018. This data will be updated every 24 hours.