Abstract
In a functional language, the dominant control-flow mechanism is function call and return. Most higher-order flow analyses, including k-CFA, do not handle call and return well: they remember only a bounded number of pending calls because they approximate programs with control-flow graphs. Call/return mismatch introduces precision-degrading spurious control-flow paths and increases the analysis time.
We describe CFA2, the first flow analysis with precise call/return matching in the presence of higher-order functions and tail calls. We formulate CFA2 as an abstract interpretation of programs in continuation passing style and describe a sound and complete summarization algorithm for our abstract semantics. A preliminary evaluation shows that CFA2 gives more accurate data-flow information than 0CFA and 1CFA.
Keywords
- Abstract Interpretation
- Call Site
- Abstract Semantic
- Path Edge
- Local Semantic
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Download conference paper PDF
References
Shivers, O.: Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie-Mellon University (1991)
Sharir, M., Pnueli, A.: Two Approaches to Interprocedural Data Flow Analysis. In: Program Flow Analysis, Theory and Application. Prentice Hall, Englewood Cliffs (1981)
Reps, T.W., Horwitz, S., Sagiv, S.: Precise Interprocedural Dataflow Analysis via Graph Reachability. In: Principles of Programming Languages, pp. 49–61 (1995)
Chaudhuri, S.: Subcubic Algorithms for Recursive State Machines. In: Principles of Programming Languages, pp. 159–169 (2008)
Alur, R., Benedikt, M., Etessami, K., Godefroid, P., Reps, T.W., Yannakakis, M.: Analysis of Recursive State Machines. Transactions on Programming Languages and Systems 27(4), 786–818 (2005)
Schwoon, S.: Model-Checking Pushdown Systems. PhD thesis, Technische Universität München (2002)
Rehof, J., Fähndrich, M.: Type-Based Flow Analysis: From Polymorphic Subtyping to CFL-Reachability. In: Principles of Programming Languages, pp. 54–66 (2001)
Might, M., Shivers, O.: Improving Flow Analyses via ΓCFA: Abstract Garbage Collection and Counting. In: International Conference on Functional Programming, pp. 13–25 (2006)
Wright, A., Jagannathan, S.: Polymorphic Splitting: An Effective Polyvariant Flow Analysis. Trans. on Programming Languages and Systems 20(1), 166–207 (1998)
Van Horn, D., Mairson, H.G.: Deciding k-CFA is complete for EXPTIME. In: International Conference on Functional Programming, pp. 275–282 (2008)
Clinger, W.D., Hansen, L.T.: Lambda, the Ultimate Label or a Simple Optimizing Compiler for Scheme. In: LISP and Functional Programming, pp. 128–139 (1994)
Might, M.: Environment Analysis of Higher-Order Languages. PhD thesis, Georgia Institute of Technology (2007)
Steele, G.L.: Rabbit: A Compiler for Scheme. Master’s thesis, MIT (1978)
Kranz, D.: ORBIT: An Optimizing Compiler for Scheme. PhD thesis, Yale University (1988)
Sabry, A., Felleisen, M.: Reasoning About Programs in Continuation-Passing Style. In: LISP and Functional Programming, pp. 288–298 (1992)
Shivers, O.: Higher-Order Control-Flow Analysis in Retrospect: Lessons Learned, Lessons Abandoned. In: Best of PLDI, pp. 257–269 (2004)
Vardoulakis, D., Shivers, O.: CFA2: a Context-Free Approach to Control-Flow Analysis. Technical Report NU-CCIS-10-01, Northeastern University (2010)
Yannakakis, M.: Graph-Theoretic Methods in Database Theory. In: Principles of Database Systems, pp. 230–242 (1990)
Melski, D., Reps, T.: Interconvertibility of a Class of Set Constraints and Context-Free-Language Reachability. Theoretical Comp. Sci. 248(1-2), 29–98 (2000)
Heintze, N.: Set-based program analysis. PhD thesis, Carnegie-Mellon Univ. (1992)
Sridharan, M., Bodík, R.: Refinement-based context-sensitive points-to analysis for java. In: Programming Language Design and Implementation, pp. 387–400 (2006)
Hind, M.: Pointer analysis: haven’t we solved this problem yet? In: Program Analysis For Software Tools and Engineering, pp. 54–61 (2001)
Debray, S.K., Proebsting, T.A.: Interprocedural Control Flow Analysis of First-Order Programs with Tail-Call Optimization. Transactions on Programming Languages and Systems 19(4), 568–585 (1997)
Midtgaard, J., Jensen, T.: Control-flow analysis of function calls and returns by abstract interpretation. In: International Conference on Functional Programming, pp. 287–298 (2009)
Kobayashi, N.: Types and higher-order recursion schemes for verification of higher-order programs. In: Principles of Programming Languages, pp. 416–428 (2009)
Agesen, O.: The Cartesian Product Algorithm: Simple and Precise Type Inference of Parametric Polymorphism. In: European Conference on Object-Oriented Programming, pp. 2–26 (1995)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Vardoulakis, D., Shivers, O. (2010). CFA2: A Context-Free Approach to Control-Flow Analysis. In: Gordon, A.D. (eds) Programming Languages and Systems. ESOP 2010. Lecture Notes in Computer Science, vol 6012. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11957-6_30
Download citation
DOI: https://doi.org/10.1007/978-3-642-11957-6_30
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-11956-9
Online ISBN: 978-3-642-11957-6
eBook Packages: Computer ScienceComputer Science (R0)