A demand-driven set-based analysis

In this paper we present an analysis technique for isolating dead code in higher-order functional programs. First, we formalize what it means for a program fragment to contribute to the value returned by the program. Next, we provide a purely declarative specification of a subset of terms which constitute dead code. This is done by a refinement of the set-based semantics technique, developed by Nevin Heintze, by the introduction of a concept of demand. We then develop a demand-driven set-based analysis to compute dead code specified by the declarative specification. The demand-driven set-based analysis developed in this paper is polynomial time, in the size of the input program.

[1]  B. Goldberg,et al.  Backward Analysis for Higher-Order Functions Using Inverse Images , 1992 .

[2]  Niklas Röjemo,et al.  Lag, drag, void and use—heap profiling and space-efficient compilation revisited , 1996, ICFP '96.

[3]  Carl A. Gunter Semantics of programming languages: structures and techniques , 1993, Choice Reviews Online.

[4]  I. V. Ramakrishnan,et al.  On the power and limitation of strictness analysis based on abstract interpretation , 1991, POPL '91.

[5]  N. Heintze Set Based Analysis of Arithmetic , 1993 .

[6]  Analysis and caching of dependencies , 1996, ICFP '96.

[7]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[8]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[9]  John Launchbury,et al.  A natural semantics for lazy evaluation , 1993, POPL '93.

[10]  Alan Mycroft,et al.  The Theory and Practice of Transforming Call-by-need into Call-by-value , 1980, Symposium on Programming.

[11]  Pascal Fradet,et al.  Collecting more garbage , 1994, LFP '94.

[12]  Robin Milner,et al.  Definition of standard ML , 1990 .

[13]  Colin RuncimanDepartment Lag, Drag, Void and Use { Heap Prooling and Space-eecient Compilation Revisited , 1996 .

[14]  John Hughes,et al.  Compile-time analysis of functional programs , 1990 .

[15]  N. S. Barnett,et al.  Private communication , 1969 .

[16]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

[17]  Nevin Charles Heintze,et al.  Set based program analysis , 1992 .

[18]  John Hughes,et al.  Lazy Memo-functions , 1985, FPCA.

[19]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[20]  Neil D. Jones,et al.  Flow analysis and optimization of LISP-like structures , 1979, POPL.

[21]  Nevin Heintze,et al.  Set-based analysis of ML programs , 1994, LFP '94.

[22]  Matthias Felleisen,et al.  Abstract models of memory management , 1995, FPCA '95.