skip to main content
10.1145/2676726.2676979acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

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

Published: 14 January 2015 Publication History

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.

Supplementary Material

MOV File (2676979.mov)

References

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

Cited By

View all
  • (2024)On-the-Fly Static Analysis via Dynamic Bidirected Dyck ReachabilityProceedings of the ACM on Programming Languages10.1145/36328848:POPL(1239-1268)Online publication date: 5-Jan-2024
  • (2023)Recursive State Machine Guided Graph Folding for Context-Free Language ReachabilityProceedings of the ACM on Programming Languages10.1145/35912337:PLDI(318-342)Online publication date: 6-Jun-2023
  • (2023)CFL/Dyck ReachabilityACM SIGLOG News10.1145/3583660.35836649:4(5-25)Online publication date: 6-Feb-2023
  • Show More Cited By

Index Terms

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

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
      January 2015
      716 pages
      ISBN:9781450333009
      DOI:10.1145/2676726
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 50, Issue 1
        POPL '15
        January 2015
        682 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2775051
        • Editor:
        • Andy Gill
        Issue’s Table of Contents
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Sponsors

      In-Cooperation

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 14 January 2015

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. constant treewidth graphs
      2. dataflow analysis
      3. interprocedural analysis
      4. reachability and shortest path.

      Qualifiers

      • Research-article

      Funding Sources

      Conference

      POPL '15
      Sponsor:

      Acceptance Rates

      POPL '15 Paper Acceptance Rate 52 of 227 submissions, 23%;
      Overall Acceptance Rate 860 of 4,328 submissions, 20%

      Upcoming Conference

      POPL '26

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)4
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 18 Feb 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)On-the-Fly Static Analysis via Dynamic Bidirected Dyck ReachabilityProceedings of the ACM on Programming Languages10.1145/36328848:POPL(1239-1268)Online publication date: 5-Jan-2024
      • (2023)Recursive State Machine Guided Graph Folding for Context-Free Language ReachabilityProceedings of the ACM on Programming Languages10.1145/35912337:PLDI(318-342)Online publication date: 6-Jun-2023
      • (2023)CFL/Dyck ReachabilityACM SIGLOG News10.1145/3583660.35836649:4(5-25)Online publication date: 6-Feb-2023
      • (2022)The decidability and complexity of interleaved bidirected Dyck reachabilityProceedings of the ACM on Programming Languages10.1145/34986736:POPL(1-26)Online publication date: 12-Jan-2022
      • (2021)Faster algorithms for quantitative verification in bounded treewidth graphsFormal Methods in System Design10.1007/s10703-021-00373-557:3(401-428)Online publication date: 1-Sep-2021
      • (2020)What’s Decidable About Program Verification Modulo Axioms?Tools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-030-45237-7_10(158-177)Online publication date: 25-Apr-2020
      • (2019)Faster Algorithms for Dynamic Algebraic Queries in Basic RSMs with Constant TreewidthACM Transactions on Programming Languages and Systems10.1145/336352541:4(1-46)Online publication date: 13-Nov-2019
      • (2019)Efficient parameterized algorithms for data packingProceedings of the ACM on Programming Languages10.1145/32903663:POPL(1-28)Online publication date: 2-Jan-2019
      • (2019)Decidable verification of uninterpreted programsProceedings of the ACM on Programming Languages10.1145/32903593:POPL(1-29)Online publication date: 2-Jan-2019
      • (2018)Algorithms for Algebraic Path Properties in Concurrent Systems of Constant Treewidth ComponentsACM Transactions on Programming Languages and Systems10.1145/321025740:3(1-43)Online publication date: 5-Jul-2018
      • Show More Cited By

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media