Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

Set-based analysis of ML programs

Published: 01 July 1994 Publication History

Abstract

Reasoning about program variables as sets of “values” leads to a simple, accurate and intuitively appealing notion of program approximation. This paper presents approach for the compile-time analysis of ML programs. To develop the core ideas of the analysis, we consider a simple untyped call-by-value functional language. Starting with an operational semantics for the language, we develop an approximate “set-based” operational semantics, which formalizes the intuition of treating program variables as sets. The key result of the paper is an O(n3) algorithm for computing the set based approximation of a program. We then extend this analysis in a natural way to deal with arrays, arithmetic, exceptions and continuations. We briefly describe our experience with an implementation of this analysis for ML programs.

References

[1]
A. Aiken and E. Wimmers, "Solving Systems of Set Constraints", Proc. 7tn IEEE Syrup. on Logic in Com. purer Science, Santa Cruz, pp. 329-340, June 1992.
[2]
A. Aiken and E. Wimmers, "Type Inclusion and Type Inference", Proc. 6*n A CM Con/. on Functional Programming and Computer Architecture, Copenhagen, pp. 31-41, June 1993.
[3]
A. Aiken, E. Wimmers and T.K. Lakshman, "Soft Typing with Conditional Types" Proc. 21*h ACM Syrup. on Principles o/Programming Languages, Portland, OR, pp. 163-173, January 1994.
[4]
A. Appel, "Compiling with Continuations", Cambridge University Press, 1992.
[5]
L. Bachmair, H. Ganzinger and U. Waldmann, "Set Constraints are the Monadic Class", Technical Report MPI-I-92-240, Max-Planck-institute for Computer Science, December 1992.
[6]
E. Biagioni, R. Harper, P. Lee, and B. Milnes, "Signatures for a network protocol stack: A systems application of Standard ML", Proc. 199~i ACM Conf. on Lisp and Functional Programming, Orlando, Florida, June 1994, to appear.
[7]
R. Cartwright and M. Fagan, "Soft Typing", Proc. 1991 A CM Conj. on Programming Language Design and Implementation, Toronto, pp. 278-292, June 1991.
[8]
C. Consel and O. Danvy, "Tutorial Notes on Partial Evaluation", Proc. 20tn ACM Syrup. on Principle8 of Programming Languages, Charleston, pp. 493-501, January 1993.
[9]
P. Cousot and R. Cousot, "Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints", Proc. 4*h A CM Syrup. on Principles of Programming Languages, Los Angeles, pp. 238-252, January 1977.
[10]
N. Heintze, "Set-Based Program Analysis", Ph.D. thesis, School of Computer Science, Carnegie Mellon University, October 1992.
[11]
N. Heintze, "Set-Based Program Analysis and Arithmetic'', Technical Report, School of Computer Science, Carnegie Mellon University, December 1993.
[12]
N. Heintze and J. Jaffar, "A Finite Presentation Theorem for Approximating Logic Programs", Proc. 17tn A CM Syrup. on Principles o} Programming Languages, San Francisco, pp. 197-209, January 1990. (A full version of this paper appears as IBM Technical Report RC 16089 (~ 71415), 66 pp., August 1990.)
[13]
N. Heintze and J. Jaffar, "A Decision Procedure for a Class of Herbrand Set Constraints", Proc. 5th IEEE Syrup. on Logsc, n Computer Science, Philadelphia, pp. 42-51, June 1990. (A full version of this paper appears as Carnegie Mellon University Technical Report CMU-CS-91-110, 42 pp., February 1991.)
[14]
N. Heintze and J. Jaffar, "An Engine for Logic Program Analysis", Proc. 7th IEEE Syrup. on Logic in Computer Science, Santa Cruz, pp. 318-328, June 1992.
[15]
F. Henglein, "Efficient Type Inference for Higher- Order Binding-Time Analysis", Proceedings 5*n A CM- FPCA, Cambridge MA, LNCS 523, pp. 448-472, August 1991.
[16]
T. Jensen and T. Mogensen, "A Backwards Analysis for Compile-Time Garbage Collection", Proc. 3ra European Syrup. on Programming, Copenhagen, LNCS 432, pp. 227-239, May 1990.
[17]
N. Jones, "Flow Analysis of Lazy Higher-Order Functional Programs", in Abstract Interpretation of Declarative Languages, S. Abramsky and C. Hankln (Eds.), Ellis Horwood, 1987.
[18]
N. Jones, C. Gomard and P. Sestoft, "Partial Evaluation and Automatic Program Generation", "Prentice- Hall International", 1993.
[19]
N. Jones and S. Muchnick, "Flow Analysis and Optimization of LISP-like Structures", Proc. 6th A CM Syrup. on Principles of Programming Languages, San Antonio, pp. 244-256, January 1979.
[20]
N. Jones and S. Muchnick, "Complexity of Flow Analysis, Inductive Assertion Synthesis, and a Language due to Dijkstra", Proc. 21~t IEEE-FOCS, Syracuse, pp. 185-190, October 1980. (Also in, Program Flow Analttsis: Theory and Applications, N. Jones and S. Muchnick (Eds.), Prentice-Hall, 1981.)
[21]
K. Malmkjeer, N. Heintze and O. Danvy, "ML Partial Evaluation using Set-Based Analysis", submitted for publication.
[22]
R. Milner, M. Torte and R. Harper, "The Definition of Standard ML', MIT Press, 1990.
[23]
T. Mogensen, ~Separating Binding Times in Language Specifications", Proc. Functional Programming and Computer Architecture, London, ACM, pp. 12-25, September 1989.
[24]
F. Nielson and H. Nielson, "Two-Level Functional Languages", Cambridge University Press, Vol 34, Cambridge Tracts in Theoretical Computer Science, 1992.
[25]
O. Shivers, "Control Flow AnMysis in Scheme", Proc. 1988 A CM Conf. on Programming Language Design and Implementation, Atlanta, pp. 164-174, June 1988.
[26]
J. Palsberg, Private Communication, November 1993.
[27]
J. Palsberg and M. Schwartzbach, "Safety Analysis versus Type Inference for Partial Types" Informstion Processing Letters, Vol 43, pp. 175-180, North- Holland, September 1992.
[28]
J. Palsberg and M. Schwartzbach, "Object-Oriented Type Systems", John Wiley & Sons, to appear, 1993.
[29]
J. Reynolds, "Automatic Computation of Data Set Definitions", In/ormation Processing 68, pp. 456-461, North-Holland, 1969.
[30]
A. Wright and R. Cartwright, "A Practical Soft Type System for Scheme", Proc. 199j A CM Conf. on Lisp and Functional Programming, Orlando, Florida, June 1994, to appear.

Cited By

View all
  • (2021)Trace-based control-flow analysisProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454057(482-496)Online publication date: 19-Jun-2021
  • (2020)Stable relations and abstract interpretation of higher-order programsProceedings of the ACM on Programming Languages10.1145/34090014:ICFP(1-30)Online publication date: 3-Aug-2020
  • (2016)Type safety analysis for DartProceedings of the 12th Symposium on Dynamic Languages10.1145/2989225.2989226(1-12)Online publication date: 1-Nov-2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 July 1994
Published in SIGPLAN-LISPPOINTERS Volume VII, Issue 3

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)74
  • Downloads (Last 6 weeks)19
Reflects downloads up to 15 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2021)Trace-based control-flow analysisProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454057(482-496)Online publication date: 19-Jun-2021
  • (2020)Stable relations and abstract interpretation of higher-order programsProceedings of the ACM on Programming Languages10.1145/34090014:ICFP(1-30)Online publication date: 3-Aug-2020
  • (2016)Type safety analysis for DartProceedings of the 12th Symposium on Dynamic Languages10.1145/2989225.2989226(1-12)Online publication date: 1-Nov-2016
  • (2014)Constructing Call Graphs of Scala ProgramsProceedings of the 28th European Conference on ECOOP 2014 --- Object-Oriented Programming - Volume 858610.1007/978-3-662-44202-9_3(54-79)Online publication date: 1-Aug-2014
  • (2013)A Type- and Control-Flow Analysis for System FImplementation and Application of Functional Languages10.1007/978-3-642-41582-1_8(122-139)Online publication date: 16-Nov-2013
  • (2012)Control-flow analysis of function calls and returns by abstract interpretationInformation and Computation10.1016/j.ic.2011.11.005211(49-76)Online publication date: 1-Feb-2012
  • (2011)Extending H1-clauses with disequalitiesInformation Processing Letters10.1016/j.ipl.2011.07.011111:20(1007-1013)Online publication date: 1-Oct-2011
  • (2010)Optimierung funktionaler ProgrammeÜbersetzerbau10.1007/978-3-642-03331-5_3(139-169)Online publication date: 2010
  • (2009)Points-to analysis for JavaScriptProceedings of the 2009 ACM symposium on Applied Computing10.1145/1529282.1529711(1930-1937)Online publication date: 8-Mar-2009
  • (2006)Dynamic state restoration using versioning exceptionsHigher-Order and Symbolic Computation10.1007/s10990-006-8610-819:1(101-124)Online publication date: 1-Mar-2006
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media