Abstract
The context-free language (CFL) reachability problem is a well-known fundamental formulation in program analysis. In practice, many program analyses, especially pointer analyses, adopt a restricted version of CFL-reachability, Dyck-CFL-reachability, and compute on edge-labeled bidirected graphs. Solving the all-pairs Dyck-CFL-reachability on such bidirected graphs is expensive. For a bidirected graph with n nodes and m edges, the traditional dynamic programming style algorithm exhibits a subcubic time complexity for the Dyck language with k kinds of parentheses. When the underlying graphs are restricted to bidirected trees, an algorithm with O(n log n log k) time complexity was proposed recently. This paper studies the Dyck-CFL-reachability problems on bidirected trees and graphs. In particular, it presents two fast algorithms with O(n) and O(n + m log m) time complexities on trees and graphs respectively. We have implemented and evaluated our algorithms on a state-of-the-art alias analysis for Java. Results on standard benchmarks show that our algorithms achieve orders of magnitude speedup and consume less memory.
- DaCapo benchmark suite. http://dacapobench.org/.Google Scholar
- R. Alur. Marrying words and trees. In PODS, pages 233--242, 2007. Google Scholar
Digital Library
- R. Alur and P. Madhusudan. Visibly pushdown languages. In STOC, pages 202--211, 2004. Google Scholar
Digital Library
- R. Alur, M. Benedikt, K. Etessami, P. Godefroid, T. W. Reps, and M. Yannakakis. Analysis of recursive state machines. ACM Trans. Program. Lang. Syst., 27 (4): 786--818, 2005. Google Scholar
Digital Library
- V. Arlazarov, E. Dinic, M. Kronrod, and I. Faradzev. On economic construction of the transitive closure of a directed graph. Soviet Mathematics Doklady, 11: 1209--1210, 1970.Google Scholar
- E. Bodden, A. Sewe, J. Sinschek, H. Oueslati, and M. Mezini. Taming reflection: Aiding static analysis in the presence of reflection and custom class loaders. In ICSE, pages 241--250, 2011. Google Scholar
Digital Library
- S. Chaudhuri. Subcubic algorithms for recursive state machines. In POPL, pages 159--169, 2008. Google Scholar
Digital Library
- J.-D. Choi, M. G. Burke, and P. R. Carini. Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects. In POPL, pages 232--245, 1993. Google Scholar
Digital Library
- T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms (3rd ed.). MIT Press, 2009. Google Scholar
Digital Library
- M. Das, S. Lerner, and M. Seigle. ESP: Path-sensitive program verification in polynomial time. In PLDI, pages 57--68, 2002. Google Scholar
Digital Library
- C. Earl, I. Sergey, M. Might, and D. V. Horn. Introspective pushdown analysis of higher-order programs. In ICFP, pages 177--188, 2012. Google Scholar
Digital Library
- M. Fähndrich, J. S. Foster, Z. Su, and A. Aiken. Partial online cycle elimination in inclusion constraint graphs. In PLDI, pages 85--96, 1998. Google Scholar
Digital Library
- B. Hardekopf and C. Lin. The ant and the grasshopper: Fast and accurate pointer analysis for millions of lines of code. In PLDI, pages 290--299, 2007. Google Scholar
Digital Library
- N. Heintze and D. A. McAllester. On the cubic bottleneck in subtyping and flow analysis. In LICS, pages 342--351, 1997. Google Scholar
Digital Library
- N. Heintze and O. Tardieu. Ultra-fast aliasing analysis using CLA: A million lines of C code in a second. In PLDI, pages 254--263, 2001. Google Scholar
Digital Library
- M. Hind. Pointer analysis: Haven't we solved this problem yet? In PASTE, pages 54--61, 2001. Google Scholar
Digital Library
- S. Horwitz. Precise flow-insensitive may-alias analysis is NP-Hard. ACM Trans. Program. Lang. Syst., 19 (1): 1--6, 1997. Google Scholar
Digital Library
- S. Horwitz, T. W. Reps, and D. Binkley. Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst., 12 (1): 26--60, 1990. Google Scholar
Digital Library
- J. Kodumal and A. Aiken. The set constraint/CFL reachability connection in practice. In PLDI, pages 207--218, 2004. Google Scholar
Digital Library
- W. Landi and B. G. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. In PLDI, pages 235--248, 1992. Google Scholar
Digital Library
- D. Melski and T. W. Reps. Interconvertibility of a class of set constraints and context-free-language reachability. Theor. Comput. Sci., 248 (1--2): 29--98, 2000. Google Scholar
Digital Library
- P. Pratikakis, J. S. Foster, and M. Hicks. Existential label flow inference via CFL reachability. In SAS, pages 88--106, 2006. Google Scholar
Digital Library
- P. Pratikakis, J. S. Foster, and M. Hicks. Locksmith: Practical static race detection for C. ACM Trans. Program. Lang. Syst., 33 (1): 3, 2011. Google Scholar
Digital Library
- G. Ramalingam. The undecidability of aliasing. ACM Trans. Program. Lang. Syst., 16 (5): 1467--1471, 1994. Google Scholar
Digital Library
- J. Rehof and M. Fähndrich. Type-base flow analysis: from polymorphic subtyping to CFL-reachability. In POPL, pages 54--66, 2001. Google Scholar
Digital Library
- T. W. Reps. Shape analysis as a generalized path problem. In PEPM, pages 1--11, 1995. Google Scholar
Digital Library
- T. W. Reps. Program analysis via graph reachability. Information & Software Technology, 40 (11--12): 701--726, 1998.Google Scholar
Cross Ref
- T. W. Reps, S. Horwitz, S. Sagiv, and G. Rosay. Speeding up slicing. In SIGSOFT FSE, pages 11--20, 1994. Google Scholar
Digital Library
- T. W. Reps, S. Horwitz, and S. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In POPL, pages 49--61, 1995. Google Scholar
Digital Library
- W. Rytter. Fast recognition of pushdown automaton and context-free languages. Information and Control, 67 (1--3): 12--22, 1985. Google Scholar
Digital Library
- L. Shang, X. Xie, and J. Xue. On-demand dynamic summary-based points-to analysis. In CGO, pages 264--274, 2012. Google Scholar
Digital Library
- M. Sridharan and R. Bodík. Refinement-based context-sensitive points-to analysis for Java. In PLDI, pages 387--400, 2006. Google Scholar
Digital Library
- M. Sridharan, D. Gopan, L. Shan, and R. Bodík. Demand-driven points-to analysis for Java. In OOPSLA, pages 59--76, 2005. Google Scholar
Digital Library
- R. Vallée-Rai, E. Gagnon, L. J. Hendren, P. Lam, P. Pominville, and V. Sundaresan. Optimizing java bytecode using the Soot framework: Is it feasible? In CC, pages 18--34, 2000. Google Scholar
Digital Library
- J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In PLDI, pages 131--144, 2004. Google Scholar
Digital Library
- G. Xu, A. Rountev, and M. Sridharan. Scaling CFL-reachability-based points-to analysis using context-sensitive must-not-alias analysis. In ECOOP, pages 98--122, 2009. Google Scholar
Digital Library
- D. Yan, G. H. Xu, and A. Rountev. Demand-driven context-sensitive alias analysis for Java. In ISSTA, pages 155--165, 2011. Google Scholar
Digital Library
- M. Yannakakis. Graph-theoretic methods in database theory. In PODS, pages 230--242, 1990. Google Scholar
Digital Library
- H. Yuan and P. T. Eugster. An efficient algorithm for solving the Dyck-CFL reachability problem on trees. In ESOP, pages 175--189, 2009. Google Scholar
Digital Library
- X. Zheng and R. Rugina. Demand-driven alias analysis for C. In POPL, pages 197--208, 2008. Google Scholar
Digital Library
Index Terms
Fast algorithms for Dyck-CFL-reachability with applications to alias analysis
Recommendations
Demand-driven alias analysis for C
POPL '08This paper presents a demand-driven, flow-insensitive analysisalgorithm for answering may-alias queries. We formulate thecomputation of alias queries as a CFL-reachability problem, and use this formulation to derive a demand-driven analysis algorithm. ...
Fast algorithms for Dyck-CFL-reachability with applications to alias analysis
PLDI '13: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and ImplementationThe context-free language (CFL) reachability problem is a well-known fundamental formulation in program analysis. In practice, many program analyses, especially pointer analyses, adopt a restricted version of CFL-reachability, Dyck-CFL-reachability, and ...
Efficient subcubic alias analysis for C
OOPSLA '14Inclusion-based alias analysis for C can be formulated as a context-free language (CFL) reachability problem. It is well known that the traditional cubic CFL-reachability algorithm does not scale well in practice. We present a highly scalable and ...







Comments