skip to main content
research-article
Open Access

On the complexity of bidirected interleaved Dyck-reachability

Published:04 January 2021Publication History
Skip Abstract Section

Abstract

Many program analyses need to reason about pairs of matching actions, such as call/return, lock/unlock, or set-field/get-field. The family of Dyck languages {Dk}, where Dk has k kinds of parenthesis pairs, can be used to model matching actions as balanced parentheses. Consequently, many program-analysis problems can be formulated as Dyck-reachability problems on edge-labeled digraphs. Interleaved Dyck-reachability (InterDyck-reachability), denoted by DkDk-reachability, is a natural extension of Dyck-reachability that allows one to formulate program-analysis problems that involve multiple kinds of matching-action pairs. Unfortunately, the general InterDyck-reachability problem is undecidable.

In this paper, we study variants of InterDyck-reachability on bidirected graphs, where for each edge ⟨ p, q ⟩ labeled by an open parenthesis ”(a”, there is an edge ⟨ q, p ⟩ labeled by the corresponding close parenthesis ”)a”, and vice versa. Language-reachability on a bidirected graph has proven to be useful both (1) in its own right, as a way to formalize many program-analysis problems, such as pointer analysis, and (2) as a relaxation method that uses a fast algorithm to over-approximate language-reachability on a directed graph. However, unlike its directed counterpart, the complexity of bidirected InterDyck-reachability still remains open.

We establish the first decidable variant (i.e., D1D1-reachability) of bidirected InterDyck-reachability. In D1D1-reachability, each of the two Dyck languages is restricted to have only a single kind of parenthesis pair. In particular, we show that the bidirected D1D1 problem is in PTIME. We also show that when one extends each Dyck language to involve k different kinds of parentheses (i.e., DkDk-reachability with k ≥ 2), the problem is NP-hard (and therefore much harder).

We have implemented the polynomial-time algorithm for bidirected D1D1-reachability. DkDk-reachability provides a new over-approximation method for bidirected DkDk-reachability in the sense that DkDk-reachability can first be relaxed to bidirected D1D1-reachability, and then the resulting bidirected D1D1-reachability problem is solved precisely. We compare this D1D1-reachability-based approach against another known over-approximating DkDk-reachability algorithm. Surprisingly, we found that the over-approximation approach based on bidirected D1D1-reachability computes more precise solutions, even though the D1D1 formalism is inherently less expressive than the DkDk formalism.

References

  1. Steven Arzt, Siegfried Rasthofer, Christian Fritz, Eric Bodden, Alexandre Bartel, Jacques Klein, Yves Le Traon, Damien Octeau, and Patrick D. McDaniel. 2014. FlowDroid: precise context, flow, field, object-sensitive and lifecycle-aware taint analysis for Android apps. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '14, Edinburgh, United Kingdom-June 09-11, 2014. 259-269.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. M. Blackburn, R. Garner, C. Hofman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. 2006. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-Oriented Programing, Systems, Languages, and Applications. 169-190.Google ScholarGoogle Scholar
  3. Krishnendu Chatterjee, Bhavya Choudhary, and Andreas Pavlogiannis. 2018. Optimal Dyck reachability for data-dependence and alias analysis. Proc. ACM Program. Lang. 2, POPL ( 2018 ), 30 : 1-30 : 30.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Swarat Chaudhuri. 2008. Subcubic algorithms for recursive state machines. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008, San Francisco, California, USA, January 7-12, 2008, George C. Necula and Philip Wadler (Eds.). ACM, 159-169.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Ben-Chung Cheng and Wen-mei W. Hwu. 2000. Modular interprocedural pointer analysis using access paths: design, implementation, and evaluation. In Proceedings of the 2000 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2000 ). ACM, 57-69.Google ScholarGoogle Scholar
  6. Harold N. Gabow, Shachindra N. Maheswari, and Leon J. Osterweil. 1976. On Two Problems in the Generation of Program Test Paths. IEEE Trans. Software Eng. 2, 3 ( 1976 ), 227-231.Google ScholarGoogle Scholar
  7. Wei Huang, Yao Dong, Ana Milanova, and Julian Dolby. 2015. Scalable and precise taint analysis for Android. In Proceedings of the 2015 International Symposium on Software Testing and Analysis (ISSTA 2015 ). ACM, 106-117.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Vineet Kahlon. 2009. Boundedness vs. Unboundedness of Lock Chains: Characterizing Decidability of Pairwise CFLReachability for Threads Communicating via Locks. In Proceedings of the 24th Annual IEEE Symposium on Logic in Computer Science, LICS 2009. IEEE Computer Society, 27-36.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. John Kodumal and Alexander Aiken. 2004. The set constraint/CFL reachability connection in practice. In Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation 2004, Washington, DC, USA, June 9-11, 2004. ACM, 207-218.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jakub Kovác. 2014. On the Complexity of Rearrangement Problems under the Breakpoint Distance. J. Comput. Biol. 21, 1 ( 2014 ), 1-15.Google ScholarGoogle ScholarCross RefCross Ref
  11. Yuanbo Li, Qirun Zhang, and Thomas W. Reps. 2020. Fast graph simplification for interleaved Dyck-reachability. In Proceedings of the 41st ACM SIGPLAN International Conference on Programming Language Design and Implementation, PLDI 2020, London, UK, June 15-20, 2020, Alastair F. Donaldson and Emina Torlak (Eds.). ACM, 780-793.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. P. Madhusudan and Gennaro Parlato. 2011. The tree width of auxiliary storage. In Proceedings of the 38th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, POPL 2011, Austin, TX, USA, January 26-28, 2011. ACM, 283-294.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Shaz Qadeer and Jakob Rehof. 2005. Context-Bounded Model Checking of Concurrent Software. In Tools and Algorithms for the Construction and Analysis of Systems, 11th International Conference, TACAS 2005, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2005, Edinburgh, UK, April 4-8, 2005, Proceedings (Lecture Notes in Computer Science, Vol. 3440 ). Springer, 93-107.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. G. Ramalingam. 2000. Context-sensitive synchronization-sensitive analysis is undecidable. ACM Trans. Program. Lang. Syst. 22, 2 ( 2000 ), 416-430.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Thomas W. Reps. 1998. Program analysis via graph reachability. Inf. Softw. Technol. 40, 11-12 ( 1998 ), 701-726. https: //doi.org/10.1016/S0950-5849 ( 98 ) 00093-7 Google ScholarGoogle Scholar
  16. Thomas W. Reps. 2000. Undecidability of context-sensitive data-independence analysis. ACM Trans. Program. Lang. Syst. 22, 1 ( 2000 ), 162-186.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Johannes Späth, Karim Ali, and Eric Bodden. 2019. Context-, flow-, and field-sensitive data-flow analysis using synchronized Pushdown systems. Proc. ACM Program. Lang. 3, POPL ( 2019 ), 48 : 1-48 : 29.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Manu Sridharan and Rastislav Bodík. 2006. Refinement-based context-sensitive points-to analysis for Java. In Proceedings of the ACM SIGPLAN 2006 Conference on Programming Language Design and Implementation, Ottawa, Ontario, Canada, June 11-14, 2006. ACM, 387-400.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Manu Sridharan, Denis Gopan, Lexin Shan, and Rastislav Bodík. 2005. Demand-driven points-to analysis for Java. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2005, October 16-20, 2005, San Diego, CA, USA. ACM, 59-76.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Guoqing (Harry) Xu, Atanas Rountev, and Manu Sridharan. 2009. Scaling CFL-Reachability-Based Points-To Analysis Using Context-Sensitive Must-Not-Alias Analysis. In ECOOP 2009-Object-Oriented Programming, 23rd European Conference, Genoa, Italy, July 6-10, 2009. Proceedings, Sophia Drossopoulou (Ed.). 98-122.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Dacong Yan, Guoqing (Harry) Xu, and Atanas Rountev. 2011. Demand-driven context-sensitive alias analysis for Java. In Proceedings of the 20th International Symposium on Software Testing and Analysis, ISSTA 2011, Toronto, ON, Canada, July 17-21, 2011, Matthew B. Dwyer and Frank Tip (Eds.). ACM, 155-165.Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Qirun Zhang and Zhendong Su. 2017. Context-sensitive data-dependence analysis via linear conjunctive language reachability. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, Giuseppe Castagna and Andrew D. Gordon (Eds.). ACM, 344-358.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. On the complexity of bidirected interleaved Dyck-reachability

      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!