## A Demand-Driven Set-Based Analysis (1997)

Venue: | In Proceedings of the ACM Symposium on Principles of Programming Languages |

Citations: | 15 - 1 self |

### BibTeX

@INPROCEEDINGS{Biswas97ademand-driven,

author = {Sandip K. Biswas},

title = {A Demand-Driven Set-Based Analysis},

booktitle = {In Proceedings of the ACM Symposium on Principles of Programming Languages},

year = {1997},

pages = {372--385},

publisher = {ACM Press}

}

### Years of Citing Articles

### OpenURL

### Abstract

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 Introduction Elimination of dead code is a standard optimisation performed by modern compilers for imperative languages. But compilers for higher-order programming languages perform only extremely naive kinds of dead code elimination. The principal benefit associated with the elimination of dead code in fir...

### Citations

1626 | The Definition of Standard ML
- Milner, Tofte, et al.
- 1990
(Show Context)
Citation Context ...the definition of Standard M ::= l : e e ::= x j C(M 1 ; : : : ; Mn ) j x: M j letrec f(x) = M 1 in M 2 j M 1 M 2 j Op(M 1 ; : : : ; Mn ) j case(M 1 ; C(x 1 ; : : : ; xn ) )M 2 ; y )M 3 ) Figure 2 ML =-=[16]-=-, the representation of the closure associated with a recursive function in our operational semantics is distinct from the representation of the closure associated with a non-recursive function. This ... |

634 |
Compiling with Continuations
- Appel
- 1992
(Show Context)
Citation Context ...ng the effect of dead code elimination on the space usage of a program. The static analysis technique developed here cannot plug space leaks stemming from memo/hash tables [12] or order of evaluation =-=[3]-=-. But, as shown by the example in the Introduction, the analysis can prevent creation of certain void cells and can reduce drag. We need to investigate exactly how significant this optimisation can be... |

275 |
Semantics programming languages: Structures and techniques. Foundation of computing
- Gunter
- 1993
(Show Context)
Citation Context ...point of view, a more liberal definition of safety is good enough: if the original program terminates then the transformed program also terminates returning the same answer. Given a natural semantics =-=[7]-=- for a call-by-value evaluation strategy, we are going to introduce a new constants?? and an associated set of rules to formalize the concept of `contribution'. We are then going to develop a refined ... |

210 | Flow analysis and optimization of Lisp-like structures
- Jones, Muchnick
- 1981
(Show Context)
Citation Context ... (z) = t. The functions F 0 ; G 0 map every other element in their domain to f . Explicit set constraints are of the form: z ' x: M , z ' C[l ; (l 1 ; : : : ; l n )]. They form a regular tree grammar =-=[14]-=-. Since we want to relate the solution of the constraint set to the minimum safe set-based environment, we introduce the constraint z ' f??g, for every variable z. This is because by the empty rules a... |

196 | A natural semantics for lazy evaluation
- Launchbury
- 1993
(Show Context)
Citation Context ...f e has no side-effects. We are now going to examine these concepts with respect to higher-order purely functional programs and two distinct operational semantics, call-by-value [19] and call-by-need =-=[4, 15]-=-. Informally, a call-by-need functional program evaluates only those subterms that are needed. Hence, dead code in such programs are subterms which are never evaluated, i.e., of the two distinct kinds... |

193 | Parameter-passing and the lambda calculus
- Crank, Felleisen
- 1991
(Show Context)
Citation Context ...f e has no side-effects. We are now going to examine these concepts with respect to higher-order purely functional programs and two distinct operational semantics, call-by-value [19] and call-by-need =-=[4, 15]-=-. Informally, a call-by-need functional program evaluates only those subterms that are needed. Hence, dead code in such programs are subterms which are never evaluated, i.e., of the two distinct kinds... |

179 |
Call-by-name, call-by-value and the lambda calculus
- Plotkin
- 1975
(Show Context)
Citation Context ... that the evaluation of e has no side-effects. We are now going to examine these concepts with respect to higher-order purely functional programs and two distinct operational semantics, call-by-value =-=[19]-=- and call-by-need [4, 15]. Informally, a call-by-need functional program evaluates only those subterms that are needed. Hence, dead code in such programs are subterms which are never evaluated, i.e., ... |

102 |
Set Based Program Analysis
- Heintze
- 1992
(Show Context)
Citation Context ...ch do not make any contribution to the value returned by a program. One of the simplest analysis techniques for call-by-value languages is a set-based analysis (SBA) technique developed by N. Heintze =-=[11, 10, 9]-=-. The development of a set-based analysis for a given natural semantics proceeds through the following stages [8]: A. Develop a set-based version of the operational semantics. The standard operational... |

93 | Abstract models of memory management
- Morrisett, Felleisen, et al.
- 1995
(Show Context)
Citation Context ...cells are retained in the heap memory, though not actually playing a useful role in the computation, because they form a part of the live graph. Refined garbage collection techniques, as discussed in =-=[17, 6]-=-, which involve more than recursively following live pointers, can ascertain some of these thunks to be garbage. Reliance on such techniques makes a program less robust: a program with no space leaks ... |

78 |
The Theory and Practice of Transforming Call-by-Need into Call-by-Value
- Mycroft
- 1980
(Show Context)
Citation Context ...terpretation has not been successfully applied to perform absence analysis. There is an enormous body of research on abstract interpretation and its application to strictness analysis, dating back to =-=[18]-=-. The results from that area are not applicable to the problem we seek to solve. This is because any computable strictness analysis technique computes a strict subset of the set of subterms which make... |

71 | Analysis and Caching of Dependencies
- Abadi, Lampson, et al.
- 1996
(Show Context)
Citation Context ...develop a refined version of a set-based semantics [11] incorporating a notion of `demand', and an analysis technique to isolate subterms of a program which make no contribution to the evaluation. In =-=[1]-=-, Abadi et al develop the concept of dynamic dependency analysis for -terms. The analysis developed here may be considered the static counterpart of such a dependency analysis. 2 Relation to Existing ... |

66 |
Backwards analysis of functional programs
- Hughes
- 1987
(Show Context)
Citation Context ...after its definition. Live variable analysis is performed by backward analysis on the control-flow graph. Backward analysis does not seem to have a clear counterpart for higher-order programs. Hughes =-=[13] developed a-=- technique for backward analysis of first-order functional programs, being evaluated in a lazy semantics. Given a closed first-order function f , of type �� 1s: : :s�� n ! �� 0 and abstrac... |

54 |
Lazy memo-functions
- Hughes
- 1985
(Show Context)
Citation Context ...ining empirical data regarding the effect of dead code elimination on the space usage of a program. The static analysis technique developed here cannot plug space leaks stemming from memo/hash tables =-=[12]-=- or order of evaluation [3]. But, as shown by the example in the Introduction, the analysis can prevent creation of certain void cells and can reduce drag. We need to investigate exactly how significa... |

45 |
Set Based Analysis of ML Programs
- Heintze
- 1993
(Show Context)
Citation Context ...trategy, we are going to introduce a new constants?? and an associated set of rules to formalize the concept of `contribution'. We are then going to develop a refined version of a set-based semantics =-=[11]-=- incorporating a notion of `demand', and an analysis technique to isolate subterms of a program which make no contribution to the evaluation. In [1], Abadi et al develop the concept of dynamic depende... |

18 | Collecting more garbage
- Fradet
- 1994
(Show Context)
Citation Context ...cells are retained in the heap memory, though not actually playing a useful role in the computation, because they form a part of the live graph. Refined garbage collection techniques, as discussed in =-=[17, 6]-=-, which involve more than recursively following live pointers, can ascertain some of these thunks to be garbage. Reliance on such techniques makes a program less robust: a program with no space leaks ... |

15 | Lag, drag, void and use — heap profiling and space-efficient compilation revisited
- Röjemo, Runciman
- 1996
(Show Context)
Citation Context ...n. Right after the evaluation of the expression (w = 2) the function succ is garbage but cannot be collected as such because x is `live' and contains a pointer to it. According to Rojemo and Runciman =-=[20]-=-, the biography of a typical cell in the heap includes four events: creation, first use, last use and destruction. A heap cell is said to be destroyed when it can be garbage collected. The phases betw... |

10 | Set based analysis and arithmetic
- Heintze
- 1993
(Show Context)
Citation Context ...ch do not make any contribution to the value returned by a program. One of the simplest analysis techniques for call-by-value languages is a set-based analysis (SBA) technique developed by N. Heintze =-=[11, 10, 9]-=-. The development of a set-based analysis for a given natural semantics proceeds through the following stages [8]: A. Develop a set-based version of the operational semantics. The standard operational... |

6 |
On the power and limitation of strictness analysis based on abstract interpretation
- Sekar, Mishra, et al.
- 1991
(Show Context)
Citation Context ...que computes a strict subset of the set of subterms which make a contribution to the computation. A solution to our problem involves a computation of a superset of such subterms. Besides, as shown in =-=[21]-=-, any Mycroftstyle strictness analysis completely ignores bindings of variables to constants. 3 A Purely Functional Higher-Order Language In this section we formally describe the higher-order function... |

4 | Backward Analysis for Higher-Order Functions Using Inverse Images
- Chuang, Goldberg
- 1992
(Show Context)
Citation Context ...ograms because at every function call site, the analysis needs to know the exact function getting called. Computable backward analysis has been extended to include higher-order functional programs in =-=[5]-=-. But [5] reverses abstract interpretation based on Scottclosed /Scott-open powerdomains [7]. The technique of reversing abstract interpretation has not been successfully applied to perform absence an... |

3 |
private communication
- HEINTZE
(Show Context)
Citation Context ...alue languages is a set-based analysis (SBA) technique developed by N. Heintze [11, 10, 9]. The development of a set-based analysis for a given natural semantics proceeds through the following stages =-=[8]-=-: A. Develop a set-based version of the operational semantics. The standard operational semantics uses an environment, E : Var ! Val . The set-based semantics uses an environment, E : Var ! P(Val ), a... |