skip to main content
research-article

Faster Algorithms for Algebraic Path Properties in Recursive State Machines with Constant Treewidth

Published:14 January 2015Publication History
Skip Abstract Section

Abstract

Interprocedural analysis is at the heart of numerous applications in programming languages, such as alias analysis, constant propagation, etc. Recursive state machines (RSMs) are standard models for interprocedural analysis. We consider a general framework with RSMs where the transitions are labeled from a semiring, and path properties are algebraic with semiring operations. RSMs with algebraic path properties can model interprocedural dataflow analysis problems, the shortest path problem, the most probable path problem, etc. The traditional algorithms for interprocedural analysis focus on path properties where the starting point is fixed as the entry point of a specific method. In this work, we consider possible multiple queries as required in many applications such as in alias analysis. The study of multiple queries allows us to bring in a very important algorithmic distinction between the resource usage of the one-time preprocessing vs for each individual query. The second aspect that we consider is that the control flow graphs for most programs have constant treewidth.

Our main contributions are simple and implementable algorithms that support multiple queries for algebraic path properties for RSMs that have constant treewidth. Our theoretical results show that our algorithms have small additional one-time preprocessing, but can answer subsequent queries significantly faster as compared to the current best-known solutions for several important problems, such as interprocedural reachability and shortest path. We provide a prototype implementation for interprocedural reachability and intraprocedural shortest path that gives a significant speed-up on several benchmarks.

Skip Supplemental Material Section

Supplemental Material

2676979.mov

References

  1. N. Alon and B. Schieber. Optimal preprocessing for answering on-line product queries. Technical report, Tel Aviv University, 1987.Google ScholarGoogle Scholar
  2. R. Alur, M. Benedikt, K. Etessami, P. Godefroid, T. W. Reps, and M. Yannakakis. Analysis of recursive state machines. ACM Trans. Program. Lang. Syst., 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Alur, S. La Torre, and P. Madhusudan. Modular strategies for recursive game graphs. Theor. Comput. Sci., 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Arnborg and A. Proskurowski. Linear time algorithms for NP-hard problems restricted to partial k-trees . Discrete Appl Math, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Bern, E. Lawler, and A.Wong. Linear-time computation of optimal subgraphs of decomposable graphs. J Algorithm, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. M. e. a. Blackburn. The dacapo benchmarks: Java benchmarking development and analysis. In OOPSLA, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. H. Bodlaender. Dynamic algorithms for graphs with treewidth 2. In Graph-Theoretic Concepts in Computer Science, LNCS. Springer, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. H. Bodlaender. Discovering treewidth. In SOFSEM 2005: Theory and Practice of Computer Science, volume 3381 of LNCS. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. H. L. Bodlaender. Dynamic programming on graphs with bounded treewidth. In ICALP, LNCS. Springer, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. H. L. Bodlaender. A tourist guide through treewidth. Acta Cybern., 1993.Google ScholarGoogle Scholar
  11. D. Callahan, K. D. Cooper, K. Kennedy, and L. Torczon. Interprocedural constant propagation. In CC. ACM, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. K. Chatterjee and J. Lacki. Faster algorithms for Markov decision processes with low treewidth. In CAV, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. K. Chatterjee and Y. Velner. Mean-payoff pushdown games. In LICS, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. K. Chatterjee, A. Pavlogiannis, and Y. Velner. Quantitative interprocedural analysis. In POPL, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Chaudhuri. Subcubic algorithms for recursive state machines. In POPL, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. Chaudhuri and C. D. Zaroliagis. Shortest Paths in Digraphs of Small Treewidth. Part I: Sequential Algorithms. Algorithmica, 1995.Google ScholarGoogle Scholar
  17. T. Cormen, C. Leiserson, R. Rivest, and C. Stein. Introduction To Algorithms. MIT Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. B. Courcelle. Graph rewriting: An algebraic and logic approach. In Handbook of Theoretical Computer Science (Vol. B). MIT Press, Cambridge, MA, USA, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Cousot and R. Cousot. Static determination of dynamic properties of recursive procedures. In E. Neuhold, editor, IFIP Conf. on Formal Description of Programming Concepts, 1977.Google ScholarGoogle Scholar
  20. M. Elberfeld, A. Jakoby, and T. Tantau. Logspace versions of the theorems of bodlaender and courcelle. In FOCS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. J. Fischer and A. R. Meyer. Boolean Matrix Multiplication and Transitive Closure. In SWAT (FOCS). IEEE Computer Society, 1971. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. Giegerich, U. Möncke, and R. Wilhelm. Invariance of approximate semantics with respect to program transformations. In 3rd Conference of the European Co-operation in Informatics (ECI), 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Grove and L. Torczon. Interprocedural constant propagation: A study of jump function implementation. In PLDI. ACM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Gustedt, O. Mæhle, and J. Telle. The treewidth of java programs. In Algorithm Engineering and Experiments, LNCS. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. Hagerup. Dynamic algorithms for graphs of bounded treewidth. Algorithmica, 2000.Google ScholarGoogle ScholarCross RefCross Ref
  26. R. Halin. S-functions for graphs. Journal of Geometry, 1976.Google ScholarGoogle ScholarCross RefCross Ref
  27. S. Horwitz, T. Reps, and M. Sagiv. Demand interprocedural dataflow analysis. SIGSOFT Softw. Eng. Notes, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. T. Kloks. Treewidth, Computations and Approximations. LNCS. Springer, 1994.Google ScholarGoogle Scholar
  29. J. Knoop and B. Steffen. The interprocedural coincidence theorem. In CC, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. J. Knoop, B. Steffen, and J. Vollmer. Parallelism for free: Efficient and optimal bitvector analyses for parallel programs. ACM Trans. Program. Lang. Syst., 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. J. Lacki. Improved deterministic algorithms for decremental reachability and strongly connected components. ACM Transactions on Algorithms, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. W. Landi and B. G. Ryder. Pointer-induced aliasing: A problem classification. In POPL. ACM, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. N. A. Naeem and O. Lhoták. Typestate-like analysis of multiple interacting objects. In OOPSLA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. J. Obdrzálek. Fast mu-calculus model checking when tree-width is bounded. In CAV, 2003.Google ScholarGoogle Scholar
  35. B. A. Reed. Finding approximate separators and computing tree width quickly. In STOC, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In POPL, New York, NY, USA, 1995. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. T. Reps, S. Schwoon, S. Jha, and D. Melski. Weighted pushdown systems and their application to interprocedural dataflow analysis. Sci. Comput. Program., 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. T. Reps, A. Lal, and N. Kidd. Program analysis using weighted pushdown systems. In FSTTCS 2007: Foundations of Software Technology and Theoretical Computer Science, LNCS. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. N. Robertson and P. Seymour. Graph minors. iii. planar tree-width. Journal of Combinatorial Theory, Series B, 1984.Google ScholarGoogle Scholar
  40. M. Sagiv, T. Reps, and S. Horwitz. Precise interprocedural dataflow analysis with applications to constant propagation. Theor. Comput. Sci., 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. Sridharan, D. Gopan, L. Shan, and R. Bodík. Demand-driven points-to analysis for java. In OOPSLA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. M. Thorup. All Structured Programs Have Small TreeWidth and Good Register Allocation. Information and Computation, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. R. Vallée-Rai, P. Co, E. Gagnon, L. Hendren, P. Lam, and V. Sundaresan. Soot - a java bytecode optimization framework. In CASCON '99. IBM Press, 1999.Google ScholarGoogle Scholar
  44. T. van Dijk, J.-P. van den Heuvel, and W. Slob. Computing treewidth with libtw. Technical report, University of Utrecht, 2006.Google ScholarGoogle Scholar
  45. X. Zhang, R. Mangal, M. Naik, and H. Yang. Hybrid top-down and bottom-up interprocedural analysis. In PLDI, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Faster Algorithms for Algebraic Path Properties in Recursive State Machines with Constant Treewidth

      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

      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!