skip to main content
research-article

Fast algorithms for Dyck-CFL-reachability with applications to alias analysis

Authors Info & Claims
Published:16 June 2013Publication History
Skip Abstract Section

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.

References

  1. DaCapo benchmark suite. http://dacapobench.org/.Google ScholarGoogle Scholar
  2. R. Alur. Marrying words and trees. In PODS, pages 233--242, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Alur and P. Madhusudan. Visibly pushdown languages. In STOC, pages 202--211, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle Scholar
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Chaudhuri. Subcubic algorithms for recursive state machines. In POPL, pages 159--169, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms (3rd ed.). MIT Press, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Das, S. Lerner, and M. Seigle. ESP: Path-sensitive program verification in polynomial time. In PLDI, pages 57--68, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Earl, I. Sergey, M. Might, and D. V. Horn. Introspective pushdown analysis of higher-order programs. In ICFP, pages 177--188, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. N. Heintze and D. A. McAllester. On the cubic bottleneck in subtyping and flow analysis. In LICS, pages 342--351, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Hind. Pointer analysis: Haven't we solved this problem yet? In PASTE, pages 54--61, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Horwitz. Precise flow-insensitive may-alias analysis is NP-Hard. ACM Trans. Program. Lang. Syst., 19 (1): 1--6, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Horwitz, T. W. Reps, and D. Binkley. Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst., 12 (1): 26--60, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. Kodumal and A. Aiken. The set constraint/CFL reachability connection in practice. In PLDI, pages 207--218, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. W. Landi and B. G. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. In PLDI, pages 235--248, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. P. Pratikakis, J. S. Foster, and M. Hicks. Existential label flow inference via CFL reachability. In SAS, pages 88--106, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. Ramalingam. The undecidability of aliasing. ACM Trans. Program. Lang. Syst., 16 (5): 1467--1471, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. Rehof and M. Fähndrich. Type-base flow analysis: from polymorphic subtyping to CFL-reachability. In POPL, pages 54--66, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. W. Reps. Shape analysis as a generalized path problem. In PEPM, pages 1--11, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. T. W. Reps. Program analysis via graph reachability. Information & Software Technology, 40 (11--12): 701--726, 1998.Google ScholarGoogle ScholarCross RefCross Ref
  28. T. W. Reps, S. Horwitz, S. Sagiv, and G. Rosay. Speeding up slicing. In SIGSOFT FSE, pages 11--20, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. T. W. Reps, S. Horwitz, and S. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In POPL, pages 49--61, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. W. Rytter. Fast recognition of pushdown automaton and context-free languages. Information and Control, 67 (1--3): 12--22, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. L. Shang, X. Xie, and J. Xue. On-demand dynamic summary-based points-to analysis. In CGO, pages 264--274, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Sridharan and R. Bodík. Refinement-based context-sensitive points-to analysis for Java. In PLDI, pages 387--400, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. M. Sridharan, D. Gopan, L. Shan, and R. Bodík. Demand-driven points-to analysis for Java. In OOPSLA, pages 59--76, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  35. J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In PLDI, pages 131--144, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  37. D. Yan, G. H. Xu, and A. Rountev. Demand-driven context-sensitive alias analysis for Java. In ISSTA, pages 155--165, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. M. Yannakakis. Graph-theoretic methods in database theory. In PODS, pages 230--242, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  40. X. Zheng and R. Rugina. Demand-driven alias analysis for C. In POPL, pages 197--208, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Fast algorithms for Dyck-CFL-reachability with applications to alias analysis

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 48, Issue 6
            PLDI '13
            June 2013
            515 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/2499370
            Issue’s Table of Contents
            • cover image ACM Conferences
              PLDI '13: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation
              June 2013
              546 pages
              ISBN:9781450320146
              DOI:10.1145/2491956

            Copyright © 2013 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 16 June 2013

            Check for updates

            Qualifiers

            • research-article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!