Hostname: page-component-8448b6f56d-jr42d Total loading time: 0 Render date: 2024-04-18T16:39:34.749Z Has data issue: false hasContentIssue false

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

Published online by Cambridge University Press:  07 November 2008

Geoffrey Burn
Affiliation:
Department of Computing, Imperial College of Science, Technology and Medicine, 180 Queen's Gate, London SW7 2BZ, UK
Daniel Le Métayer
Affiliation:
Irisa/Inria, Campus de Beaulieu, 35042 Rennes Cedex, France
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Articles
Copyright
Copyright © Cambridge University Press 1996

References

Appel, A. W.(1992) Compiling with Continuations. Cambridge University Press.Google Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Burn, G. L.(1991b) Lazy Functional Languages: Abstract Interpretation and Compilation. Research Monographs in Parallel and Distributed Computing. Pitman (in association with MIT Press).Google Scholar
Burn, G. L., Hankin, C. L. and Abramsky, S. (1986) Strictness analysis of higher-order functions. Science of Computer Programming, 7(November): 249278.CrossRefGoogle Scholar
Cousineau, G., Curien, P.-L. and Mauny, M. (1987) The categorical abstract machine. Science of Computer Programming, 8: 173202.CrossRefGoogle Scholar
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.Google Scholar
Cousot, P. and Cousot, R. (1992a) Abstract interpretation and application to logic programs. J. Logic Programming, 13 (2–3: 103179.CrossRefGoogle Scholar
Cousot, P. and Cousot, R. (1992b) Abstract interpretation frameworks. J. Logic and Computation, 2(4).CrossRefGoogle Scholar
Danvy, O. and Filinski, A. (1991) Representing Control: a Study of the Cps Transformation. Technical Report TR CIS-91-2, Kansas State University.Google Scholar
Danvy, O. and Hatcliff, J. (1993) CPS Transformation after strictness analysis. ACM Letters on Programming Languages and Systems, 1(3): 195212.CrossRefGoogle Scholar
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.Google Scholar
Dybjer, P. (1985) Using domain algebras to prove the correctness of a compiler. In: Proc. STACS85, pp. 98108. Springer-Verlag.Google Scholar
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.Google Scholar
Fischer, M. J.(1972) Lambda calculus schemata. In: ACM Conf. on Proving Assertions about Programs, pp. 104109, New Mexico. (ACM Sigplan Notices 7(1).)CrossRefGoogle Scholar
Fischer, M. J.(1993) Lambda calculus schemata. Lisp and Symbolic Computation, 6(3/4): 259287.CrossRefGoogle Scholar
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).)CrossRefGoogle Scholar
Fradet, P. (1988) Compilation des langages fonctionnels par transformation de programmes. PhD thesis, Université de Rennes I.Google Scholar
Fradet, P. and Le Métayer, D. (1991) Compilation of functional languages by program transformation. ACM Trans. Programming Languages and Systems, 13(1): 2151.CrossRefGoogle Scholar
Gerhart, S. L.(1975) Correctness-preserving program transformations. In: Proc. POPL75, pp. 5466. ACM Press.Google Scholar
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.CrossRefGoogle Scholar
Gunter, C. A.(1992) Semantics of Programming Languages: Structures and Techniques. MIT Press.Google Scholar
Hunt, L. S.(1991) Abstract Interpretation of Functional Languages: From Theory to Practice. PhD thesis, Department of Computing, Imperial College, University of London.Google Scholar
Jensen, T. P. (1992a) Abstract Interpretation in Logical Form. PhD thesis, Imperial College, University of London.Google Scholar
Jensen, T. P.(1992b) Disjunctive strictness analysis. In: Proc. 7th Symposium on Logic In Computer Science, pp. 174185, Santa Cruz, CA. IEEE Press.Google Scholar
Kranz, D. A. (1988) Orbit: An Optimising Compiler for Scheme. PhD thesis, Department of Computer Science, Yale University. (Report Number YALEU/DCS/RR-632.)Google Scholar
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.Google Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
Lester, D. R. (1988) Combinator Graph Reduction: A Congruence and its Applications. DPhil thesis, Oxford University. (Also published as Technical Monograph PRG-73.)Google Scholar
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.Google Scholar
Meyer, A. and Wand, M. (1985) Continuation semantics in the typed lambda-calculus. In: Proc. Logics of Programs, pp. 219224. Springer-Verlag.CrossRefGoogle Scholar
Morris, F. L. (1973) Advice on structuring compilers and proving them correct. In: Proc. POPL73, pp. 144152ACM Press.Google Scholar
Mosses, P. D. (1980) A constructive approach to compiler correctness. In: Proc. ICALP80, pp. 449462. Springer-Verlag.Google Scholar
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.Google Scholar
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.)Google Scholar
Nielson, F. (1985) Program transformations in a denotational setting. ACM TOPLAS, 7: 359379.CrossRefGoogle Scholar
Nielson, F. (1988) Strictness analysis and denotational abstract interpretation. Inform. and Comput., 76: 2992.CrossRefGoogle Scholar
Nielson, F. (1989) Two-level semantics and abstract interpretation. Theoretical Computer Science, 69: 117242.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Nielson, H. R. and Nielson, F. (1988) Two-level Semantics and Code Generation. Theoretical Computer Science, 56: 59133.CrossRefGoogle Scholar
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.Google Scholar
Plotkin, G. D. (1975) Call-by-name, Call-by-value and the λ-calculus. Theoretical Computer Science, 1: 125159.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Sabry, A. and Felleisen, M. (1992) Reasoning about Programs in Continuation-Passing Style. Technical Report TR 92-180, Rice University.Google Scholar
Sabry, A. and Felleisen, M. (1993) Reasoning about programs in continuation-passing style. Lisp and Symbolic Computation, 6(3/4).CrossRefGoogle Scholar
Schmidt, D. A. (1980) State transition machines for lambda-calculus expressions. In: Proc. Semantics-Directed Compiler Generation Workshop, pp. 415440. Springer-Verlag.CrossRefGoogle Scholar
Steele, G. L. Jr (1978) Rabbit: A Compiler for Scheme. Technical report, AI Tech. Rep. 474. MIT, Cambridge, MA.Google Scholar
Thatcher, J., Wagner, E. G. and Wright, J. B. (1981) More advice on structuring compilers and proving them correct. Theoretical Computer Science, 15: 223249.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
Wand, M. (1982) Deriving target code as a representation of continuation semantics. ACM Trans. Programming Languages and Systems, 4(3): 496517.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.