Abstract
Low-level program analysis is a fundamental problem, taking the shape of "flow analysis" in functional languages and "points-to" analysis in imperative and object-oriented languages. Despite the similarities, the vocabulary and results in the two communities remain largely distinct, with limited cross-understanding. One of the few links is Shivers's k-CFA work, which has advanced the concept of "context-sensitive analysis" and is widely known in both communities.
Recent results indicate that the relationship between the functional and object-oriented incarnations of k-CFA is not as well understood as thought. Van Horn and Mairson proved k-CFA for k ≥ 1 to be EXPTIME-complete; hence, no polynomial-time algorithm can exist. Yet, there are several polynomial-time formulations of context-sensitive points-to analyses in object-oriented languages. Thus, it seems that functional k-CFA may actually be a profoundly different analysis from object-oriented k-CFA. We resolve this paradox by showing that the exact same specification of k-CFA is polynomial-time for object-oriented languages yet exponential-time for functional ones: objects and closures are subtly different, in a way that interacts crucially with context-sensitivity and complexity. This illumination leads to an immediate payoff: by projecting the object-oriented treatment of objects onto closures, we derive a polynomial-time hierarchy of context-sensitive CFAs for functional programs.
- Andrew W. Appel. Compiling with Continuations. Cambridge University Press, November 1991. ISBN 0-521-41695-7. Google Scholar
Digital Library
- Martin Bravenboer and Yannis Smaragdakis. Strictly declarative specification of sophisticated points-to analyses. In OOPSLA'09: 24th annual ACM SIGPLAN conference on Object Oriented Programming, Systems, Languages, and Applications, 2009. Google Scholar
Digital Library
- Luca Cardelli. Compiling a functional language. In LISP and Functional Programming, pages 208--217, 1984. Google Scholar
Digital Library
- Patrick Cousot and Radhia Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Conference Record of the Fourth ACM Symposium on Principles of Programming Languages, pages 238--252. ACM Press, 1977. Google Scholar
Digital Library
- Patrick Cousot and Radhia Cousot. Systematic design of program analysis frameworks. In POPL'79: Proceedings of the 6th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pages 269--282. ACM Press, 1979. Google Scholar
Digital Library
- Jörgen Gustavsson and Josef Svenningsson. Constraint abstractions. In PADO'01: Proceedings of the Second Symposium on Programs as Data Objects, pages 63--83. Springer-Verlag, 2001. ISBN 3-540-42068-1. Google Scholar
Digital Library
- Atsushi Igarashi, Benjamin C. Pierce, and Philip Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst., 23 (3): 396--450, 2001. ISSN 0164-0925. Google Scholar
Digital Library
- Suresh Jagannathan and Stephen Weeks. A unified treatment of flow analysis in higher-order languages. In POPL'95: Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 393--407. ACM, 1995. ISBN 0-89791-692-1. Google Scholar
Digital Library
- Ondřej Lhoták. Program Analysis using Binary Decision Diagrams. PhD thesis, McGill University, January 2006.Google Scholar
- Ondřej Lhoták and Laurie Hendren. Evaluating the benefits of context-sensitive points-to analysis using a BDD-based implementation. ACM Trans. Softw. Eng. Methodol., 18 (1): 1--53, 2008. ISSN 1049-331X. Google Scholar
Digital Library
- Jan Midtgaard. Control-flow analysis of functional programs. Technical Report BRICS RS-07-18, DAIMI, Department of Computer Science, University of Aarhus, December 2007. To appear in revised form in ACM Computing Surveys.Google Scholar
Cross Ref
- Matthew Might and Olin Shivers. Environment analysis via Δ-CFA. In POPL'06: Conference record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 127--140. ACM, 2006\natexlaba. ISBN 1-59593-027-2. Google Scholar
Digital Library
- Matthew Might and Olin Shivers. Improving flow analyses via Γ-CFA: Abstract garbage collection and counting. In ICFP'06: Proceedings of the Eleventh ACM SIGPLAN International Conference on Functional Programming, pages 13--25. ACM, 2006. ISBN 1-59593-309-3. Google Scholar
Digital Library
- Christian Mossin. Flow Analysis of Typed Higher-Order Programs. PhD thesis, DIKU, University of Copenhagen, January 1997.Google Scholar
- Jakob Rehof and Manuel Fähndrich. Type-base flow analysis: from polymorphic subtyping to CFL-reachability. In POPL'01: Proceedings of the 28th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 54--66. ACM, 2001. ISBN 1-58113-336-7. Google Scholar
Digital Library
- Olin Shivers. Higher-order control-flow analysis in retrospect: lessons learned, lessons abandoned. In Kathryn S. McKinley, editor, Best of PLDI 1988, volume 39, pages 257--269. ACM, 2004.Google Scholar
- Olin G. Shivers. Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University, 1991. Google Scholar
Digital Library
- David Van Horn and Harry G. Mairson. Relating complexity and precision in control flow analysis. In ICFP'07: Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, pages 85--96. ACM, 2007. ISBN 9781-59593-815-2. Google Scholar
Digital Library
- David Van Horn and Harry G. Mairson. Deciding k-CFA is complete for EXPTIME. In ICFP'08: Proceeding of the 13th ACM SIGPLAN International Conference on Functional Programming, pages 275--282. ACM, 2008. ISBN 9781-595-9391-9-7. Google Scholar
Digital Library
Index Terms
Resolving and exploiting the k-CFA paradox: illuminating functional vs. object-oriented program analysis
Recommendations
Resolving and exploiting the k-CFA paradox: illuminating functional vs. object-oriented program analysis
PLDI '10: Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and ImplementationLow-level program analysis is a fundamental problem, taking the shape of "flow analysis" in functional languages and "points-to" analysis in imperative and object-oriented languages. Despite the similarities, the vocabulary and results in the two ...
Precise flow-insensitive may-alias analysis is NP-hard
Determining aliases is one of the foundamental static analysis problems, in part because the precision with which this problem is solved can affect the precision of other analyses such as live variables, available expressions, and constant propagation. ...
Pushdown control-flow analysis for free
POPL '16Traditional control-flow analysis (CFA) for higher-order languages introduces spurious connections between callers and callees, and different invocations of a function may pollute each other's return flows. Recently, three distinct approaches have been ...






Comments