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.
Supplemental Material
- N. Alon and B. Schieber. Optimal preprocessing for answering on-line product queries. Technical report, Tel Aviv University, 1987.Google Scholar
- 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 Scholar
Digital Library
- R. Alur, S. La Torre, and P. Madhusudan. Modular strategies for recursive game graphs. Theor. Comput. Sci., 2006. Google Scholar
Digital Library
- S. Arnborg and A. Proskurowski. Linear time algorithms for NP-hard problems restricted to partial k-trees . Discrete Appl Math, 1989. Google Scholar
Digital Library
- M. Bern, E. Lawler, and A.Wong. Linear-time computation of optimal subgraphs of decomposable graphs. J Algorithm, 1987. Google Scholar
Digital Library
- S. M. e. a. Blackburn. The dacapo benchmarks: Java benchmarking development and analysis. In OOPSLA, 2006. Google Scholar
Digital Library
- H. Bodlaender. Dynamic algorithms for graphs with treewidth 2. In Graph-Theoretic Concepts in Computer Science, LNCS. Springer, 1994. Google Scholar
Digital Library
- H. Bodlaender. Discovering treewidth. In SOFSEM 2005: Theory and Practice of Computer Science, volume 3381 of LNCS. Springer, 2005. Google Scholar
Digital Library
- H. L. Bodlaender. Dynamic programming on graphs with bounded treewidth. In ICALP, LNCS. Springer, 1988. Google Scholar
Digital Library
- H. L. Bodlaender. A tourist guide through treewidth. Acta Cybern., 1993.Google Scholar
- D. Callahan, K. D. Cooper, K. Kennedy, and L. Torczon. Interprocedural constant propagation. In CC. ACM, 1986. Google Scholar
Digital Library
- K. Chatterjee and J. Lacki. Faster algorithms for Markov decision processes with low treewidth. In CAV, 2013. Google Scholar
Digital Library
- K. Chatterjee and Y. Velner. Mean-payoff pushdown games. In LICS, 2012. Google Scholar
Digital Library
- K. Chatterjee, A. Pavlogiannis, and Y. Velner. Quantitative interprocedural analysis. In POPL, 2015. Google Scholar
Digital Library
- S. Chaudhuri. Subcubic algorithms for recursive state machines. In POPL, New York, NY, USA, 2008. ACM. Google Scholar
Digital Library
- S. Chaudhuri and C. D. Zaroliagis. Shortest Paths in Digraphs of Small Treewidth. Part I: Sequential Algorithms. Algorithmica, 1995.Google Scholar
- T. Cormen, C. Leiserson, R. Rivest, and C. Stein. Introduction To Algorithms. MIT Press, 2001. Google Scholar
Digital Library
- B. Courcelle. Graph rewriting: An algebraic and logic approach. In Handbook of Theoretical Computer Science (Vol. B). MIT Press, Cambridge, MA, USA, 1990. Google Scholar
Digital Library
- 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 Scholar
- M. Elberfeld, A. Jakoby, and T. Tantau. Logspace versions of the theorems of bodlaender and courcelle. In FOCS, 2010. Google Scholar
Digital Library
- M. J. Fischer and A. R. Meyer. Boolean Matrix Multiplication and Transitive Closure. In SWAT (FOCS). IEEE Computer Society, 1971. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- D. Grove and L. Torczon. Interprocedural constant propagation: A study of jump function implementation. In PLDI. ACM, 1993. Google Scholar
Digital Library
- J. Gustedt, O. Mæhle, and J. Telle. The treewidth of java programs. In Algorithm Engineering and Experiments, LNCS. Springer, 2002. Google Scholar
Digital Library
- T. Hagerup. Dynamic algorithms for graphs of bounded treewidth. Algorithmica, 2000.Google Scholar
Cross Ref
- R. Halin. S-functions for graphs. Journal of Geometry, 1976.Google Scholar
Cross Ref
- S. Horwitz, T. Reps, and M. Sagiv. Demand interprocedural dataflow analysis. SIGSOFT Softw. Eng. Notes, 1995. Google Scholar
Digital Library
- T. Kloks. Treewidth, Computations and Approximations. LNCS. Springer, 1994.Google Scholar
- J. Knoop and B. Steffen. The interprocedural coincidence theorem. In CC, 1992. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- J. Lacki. Improved deterministic algorithms for decremental reachability and strongly connected components. ACM Transactions on Algorithms, 2013. Google Scholar
Digital Library
- W. Landi and B. G. Ryder. Pointer-induced aliasing: A problem classification. In POPL. ACM, 1991. Google Scholar
Digital Library
- N. A. Naeem and O. Lhoták. Typestate-like analysis of multiple interacting objects. In OOPSLA, 2008. Google Scholar
Digital Library
- J. Obdrzálek. Fast mu-calculus model checking when tree-width is bounded. In CAV, 2003.Google Scholar
- B. A. Reed. Finding approximate separators and computing tree width quickly. In STOC, 1992. Google Scholar
Digital Library
- T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In POPL, New York, NY, USA, 1995. ACM. Google Scholar
Digital Library
- T. Reps, S. Schwoon, S. Jha, and D. Melski. Weighted pushdown systems and their application to interprocedural dataflow analysis. Sci. Comput. Program., 2005. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- N. Robertson and P. Seymour. Graph minors. iii. planar tree-width. Journal of Combinatorial Theory, Series B, 1984.Google Scholar
- M. Sagiv, T. Reps, and S. Horwitz. Precise interprocedural dataflow analysis with applications to constant propagation. Theor. Comput. Sci., 1996. Google Scholar
Digital Library
- M. Sridharan, D. Gopan, L. Shan, and R. Bodík. Demand-driven points-to analysis for java. In OOPSLA, 2005. Google Scholar
Digital Library
- M. Thorup. All Structured Programs Have Small TreeWidth and Good Register Allocation. Information and Computation, 1998. Google Scholar
Digital Library
- 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 Scholar
- T. van Dijk, J.-P. van den Heuvel, and W. Slob. Computing treewidth with libtw. Technical report, University of Utrecht, 2006.Google Scholar
- X. Zhang, R. Mangal, M. Naik, and H. Yang. Hybrid top-down and bottom-up interprocedural analysis. In PLDI, 2014. Google Scholar
Digital Library
Index Terms
Faster Algorithms for Algebraic Path Properties in Recursive State Machines with Constant Treewidth
Recommendations
Faster Algorithms for Algebraic Path Properties in Recursive State Machines with Constant Treewidth
POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesInterprocedural 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 ...
Faster Algorithms for Dynamic Algebraic Queries in Basic RSMs with Constant Treewidth
Interprocedural analysis is at the heart of numerous applications in programming languages, such as alias analysis, constant propagation, and so on. Recursive state machines (RSMs) are standard models for interprocedural analysis. We consider a general ...







Comments