## Syntactic Accidents in Program Analysis: On the Impact of the CPS Transformation (2000)

### Cached

### Download Links

- [www.brics.dk]
- [www.brics.dk]
- [cs.au.dk]
- [www.daimi.au.dk]
- [www.brics.dk]
- [www.brics.dk]
- DBLP

### Other Repositories/Bibliography

Venue: | Journal of Functional Programming |

Citations: | 26 - 9 self |

### BibTeX

@INPROCEEDINGS{Damian00syntacticaccidents,

author = {Daniel Damian and Olivier Danvy},

title = {Syntactic Accidents in Program Analysis: On the Impact of the CPS Transformation},

booktitle = {Journal of Functional Programming},

year = {2000},

pages = {209--220},

publisher = {ACM Press}

}

### Years of Citing Articles

### OpenURL

### Abstract

Our results formalize and confirm a folklore theorem about traditional bindingtime analysis, namely that CPS has a positive effect on binding times. What may be more surprising is that the benefit does not arise from a standard refinement of program analysis, as, for instance, duplicating continuations.

### Citations

762 | Notions of Computation and Monads
- Moggi
- 1991
(Show Context)
Citation Context ...rted in the present paper. Therefore, we use a CPS transformation obtained as follows: 1. call-by-value embedding of the input program into Moggi’s computational metalanguage (Hatcliff & Danvy, 1994; =-=Moggi, 1991-=-); 2. normalization under let.assoc and let.β (as defined in Hatcliff and Danvy’s account of CPS (Hatcliff & Danvy, 1994)); and 3. introduction of continuations. The staged transformation is visualize... |

663 |
Partial evaluation and automatic program generation
- Jones, Gomard, et al.
- 1993
(Show Context)
Citation Context ... of programming style on program analyses. BTA is an exception because its output critically determines the amount of specialization carried out by an offline partial evaluator (Consel & Danvy, 1993; =-=Jones et al., 1993-=-). Therefore, the output of binding-time analyses has been intensively studied, especially in connection with syntactic changes in their input. As a result, “bindingtime improvements” have been develo... |

570 | Principles of Program Analysis
- Nielson, Nielson, et al.
- 1999
(Show Context)
Citation Context ...oving analysis results amount to refining the definition of the analysis by including more information, such as, for instance, context information (Jagannathan & Weeks, 1995; Nielson & Nielson, 1997; =-=Nielson et al., 1999-=-; Shivers, 1991). In contrast, CPS-transforming the source program naturally provides a representation of the context as a syntactic support for refinement to the (unchanged) analysis. In his work on ... |

317 | Control-4ow analysis of higher-order languages
- Shivers
- 1991
(Show Context)
Citation Context ... amount to refining the definition of the analysis by including more information, such as, for instance, context information (Jagannathan & Weeks, 1995; Nielson & Nielson, 1997; Nielson et al., 1999; =-=Shivers, 1991-=-). In contrast, CPS-transforming the source program naturally provides a representation of the context as a syntactic support for refinement to the (unchanged) analysis. In his work on data-flow analy... |

239 | Tutorial notes on partial evaluation
- Consel, Danvy
- 1993
(Show Context)
Citation Context ...known about the effect of programming style on program analyses. BTA is an exception because its output critically determines the amount of specialization carried out by an offline partial evaluator (=-=Consel & Danvy, 1993-=-; Jones et al., 1993). Therefore, the output of binding-time analyses has been intensively studied, especially in connection with syntactic changes in their input. As a result, “bindingtime improvemen... |

226 | A core calculus of dependency
- Abadi, Banerjee, et al.
- 1999
(Show Context)
Citation Context ...al evaluation. This increased precision entailed by CPS also concerns analyses that have been noticed to be structurally similar to BTA, such as security analysis, program slicing, and call tracking (=-=Abadi et al., 1999-=-). These analyses display a similar symptom: for example, we are told that, in practice, users tend to find security analyses too conservative, without quite knowing what to do to obtain more precise ... |

210 | Call-by-name, call-by-value and the λ-calculus - Plotkin - 1976 |

209 | Type-directed partial evaluation
- Danvy
- 1996
(Show Context)
Citation Context ...nts by CPS transformation. The context coherence constraint on the body of a let-expression can be relaxed if one uses a continuation-based program specializer (Bondorf, 1992; Hatcliff & Danvy, 1997; =-=Lawall & Danvy, 1994-=-). The context coherence constraint connecting the conditional branches with the test can be relaxed as well if one allows the same continuation-based specializer to lift the test above the context, e... |

154 | Monotone data flow analysis frameworks
- Kam, Ullman
- 1977
(Show Context)
Citation Context ...nsformation. Sabry and Felleisen also present examples where the analysis of a program is improved after the CPS transformation, reflecting that the constant-propagation analysis is not distributive (=-=Kam & Ullman, 1977-=-; Nielson, 1982). The improvements are attributed to the fact that the constant-propagation analysis is duplicated over conditional branches (and their corresponding continuations). In contrast, the c... |

129 |
Rabbit: A compiler for Scheme
- Steele
- 1978
(Show Context)
Citation Context ...Nielson & Nielson, 1992, section 8.2). Since one of the most effective binding-time improvements is the transformation of source programs into Continuation-Passing Style (CPS) (Consel & Danvy, 1991a; =-=Steele, 1978-=-), people have wondered whether CPS may help program analysis in general. Nielson’s early work on data-flow analysis (Nielson, 1982) suggests so, since it shows that for a non-distributive analysis, a... |

98 | Abstracting Control
- Danvy, Filinski
- 1990
(Show Context)
Citation Context ... static contexts inside definitely dynamic contexts (let expressions and conditionals), thereby providing a binding-time improvement. To this end, the CPS transformation itself is continuation-based (=-=Danvy & Filinski, 1990-=-), which paved the way to continuation-based partial evaluation (Bondorf, 1992; Lawall & Danvy, 1994). Hatcliff and Danvy have characterized the full effect of continuation-based partial evaluation as... |

96 | Rabbit: A compiler for Scheme - Jr - 1978 |

89 | A type system equivalent to flow analysis - Palsberg, O’Keefe - 1995 |

87 | A generic account of continuationpassing styles
- Hatcliff, Danvy
- 1994
(Show Context)
Citation Context ...n-style CPS transformation with administrative reductions (Plotkin, 1975), or one can stage the CPS transformation as normalization to a monadic normal form followed by introduction of continuations (=-=Hatcliff & Danvy, 1994-=-). Palsberg & Wand (2002) use the former method, which can be extended to account for administrative reductions (Damian, 2001; Damian & Danvy, 2001a). We use the latter method here. Elsewhere (Damian,... |

75 | A uni treatment of flow analysis in higher-order languages - Jagannathan, Weeks - 1995 |

74 | Formal Language, Grammar and Set-Constraint-Based Program Analysis by Abstract Interpretation
- Cousot, Cousot
- 1995
(Show Context)
Citation Context ... to other versions, based on different methods such as set-based analysis (Heintze, 1994) and type inference (Palsberg & O’Keefe, 1995); it is also known to be an instance of abstract interpretation (=-=Cousot & Cousot, 1995-=-). For uniformity, we adopt the same definition and notation as in Nielson, Nielson and Hankin’s recent textbook on program analysis (Nielson et al., 1999). 1 1 Nielson, Nielson and Hankin’s CFA is de... |

69 |
Improving binding times without explicit cps-conversion
- Bondorf
- 1992
(Show Context)
Citation Context ...re the source of binding-time improvements by CPS transformation. The context coherence constraint on the body of a let-expression can be relaxed if one uses a continuation-based program specializer (=-=Bondorf, 1992-=-; Hatcliff & Danvy, 1997; Lawall & Danvy, 1994). The context coherence constraint connecting the conditional branches with the test can be relaxed as well if one allows the same continuation-based spe... |

69 | Continuation semantics in typed lambda-calculi
- Meyer, Wand
- 1985
(Show Context)
Citation Context ...S-transformed programs. In that, they implicitly share our concern about syntactic accidents, even though their primary goal was to transfer Wand’s pioneer results on the CPS transformation of types (=-=Meyer & Wand, 1985-=-; Wand, 1985) to the CPS transformation of flow types. Since then, we have shown that least solutions are preserved by administrative reductions of CPS-transformed programs (Damian, 2001; Damian & Dan... |

69 | Infinitary control flow analysis: a collecting semantics for closure analysis
- Nielson, Nielson
- 1997
(Show Context)
Citation Context ... Other approaches to improving analysis results amount to refining the definition of the analysis by including more information, such as, for instance, context information (Jagannathan & Weeks, 1995; =-=Nielson & Nielson, 1997-=-; Nielson et al., 1999; Shivers, 1991). In contrast, CPS-transforming the source program naturally provides a representation of the context as a syntactic support for refinement to the (unchanged) ana... |

60 | P.: A reflection on call-by-value - Sabry, Wadler - 1997 |

59 | For a better support of static data flow - Consel, Danvy - 1991 |

57 | Danvy and Andrzej Filinski. Abstracting control - Olivier |

48 | Static and dynamic semantics processing
- Consel, Danvy
- 1991
(Show Context)
Citation Context ...cs-directed compiling (Nielson & Nielson, 1992, section 8.2). Since one of the most effective binding-time improvements is the transformation of source programs into Continuation-Passing Style (CPS) (=-=Consel & Danvy, 1991-=-a; Steele, 1978), people have wondered whether CPS may help program analysis in general. Nielson’s early work on data-flow analysis (Nielson, 1982) suggests so, since it shows that for a non-distribut... |

46 | and Hanne Riis Nielson. Two-Level Functional Languages, volume 34 of Cambridge Tracts - Nielson - 1992 |

38 | Compilers and staging transformations - Jørring, Scherlis - 1986 |

34 | Linear logic, monads and the lambda calculus
- Benton, Wadler
- 1996
(Show Context)
Citation Context ...metalanguage, enforcing its order of evaluation. For call by value, the encoding into the monadic metalanguage is defined in figure 3. Notice that, in addition to other known call-by-value encodings (=-=Benton & Wadler, 1996-=-; Hatcliff & Danvy, 1994; Sabry & Wadler, 1997), we name the result ofSyntactic accidents in program analysis 873 V[[x]] = unit x V[[n]] = unit n V[[λx.e]] = unit λx.V[[e]] V[[rec f(x).e]] = unit rec... |

34 | A computational formalization for partial evaluation
- Hatcliff, Danvy
- 1997
(Show Context)
Citation Context ...s. These results are essentially confirmed by Palsberg and Wand’s recent CPS transformation of flow information (Palsberg & Wand, 2002). At any rate, except for continuation-based partial evaluation (=-=Hatcliff & Danvy, 1997-=-), there seems to have been no further work about the effect of CPS on the precision of program analysis in general. The situation is therefore that the CPS transformation is known to have an unpredic... |

34 |
A Denotational Framework for Data Flow Analysis
- Nielson
- 1982
(Show Context)
Citation Context ...rograms into Continuation-Passing Style (CPS) (Consel & Danvy, 1991a; Steele, 1978), people have wondered whether CPS may help program analysis in general. Nielson’s early work on data-flow analysis (=-=Nielson, 1982-=-) suggests so, since it shows that for a non-distributive analysis, a continuation semantics yields more precise results than a direct semantics. The CPS transformation is therefore a Good Thing, sinc... |

32 | What not to do when writing an interpreter for specialisation, Partial Evaluation
- Jones
- 1996
(Show Context)
Citation Context ...en developed to milk out extra precision from bindingtime analyses (Jones et al., 1993, Chapter 12), to the point that partial-evaluation users are encouraged to write programs in a particular style (=-=Jones, 1996-=-). That said, improvements are not specific to offline partial evaluation – they are also routine in staging transformations (Jørring & Scherlis, 1986) and in the formal specification of programming l... |

30 |
Call-by-name, call-by-value and the λ -calculus. Theoretical Computer Science 1(2):125–159
- Plotkin
- 1975
(Show Context)
Citation Context ...PS transformation. Several equivalent methods exist for performing a global CPS transformation of a program. For example, one can use aPlotkin-style CPS transformation with administrative reductions (=-=Plotkin, 1975-=-), or one can stage the CPS transformation as normalization to a monadic normal form followed by introduction of continuations (Hatcliff & Danvy, 1994). Palsberg & Wand (2002) use the former method, w... |

25 | A first-order one-pass CPS transformation
- Danvy, Nielsen
- 2003
(Show Context)
Citation Context ...inistrative reductions (Damian, 2001; Damian & Danvy, 2001a). We use the latter method here. Elsewhere (Damian, 2001; Damian & Danvy, 2001b), we have connected Danvy and Nielsen’s CPS transformation (=-=Danvy & Nielsen, 2002-=-) with program analysis. We have constructed the corresponding CPS transformation of control-flow information and confirmed the results reported in the present paper. Therefore, we use a CPS transform... |

22 | Is continuation-passing useful for data flow analysis - Sabry, Felleisen - 1994 |

20 | Available online at http://www.dina.kvl.dk/~sestoft/pebook - Jones, Gomard, et al. - 1993 |

18 | Semantics-directed compilation of non-linear patterns
- Danvy
- 1991
(Show Context)
Citation Context ...ed compiling (Nielson & Nielson, 1992, section 8.2). Since one of the most effective binding-time improvements is the transformation of source programs into Continuation-Passing Style (CPS) (Consel & =-=Danvy, 1991-=-a; Steele, 1978), people have wondered whether CPS may help program analysis in general. Nielson’s early work on data-flow analysis (Nielson, 1982) suggests so, since it shows that for a non-distribut... |

17 | Correctness of binding-time analysis - Palsberg - 1993 |

15 | Partial evaluation is fuller laziness - Holst, Gomard - 1991 |

13 | On Static and Dynamic Control-Flow Information in Program Analysis and Transformation
- Damian
- 2001
(Show Context)
Citation Context ...a monadic normal form followed by introduction of continuations (Hatcliff & Danvy, 1994). Palsberg & Wand (2002) use the former method, which can be extended to account for administrative reductions (=-=Damian, 2001-=-; Damian & Danvy, 2001a). We use the latter method here. Elsewhere (Damian, 2001; Damian & Danvy, 2001b), we have connected Danvy and Nielsen’s CPS transformation (Danvy & Nielsen, 2002) with program ... |

13 | Embedding type structure in semantics - Wand - 1985 |

10 |
Two-Level Functional Languages. Cambridge Univ
- Nielson, Nielson
- 1992
(Show Context)
Citation Context ... to offline partial evaluation – they are also routine in staging transformations (Jørring & Scherlis, 1986) and in the formal specification of programming languages for semantics-directed compiling (=-=Nielson & Nielson, 1992-=-, section 8.2). Since one of the most effective binding-time improvements is the transformation of source programs into Continuation-Passing Style (CPS) (Consel & Danvy, 1991a; Steele, 1978), people h... |

9 | Binding-time analysis: Abstract interpretation versus type inference
- Palsberg, Schwartzbach
- 1994
(Show Context)
Citation Context ... computational metalanguage. The analysis is an adaptation of Hatcliff and Danvy’s BTA for the computational metalanguage (Hatcliff & Danvy, 1997), presented in constraint form (Palsberg, 1993, 1995; =-=Palsberg & Schwartzbach, 1994-=-). The analysis determines binding times of program points and program variables. The binding-time information is used in offline partial evaluation (Consel & Danvy, 1993; Jones et al., 1993; Palsberg... |

8 |
Continuation passing transformation and abstract interpretation
- Muylaert-Filho, Burn
- 1993
(Show Context)
Citation Context ... direct semantics. The CPS transformation is therefore a Good Thing, since for a direct semantics, it gives the effect of a continuation semantics. In the early 1990s, Muylaert-Filho and Burn’s work (=-=Muylaert-Filho & Burn, 1993-=-) was starting to provide further indication of the value of the CPS transformation for abstract interpretation when Sabry and Felleisen entered the scene. In their stunning article “Is continuation-p... |

6 | Cousot and Radhia Cousot. Formal language, grammar and set-constraintbased program analysis by abstract interpretation - Patrick - 1995 |

6 | CPS transformation of flow information
- Palsberg, Wand
- 2002
(Show Context)
Citation Context ...ing continuations, and also that CPS might decrease precision by confusing return points. These results are essentially confirmed by Palsberg and Wand’s recent CPS transformation of flow information (=-=Palsberg & Wand, 2002-=-). At any rate, except for continuation-based partial evaluation (Hatcliff & Danvy, 1997), there seems to have been no further work about the effect of CPS on the precision of program analysis in gene... |

5 | 2001a) CPS Transformation of Flow Information, Part II: Administrative Reductions - Damian, Danvy |

5 | Hanne Riis Nielson. Systematic realisation of control flow analyses for CML - Gasser, Nielson - 1997 |

5 | Syntactic properties of polymorphic subtyping - Henglein - 1996 |

4 | A Simple CPS Transformation of Control-Flow Information - Damian, Danvy - 2001 |

3 | Set-based program analysis of ML programs - Heintze |

3 | CPS transformation of flow information. Unpublished manuscript, available at http://www.cs.purdue.edu/~palsberg/ publications.html - Palsberg, Wand - 2001 |

2 | Comparing flow-based binding-time analyses
- Palsberg
- 1995
(Show Context)
Citation Context ...r Λv We consider a constraint-based, monovariant Control-Flow Analysis (CFA) over programs in Λv .Theconstraint-based version (Gasser et al., 1997; Jagannathan & Weeks, 1995; Nielson & Nielson, 1997; =-=Palsberg, 1995-=-) is known to be equivalent to other versions, based on different methods such as set-based analysis (Heintze, 1994) and type inference (Palsberg & O’Keefe, 1995); it is also known to be an instance o... |