skip to main content
article
Open access

Closure analysis in constraint form

Published: 01 January 1995 Publication History

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.
[2]
AYERS, A. 1992. Efficient closure analysis with reachability. In Proceedzngs of WSA '92, Analyse Statique. IRISA, Rennes, France, 126-134.
[3]
BARENDREGT, H. P. 1981. The Lambda Calculus: Its Syntax and Semantics. North-HoIland, Amsterdam.
[4]
BONDORF, A. 1993. Similix 5.0 Manual. DIKU, University of Copenhagen, Denmark. Included in Similix 5.0 distribution.
[5]
BONDORF, A. 1991. Automatic autoprojection of higher order recursive equations. Sci. Comput. Program. 17, 1-3 (Dec.), 3-34.
[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.
[7]
BONDORF, A. AND JOaGENSEN, J. 1993. Efficient analyses for realistic off-line partial evaluation. J. Func~wnal Program. 3, 3, 315-346.
[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.
[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.
[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.
[11]
HEINTZE, N. 1992. Set based program analysis. Ph.D. thesis, CMU-CS-92-201, Carnegie Mellon University~ Pittsburgh, Pa.
[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.
[13]
PALSBERG, J. 1993. Correctness of binding-time analysis. J. Functional Program. 3, 3,347-363.
[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.
[15]
PALSBERG, J. AND SCHWARTZBACH, M. I. 1994b. Object-Oriented Type Systems. John Wiley and Sons, New York.
[16]
PALSBERG, J. AND SCHWARTZBACH, ~{. I. 1992a. Safety analysis versus type inference. Inf. Comput. To be published.
[17]
PALSBERG, J. AND SCHWARTZBACH, M. I. 1992b. Safety analysis versus type inference for partial types. Inf. Process. Left. ~3, 175-180.
[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.
[19]
SESTOFT, P. 1991. Analysis and efficient implementation of functional programs. Ph.D. thesis, DIKU, University of Copenhagen.
[20]
SESTOFT, P. 1989. Replacing function parameters by global variables. M.S. thesis, DIKU, University of Copenhagen.
[21]
SmvErtS, O. 1991a. Control-flow analysis of higher-order languages. Ph.D. thesis, CMU-CS- 91-145, Carnegie Mellon University, Pittsburgh, Pa.
[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.
[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.
[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.

Cited By

View all

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

Information & Contributors

Information

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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 January 1995
Published in TOPLAS Volume 17, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. constraints
  2. correctness proof
  3. flow analysis

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)71
  • Downloads (Last 6 weeks)8
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media