skip to main content
article
Open Access

Closure analysis in constraint form

Published:01 January 1995Publication History
Skip Abstract Section

Abstract

Flow analyses of untyped higher-order functional programs have in the past decade been presented by Ayers, Bondorf, Consel, Jones, Heintze, Sestoft, Shivers, Steckler, Wand, and others. The analyses are usually defined as abstract interpretations and are used for rather different tasks such as type recovery, globalization, and binding-time analysis. The analyses all contain a global closure analysis that computes information about higher-order control-flow. Sestoft proved in 1989 and 1991 that closure analysis is correct with respect to call-by-name and call-by-value semantics, but it remained open if correctness holds for arbitrary beta-reduction.

This article answers the question; both closure analysis and others are correct with respect to arbitrary beta-reduction. We also prove a subject-reduction result: closure information is still valid after beta-reduction. The core of our proof technique is to define closure analysis using a constraint system. The constraint system is equivalent to the closure analysis of Bondorf, which in turn is based on Sestoft's.

References

  1. AGESEN, O., PALSBERG, J., AND SCHWARTZBACH, M. I. 1993. Type inference of Self: Analysis of objects with dynamic and multiple inheritance. In Proceedings of ECOOP'93, 7th European Conference on Ob3ect-Omented Programming. Lecture Notes in Computer Science, vol. 707. Springer-Verlag, New York, 247-267. Google ScholarGoogle Scholar
  2. AYERS, A. 1992. Efficient closure analysis with reachability. In Proceedzngs of WSA '92, Analyse Statique. IRISA, Rennes, France, 126-134.Google ScholarGoogle Scholar
  3. BARENDREGT, H. P. 1981. The Lambda Calculus: Its Syntax and Semantics. North-HoIland, Amsterdam.Google ScholarGoogle Scholar
  4. BONDORF, A. 1993. Similix 5.0 Manual. DIKU, University of Copenhagen, Denmark. Included in Similix 5.0 distribution.Google ScholarGoogle Scholar
  5. BONDORF, A. 1991. Automatic autoprojection of higher order recursive equations. Sci. Comput. Program. 17, 1-3 (Dec.), 3-34. Google ScholarGoogle Scholar
  6. BONDORF, A. AND DANVY, 0. 1991. Automatic autoprojection of recursive equations with global variables and abstract data types. Sci. Comput. Program. 16, 151-195. Google ScholarGoogle Scholar
  7. BONDORF, A. AND JOaGENSEN, J. 1993. Efficient analyses for realistic off-line partial evaluation. J. Func~wnal Program. 3, 3, 315-346.Google ScholarGoogle Scholar
  8. CONSEL, C. 1990. Binding time analysis for higher order untyped functional languages. In Proceedings of the A CM Conference on Lisp and Functional Programming. ACM, New York, 264-272. Google ScholarGoogle Scholar
  9. GIANNINI, P. AND ROCCA, S. R. D. 1988. Characterization of typings in polymorphic type discipline. In Proceedings of LICS'88, 3rd Annual Symposium on Logic in Computer Science. IEEE, New York, 61-70.Google ScholarGoogle Scholar
  10. HEINTZE, N. 1994. Set-based analysis of ML programs. In Proceedings of the A CM Conference on LISP and Functional Programming. ACM, New York, 306-317. Google ScholarGoogle Scholar
  11. HEINTZE, N. 1992. Set based program analysis. Ph.D. thesis, CMU-CS-92-201, Carnegie Mellon University~ Pittsburgh, Pa. Google ScholarGoogle Scholar
  12. JONES, N. D. 1981. Flow analysis of lambda expressions. In Proceedings of the 8th Colloquium on Automata, Languages, and Programming. Lecture Notes in Computer Science, vol. 115. Springer-Verlag, New York, 114-128. Google ScholarGoogle Scholar
  13. PALSBERG, J. 1993. Correctness of binding-time analysis. J. Functional Program. 3, 3,347-363.Google ScholarGoogle Scholar
  14. PALSBERG, J. AND SCHWARTZBACH, M. I. 1994a. Binding-time analysis: Abstract interpretation versus type inference. In Proceedzngs of ICCL '9~, 5th IEEE International Conference on Computer Languages. IEEE, New York, 289-298.Google ScholarGoogle Scholar
  15. PALSBERG, J. AND SCHWARTZBACH, M. I. 1994b. Object-Oriented Type Systems. John Wiley and Sons, New York. Google ScholarGoogle Scholar
  16. PALSBERG, J. AND SCHWARTZBACH, ~{. I. 1992a. Safety analysis versus type inference. Inf. Comput. To be published. Google ScholarGoogle Scholar
  17. PALSBERG, J. AND SCHWARTZBACH, M. I. 1992b. Safety analysis versus type inference for partial types. Inf. Process. Left. ~3, 175-180. Google ScholarGoogle Scholar
  18. PALSBERG, J. AND SCHWARTZBACH, M. I. 1991. Object-oriented type inference. In Proceedings of OOPSLA '91, A CM SIGPLAN 6th Annual Conference on Object-Oriented Programming Systems, Languages and Applications. ACM, New York, 146-161. Google ScholarGoogle Scholar
  19. SESTOFT, P. 1991. Analysis and efficient implementation of functional programs. Ph.D. thesis, DIKU, University of Copenhagen.Google ScholarGoogle Scholar
  20. SESTOFT, P. 1989. Replacing function parameters by global variables. M.S. thesis, DIKU, University of Copenhagen.Google ScholarGoogle Scholar
  21. SmvErtS, O. 1991a. Control-flow analysis of higher-order languages. Ph.D. thesis, CMU-CS- 91-145, Carnegie Mellon University, Pittsburgh, Pa.Google ScholarGoogle Scholar
  22. SHIVERS~ O. 1991b. Data-flow analysis and type recovery in Scheme. In Topics in Advanced Language Implementation, P. Lee, Ed. MIT Press, Cambridge, Mass., 47-87.Google ScholarGoogle Scholar
  23. UNGAR, D. AND SMITH, R. B. 1987. SELF: The power of simplicity. In Proceedzngs of OOP- SLA '87, Object-Oriented Programming Systems, Languages and Applications. ACM, New York, 227-241. Also published in Lisp and Symbolic Computation 4(3), Kluwer Acadamic Publishers, June 1991. Google ScholarGoogle Scholar
  24. WAND, M. AND STECKLER, P. 1994. Selective and lightweight closure conversion. In Proceedings of POPL'94, 21st Annual Symposium on Principles of Programming Languages. ACM, New York, 434-445. Google ScholarGoogle Scholar

Index Terms

  1. Closure analysis in constraint form

                  Recommendations

                  Reviews

                  Pierre Jouvelot

                  Closure analysis extends the classical algorithm that computes function call graphs to the realm of higher-order first-class functions. This analysis is important when optimization of such languages is called for, for instance when using partial evaluation or code inlining. Even when limited to untyped functional languages, the literature offers many different ways to tackle this problem. This paper shows that Sestoft's closure analysis, which has already been proven correct with respect to both call-by-name and call-by-value semantics, is valid for arbitrary reduction orders. This proof relies on a constraint-based formulation, related to Bondorf's, of such a closure analysis. Although this paper is easy to read, I would only recommend it to researchers already involved in closure analysis or, at least, the static semantics of functional languages. Indeed, although the result is new, it appears to be a mostly theoretical extension of existing research and, as such, seems of limited practical import to practitioners.

                  Access critical reviews of Computing literature here

                  Become a reviewer for Computing Reviews.

                  Comments

                  Login options

                  Check if you have access through your login credentials or your institution to get full access on this article.

                  Sign in

                  Full Access

                  • Published in

                    cover image ACM Transactions on Programming Languages and Systems
                    ACM Transactions on Programming Languages and Systems  Volume 17, Issue 1
                    Jan. 1995
                    179 pages
                    ISSN:0164-0925
                    EISSN:1558-4593
                    DOI:10.1145/200994
                    Issue’s Table of Contents

                    Copyright © 1995 ACM

                    Publisher

                    Association for Computing Machinery

                    New York, NY, United States

                    Publication History

                    • Published: 1 January 1995
                    Published in toplas Volume 17, Issue 1

                    Permissions

                    Request permissions about this article.

                    Request Permissions

                    Check for updates

                    Qualifiers

                    • article

                  PDF Format

                  View or Download as a PDF file.

                  PDF

                  eReader

                  View online with eReader.

                  eReader