Abstract
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 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, and so on. 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 an important algorithmic distinction between the resource usage of the one-time preprocessing vs for each individual query. The second aspect 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 algorithmic solutions for interprocedural dataflow analysis. We have also implemented our algorithms and evaluated their performance for performing on-demand interprocedural dataflow analysis on various domains, such as for live variable analysis and reaching definitions, on a standard benchmark set. Our experimental results align with our theoretical statements and show that after a lightweight preprocessing, on-demand queries are answered much faster than the standard existing algorithmic approaches.
- Noga Alon and Baruch Schieber. 1987. Optimal Preprocessing for Answering On-line Product Queries. Technical Report. Tel Aviv University.Google Scholar
- R. Alur, M. Benedikt, K. Etessami, P. Godefroid, T. W. Reps, and M. Yannakakis. 2005. Analysis of recursive state machines. ACM Trans. Program. Lang. Syst. (2005).Google Scholar
- R. Alur, S. La Torre, and P. Madhusudan. 2006. Modular strategies for recursive game graphs. Theor. Comput. Sci. 354, 2 (2006), 230--249. DOI:https://doi.org/10.1016/j.tcs.2005.11.017Google Scholar
Digital Library
- Andrew W. Appel and Jens Palsberg. 2002. Modern Compiler Implementation in Java. Cambridge University Press.Google Scholar
- Stefan Arnborg and Andrzej Proskurowski. 1989. Linear time algorithms for NP-hard problems restricted to partial k-trees. Discrete Appl. Math. 23, 1 (1989), 11--24. DOI:https://doi.org/10.1016/0166-218X(89)90031-0Google Scholar
Digital Library
- Wayne A. Babich and Mehdi Jazayeri. 1978. The method of attributes for data flow analysis. Acta Inform. 10, 3 (1978).Google Scholar
Digital Library
- Michael Bebenita, Florian Brandner, Manuel Fahndrich, Francesco Logozzo, Wolfram Schulte, Nikolai Tillmann, and Herman Venter. 2010. SPUR: A trace-based JIT compiler for CIL. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA’10). ACM, 708--725. DOI:https://doi.org/10.1145/1869459.1869517Google Scholar
Digital Library
- Michael A. Bender and Martín Farach-Colton. 2000. The LCA problem revisited. In Proceedings of the Theoretical Informatics (LATIN’00). Springer Berlin.Google Scholar
Digital Library
- M. W. Bern, E. L Lawler, and A. L Wong. 1987. Linear-time computation of optimal subgraphs of decomposable graphs. J Algorithm 8, 2 (1987), 216--235. DOI:https://doi.org/10.1016/0196-6774(87)90039-3Google Scholar
Digital Library
- Stephen M. Blackburn. 2006. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of the OOPSLA’06.Google Scholar
Digital Library
- Eric Bodden. 2012. Inter-procedural data-flow analysis with IFDS/IDE and soot. In Proceedings of the SOAP’12. ACM, New York, NY.Google Scholar
Digital Library
- Hans L. Bodlaender. 1994. Dynamic algorithms for graphs with treewidth 2. In Graph-Theoretic Concepts in Computer Science. Springer.Google Scholar
- Hans L. Bodlaender. 2005. Discovering treewidth. In Proceedings of the Theory and Practice of Computer Science (SOFSEM’05). LNCS, Vol. 3381. Springer.Google Scholar
Digital Library
- Hans L. Bodlaender and Torben Hagerup. 1998. Parallel algorithms with optimal speedup for bounded treewidth. SIAM J. Comput. 27, 6 (1998), 1725--1746. DOI:https://doi.org/10.1137/S0097539795289859Google Scholar
Digital Library
- Hans L. Bodlaender. 1988. Dynamic programming on graphs with bounded treewidth. In Proceedings of the ICALP’88. Springer.Google Scholar
Cross Ref
- Hans L. Bodlaender. 1993a. A Linear Time Algorithm for Finding Tree-decompositions of Small Treewidth. In Proceedings of the Twenty-fifth Annual ACM Symposium on Theory of Computing (STOC’93). ACM, 226--234. DOI:https://doi.org/10.1145/167088.167161Google Scholar
Digital Library
- Hans L. Bodlaender. 1993b. A tourist guide through treewidth. Acta Cybern. 11, 1--2 (1993), 1--21. http://cyber.bibl.u-szeged.hu/index.php/actcybern/article/view/3417.Google Scholar
- Hans L. Bodlaender. 1998. A partial k-arboretum of graphs with bounded treewidth. Theor. Comput. Sci. 209, 1--2 (1998), 1--45. DOI:https://doi.org/10.1016/S0304-3975(97)00228-4Google Scholar
Digital Library
- Bernd Burgstaller, Johann Blieberger, and Bernhard Scholz. 2004. On the tree width of Ada programs. In Proceedings of the Ada-Europe’04, Reliable Software Technologies, Albert Llamosí and Alfred Strohmeier (Eds.). Springer Berlin, 78--90.Google Scholar
Cross Ref
- David Callahan, Keith D. Cooper, Ken Kennedy, and Linda Torczon. 1986. Interprocedural constant propagation. In Proceedings of the CC’86. ACM.Google Scholar
Digital Library
- Krishnendu Chatterjee, Amir Goharshady, and Ehsan Goharshady. 2019. The treewidth of smart contracts. In Proceedings of the SAC’19.Google Scholar
Digital Library
- Krishnendu Chatterjee, Amir Kafshdar Goharshady, and Andreas Pavlogiannis. 2017. JTDec: A tool for tree decompositions in soot. In Automated Technology for Verification and Analysis, Deepak D’Souza and K. Narayan Kumar (Eds.). Springer International Publishing, Cham, 59--66.Google Scholar
- Krishnendu Chatterjee, Rasmus Ibsen-Jensen, and Andreas Pavlogiannis. 2016. Optimal reachability and a space-time tradeoff for distance queries in constant-treewidth graphs. In Proceedings of the 24th Annual European Symposium on Algorithms (ESA’16). 28:1--28:17.Google Scholar
- Krishnendu Chatterjee, Rasmus Ibsen-Jensen, Andreas Pavlogiannis, and Prateesh Goyal. 2015a. Faster algorithms for algebraic path properties in recursive state machines with constant treewidth. In Proceedings of the POPL’15. 97--109.Google Scholar
Digital Library
- K. Chatterjee and J. Lacki. 2013. Faster algorithms for Markov decision processes with low treewidth. In Proceedings of the CAV’13.Google Scholar
- Krishnendu Chatterjee, Andreas Pavlogiannis, and Yaron Velner. 2015b. Quantitative interprocedural analysis. In Proceedings of the POPL’15.Google Scholar
Digital Library
- Krishnendu Chatterjee and Yaron Velner. 2012. Mean-payoff pushdown games. In Proceedings of the LICS’12.Google Scholar
Digital Library
- Swarat Chaudhuri. 2008. Subcubic algorithms for recursive state machines. In Proceedings of the POPL’08. ACM, New York, NY.Google Scholar
Digital Library
- Shiva Chaudhuri and Christos D. Zaroliagis. 2000. Shortest paths in digraphs of small treewidth. Part I: Sequential algorithms. Algorithmica 27, 3 (2000), 212--226. DOI:https://doi.org/10.1007/s004530010016Google Scholar
Cross Ref
- Tong Chen, Jin Lin, Xiaoru Dai, Wei-Chung Hsu, and Pen-Chung Yew. 2004. Data dependence profiling for speculative optimizations. In Compiler Construction, Evelyn Duesterwald (Ed.). Springer Berlin, 57--72.Google Scholar
- Edmund M. Clarke, Thomas A. Henzinger, Helmut Veith, and Roderick Bloem. 2018. Handbook of Model Checking (1st ed.). Springer Publishing Company, Incorporated.Google Scholar
- Keith Cooper and Linda Torczon. 2011. Engineering a Compiler. Elsevier.Google Scholar
- T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. 2001. Introduction to Algorithms. The MIT Press.Google Scholar
- Brouno Courcelle. 1990. Graph rewriting: An algebraic and logic approach. In Handbook of Theoretical Computer Science (Vol. B). The MIT Press, Cambridge, MA.Google Scholar
- P. Cousot and R Cousot. 1977. Static determination of dynamic properties of recursive procedures. In Proceedings of the IFIP’77, Formal Description of Programming Concepts, E. J. Neuhold (Ed.).Google Scholar
- Edsger. W. Dijkstra. 1959. A note on two problems in connexion with graphs. Numer. Math. 1, 1 (1959), 269--271. DOI:https://doi.org/10.1007/BF01386390Google Scholar
Digital Library
- Evelyn Duesterwald, Rajiv Gupta, and Mary Lou Soffa. 1995. Demand-driven computation of interprocedural data flow In Proceedings of the POPL’95.Google Scholar
- M. Elberfeld, A. Jakoby, and T. Tantau. 2010. Logspace versions of the theorems of Bodlaender and Courcelle. In Proceedings of the FOCS’10.Google Scholar
- Olivier Flückiger, Gabriel Scherer, Ming-Ho Yee, Aviral Goel, Amal Ahmed, and Jan Vitek. 2017. Correctness of speculative optimizations with dynamic deoptimization. Proc. ACM Program. Lang. 2, Article 49 (Dec. 2017), 28 pages. DOI:https://doi.org/10.1145/3158137.Google Scholar
Digital Library
- Robert Giegerich, Ulrich Möncke, and Reinhard Wilhelm. 1981. Invariance of approximate semantics with respect to program transformations. In Proceedings of the 3rd Conference of the European Co-operation in Informatics (ECI’81).Google Scholar
- Dan Grove and Linda Torczon. 1993. Interprocedural constant propagation: A study of jump function implementation. In Proceedings of the PLDI’93. ACM.Google Scholar
Digital Library
- Jens Gustedt, Ole A. Mæhle, and Jan Arne Telle. 2002. The treewidth of Java programs. In Algorithm Engineering and Experiments. Springer.Google Scholar
- Torben Hagerup. 2000. Dynamic algorithms for graphs of bounded treewidth. Algorithmica (2000).Google Scholar
- Rudolf Halin. 1976. S-functions for graphs. J. Geom. 8, 1 (1976), 171--186. DOI:https://doi.org/10.1007/BF01917434Google Scholar
Cross Ref
- D. Harel and R. Tarjan. 1984. Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13, 2 (1984), 338--355. DOI:https://doi.org/10.1137/0213024Google Scholar
Digital Library
- Susan Horwitz, Thomas Reps, and Mooly Sagiv. 1995. Demand interprocedural dataflow analysis. SIGSOFT Softw. Eng. Notes 20, 4 (1995), 104--115. DOI:https://doi.org/10.1145/222132.222146Google Scholar
Digital Library
- Philipp Klaus Krause, Lukas Larisch, and Felix Salfelder. 2019. The tree-width of C. Disc. Appl. Math. (03 2019). DOI:https://doi.org/10.1016/j.dam.2019.01.027.Google Scholar
- Jens Knoop and Bernhard Steffen. 1992. The interprocedural coincidence theorem. In Proceedings of the CC’92.Google Scholar
Cross Ref
- Jens Knoop, Bernhard Steffen, and Jürgen Vollmer. 1996. Parallelism for free: Efficient and optimal bitvector analyses for parallel programs. ACM Trans. Program. Lang. Syst. 18, 3 (1996), 268--299. DOI:https://doi.org/10.1145/229542.229545Google Scholar
Digital Library
- J. Lacki. 2013. Improved deterministic algorithms for decremental reachability and strongly connected components. ACM Trans. Algor. 9, 3, Article 27 (2013), 15 pages. DOI:https://doi.org/10.1145/2483699.2483707Google Scholar
- William Landi and Barbara G. Ryder. 1991. Pointer-induced aliasing: A problem classification. In Proceedings of the POPL’91. ACM.Google Scholar
- Jin Lin, Tong Chen, Wei-Chung Hsu, Pen-Chung Yew, Roy Dz-Ching Ju, Tin-Fook Ngai, and Sun Chan. 2004. A compiler framework for speculative optimizations. ACM Trans. Archit. Code Optim. 1, 3 (Sept. 2004), 247--271. DOI:https://doi.org/10.1145/1022969.1022970.Google Scholar
Digital Library
- Nomair A. Naeem and Ondrej Lhoták. 2008. Typestate-like analysis of multiple interacting objects. In Proceedings of the OOPSLA’08.Google Scholar
- Nomair A. Naeem, Ondřej Lhoták, and Jonathan Rodriguez. 2010. Practical extensions to the IFDS algorithm. Proceedings of the CC’10.Google Scholar
Digital Library
- Flemming Nielson, Hanne R. Nielson, and Chris Hankin. 2015. Principles of Program Analysis. Springer.Google Scholar
Digital Library
- Jan Obdrzálek. 2003. Fast mu-calculus model checking when tree-width is bounded. In Proceedings of the CAV’03.Google Scholar
Cross Ref
- Bruce A. Reed. 1992. Finding approximate separators and computing tree width quickly. In Proceedings of the STOC’92.Google Scholar
Digital Library
- Thomas W. Reps. 1995. Demand Interprocedural Program Analysis Using Logic Databases. Springer, 163--196. DOI:https://doi.org/10.1007/978-1-4615-2207-2_8Google Scholar
- Thomas Reps. 1997. Program analysis via graph reachability. In Proceedings of the ILPS’97.Google Scholar
- Thomas Reps, Susan Horwitz, and Mooly Sagiv. 1995. Precise interprocedural dataflow analysis via graph reachability. In Proceedings of the POPL’95.Google Scholar
Digital Library
- Thomas Reps, Akash Lal, and Nick Kidd. 2007. Program analysis using weighted pushdown systems. In Proceedings of the Foundations of Software Technology and Theoretical Computer Science (FSTTCS’07).Google Scholar
Digital Library
- Thomas Reps, Stefan Schwoon, Somesh Jha, and David Melski. 2005. Weighted pushdown systems and their application to interprocedural dataflow analysis. Sci. Comput. Program. 58, 1 (2005), 206--263. Special Issue on the Static Analysis Symposium 2003. DOI:https://doi.org/10.1016/j.scico.2005.02.009Google Scholar
Digital Library
- JetBrains ReSharper. 2019. Code inspection: Unused local variable. ReSharper 2019.1 Help. Retrieved from: https://www.jetbrains.com/help/resharper/UnusedVariable.html.Google Scholar
- Neil Robertson and P. D. Seymour. 1984. Graph minors. III. Planar tree-width. J. Combin. Theor., Series B 36, 1 (1984), 49--64. DOI:https://doi.org/10.1016/0095-8956(84)90013-3Google Scholar
Cross Ref
- Mooly Sagiv, Thomas Reps, and Susan Horwitz. 1996. Precise interprocedural dataflow analysis with applications to constant propagation. Theor. Comput. Sci. 167, 1--2 (1996), 131--170. DOI:https://doi.org/10.1016/0304-3975(96)00072-2Google Scholar
Digital Library
- Stefan Schwoon. 2002. Model-Checking Pushdown Systems. Ph.D. Dissertation. Technischen Universität München.Google Scholar
- Manu Sridharan, Denis Gopan, Lexin Shan, and Rastislav Bodík. 2005. Demand-driven points-to analysis for Java. In Proceedings of the OOPSLA’05.Google Scholar
Digital Library
- Mikkel Thorup. 1998. All structured programs have small tree width and good register allocation. Inform. Comput. 142, 2 (1998), 159--181. DOI:https://doi.org/10.1006/inco.1997.2697Google Scholar
Digital Library
- Raja Vallée-Rai, Phong Co, Etienne Gagnon, Laurie Hendren, Patrick Lam, and Vijay Sundaresan. 1999. Soot—A Java bytecode optimization framework. In Proceedings of the CASCON’99. IBM Press.Google Scholar
- Genevieve Warren, Gordon Hogenson, Mike Jones, and Saisang Cai. 2016. CA1804: Remove unused locals. Retrieved from: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1804-remove-unused-locals?view=vs-2019.Google Scholar
- Xin Yuan, Rajiv Gupta, and Rami Melhem. 1997. Demand-driven data flow analysis for communication optimization. Parallel Proc. Lett. 7, 4 (1997), 359--370.Google Scholar
Cross Ref
- Frank Kenneth Zadeck. 1984. Incremental data flow analysis in a structured program editor. In Proceedings of the SIGPLAN’84.Google Scholar
Digital Library
- Xin Zhang, Ravi Mangal, Mayur Naik, and Hongseok Yang. 2014. Hybrid top-down and bottom-up interprocedural analysis. In Proceedings of the PLDI’14.Google Scholar
Digital Library
Index Terms
Faster Algorithms for Dynamic Algebraic Queries in Basic RSMs 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 ...
Interprocedural pointer alias analysis
We present practical approximation methods for computing and representing interprocedural aliases for a program written in a language that includes pointers, reference parameters, and recursion. We present the following contributions: (1) a framework ...
AJANA: a general framework for source-code-level interprocedural dataflow analysis of AspectJ software
AOSD '08: Proceedings of the 7th international conference on Aspect-oriented software developmentAspect-oriented software presents new challenges for the designers of static analyses. Our work aims to establish systematic foundations for dataflow analysis of AspectJ software. We propose a control- and data-flow program representation for AspectJ ...






Comments