Syntactic accidents in program analysis: On the impact of the CPS transformation

Citation
D. Damian et O. Danvy, Syntactic accidents in program analysis: On the impact of the CPS transformation, ACM SIGPL N, 35(9), 2000, pp. 209-220
Citations number
34
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
35
Issue
9
Year of publication
2000
Pages
209 - 220
Database
ISI
SICI code
1523-2867(200009)35:9<209:SAIPAO>2.0.ZU;2-Q
Abstract
We show that a non-duplicating CPS transformation has no effect on control- flow analysis and that it has a positive effect on binding-time analysis: a monovariant control-how analysis yields equivalent results on a direct-sty le program and on its CPS counterpart, and a monovariant binding-time analy sis yields more precise results on a CPS program than on its direct-style c ounterpart. Our proof technique amounts to constructing the continuation-pa ssing style (CPS) counterpart of flow information and of binding times. Our results confirm a folklore theorem about binding-time analysis, namely that CPS has a positive effect on binding times. What may be more surprisin g is that this benefit holds even if contexts or continuations are not dupl icated. The present study is symptomatic of an unsettling property of program analy ses: their quality is unpredictably vulnerable to syntactic accidents in so urce programs, i.e., to the way these programs are written. More reliable p rogram analyses require a better understanding of the effect of syntactic c hange.