skip to main content
research-article
Open Access

The Fine-Grained Complexity of CFL Reachability

Published:11 January 2023Publication History
Skip Abstract Section

Abstract

Many problems in static program analysis can be modeled as the context-free language (CFL) reachability problem on directed labeled graphs. The CFL reachability problem can be generally solved in time O(n3), where n is the number of vertices in the graph, with some specific cases that can be solved faster. In this work, we ask the following question: given a specific CFL, what is the exact exponent in the monomial of the running time? In other words, for which cases do we have linear, quadratic or cubic algorithms, and are there problems with intermediate runtimes? This question is inspired by recent efforts to classify classic problems in terms of their exact polynomial complexity, known as fine-grained complexity. Although recent efforts have shown some conditional lower bounds (mostly for the class of combinatorial algorithms), a general picture of the fine-grained complexity landscape for CFL reachability is missing.

Our main contribution is lower bound results that pinpoint the exact running time of several classes of CFLs or specific CFLs under widely believed lower bound conjectures (e.g., Boolean Matrix Multiplication, k-Clique, APSP, 3SUM). We particularly focus on the family of Dyck-k languages (which are strings with well-matched parentheses), a fundamental class of CFL reachability problems. Remarkably, we are able to show a Ω(n2.5) lower bound for Dyck-2 reachability, which to the best of our knowledge is the first super-quadratic lower bound that applies to all algorithms, and shows that CFL reachability is strictly harder that Boolean Matrix Multiplication. We also present new lower bounds for the case of sparse input graphs where the number of edges m is the input parameter, a common setting in the database literature. For this setting, we show a cubic lower bound for Andersen’s Pointer Analysis which significantly strengthens prior known results.

References

  1. Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. 2018. If the Current Clique Algorithms Are Optimal, so Is Valiant’s Parser. SIAM J. Comput., 47, 6 (2018), 2527–2555. https://doi.org/10.1137/16M1061771 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Amir Abboud and Virginia Vassilevska Williams. 2014. Popular Conjectures Imply Strong Lower Bounds for Dynamic Problems. In FOCS. IEEE Computer Society, 434–443. https://doi.org/10.1109/FOCS.2014.53 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Foto Afrati, Manolis Gergatsoulis, and Maria Katzouraki. 1996. On transformations into linear database logic programs. In International Andrei Ershov Memorial Conference on Perspectives of System Informatics. 433–444. https://doi.org/10.1007/3-540-62064-8_36 Google ScholarGoogle ScholarCross RefCross Ref
  4. Foto Afrati, Manolis Gergatsoulis, and Francesca Toni. 2003. Linearisability on datalog programs. Theoretical Computer Science, 308, 1-3 (2003), 199–226. https://doi.org/10.1016/s0304-3975(02)00730-2 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Foto Afrati and Francesca Toni. 1997. Chain queries expressible by linear datalog programs. In Proc. of the 5th International Workshop on Deductive Databases and Logic Programming (DDLP’97). 49–58. Google ScholarGoogle Scholar
  6. Noga Alon, Zvi Galil, and Oded Margalit. 1997. On the Exponent of the All Pairs Shortest Path Problem. J. Comput. Syst. Sci., 54, 2 (1997), 255–262. https://doi.org/10.1006/jcss.1997.1388 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Lars Ole Andersen. 1994. Program analysis and specialization for the C programming language. Ph. D. Dissertation. Citeseer. Google ScholarGoogle Scholar
  8. Pablo Barceló Baeza. 2013. Querying graph databases. In Proceedings of the 32nd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS 2013, New York, NY, USA - June 22 - 27, 2013, Richard Hull and Wenfei Fan (Eds.). ACM, 175–188. https://doi.org/10.1145/2463664.2465216 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Guillaume Bagan, Angela Bonifati, and Benoît Groz. 2013. A trichotomy for regular simple path queries on graphs. In Proceedings of the 32nd ACM SIGMOD-SIGACT-SIGAI symposium on Principles of database systems. 261–272. https://doi.org/10.1145/2463664.2467795 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. 2017. Answering conjunctive queries under updates. In proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI symposium on Principles of database systems. 303–318. https://doi.org/10.1145/3034786.3034789 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. 2018. Answering UCQs under Updates and in the Presence of Integrity Constraints. In 21st International Conference on Database Theory (ICDT 2018). https://doi.org/10.4230/LIPIcs.ICDT.2018.8 Google ScholarGoogle ScholarCross RefCross Ref
  12. Al Bessey, Ken Block, Benjamin Chelf, Andy Chou, Bryan Fulton, Seth Hallem, Charles-Henri Gros, Asya Kamsky, Scott McPeak, and Dawson R. Engler. 2010. A few billion lines of code later: using static analysis to find bugs in the real world. CACM, 53, 2 (2010), 66–75. https://doi.org/10.1145/1646353.1646374 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Nofar Carmeli and Markus Kröll. 2021. On the Enumeration Complexity of Unions of Conjunctive Queries. ACM Transactions on Database Systems (TODS), 46, 2 (2021), 1–41. https://dl.acm.org/doi/10.1145/3450263 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Katrin Casel and Markus L. Schmid. 2021. Fine-Grained Complexity of Regular Path Queries. In ICDT (LIPIcs, Vol. 186). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 19:1–19:20. https://doi.org/10.4230/LIPIcs.ICDT.2021.19 Google ScholarGoogle ScholarCross RefCross Ref
  15. 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. https://doi.org/10.1145/3158118 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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. https://doi.org/10.1145/1328438.1328460 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Peter Chini. 2022. Fine-Grained Complexity of Program Verification. Ph. D. Dissertation. Google ScholarGoogle Scholar
  18. Peter Chini, Jonathan Kolberg, Andreas Krebs, Roland Meyer, and Prakash Saivasan. 2017. On the Complexity of Bounded Context Switching. In 25th Annual European Symposium on Algorithms (ESA 2017). https://doi.org/10.4230/LIPIcs.ESA.2017.27 Google ScholarGoogle ScholarCross RefCross Ref
  19. Peter Chini, Roland Meyer, and Prakash Saivasan. 2018. Fine-Grained Complexity of Safety Verification. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems. 20–37. https://doi.org/10.4230/LIPIcs.ICDT.2021.19 Google ScholarGoogle ScholarCross RefCross Ref
  20. Peter Chini, Roland Meyer, and Prakash Saivasan. 2020. Fine-grained complexity of safety verification. Journal of Automated Reasoning, 64, 7 (2020), 1419–1444. https://doi.org/10.1007/s10817-020-09572-x Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Peter Chini and Prakash Saivasan. 2020. A Framework for Consistency Algorithms. In 40th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2020). https://doi.org/10.4230/LIPIcs.FSTTCS.2020.42 Google ScholarGoogle ScholarCross RefCross Ref
  22. Dmitry Chistikov, Rupak Majumdar, and Philipp Schepper. 2022. Subcubic certificates for CFL reachability. Proceedings of the ACM on Programming Languages, 6, POPL (2022), 1–29. https://doi.org/10.1145/3498702 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Mihai Christodorescu and Somesh Jha. 2003. Static Analysis of Executables to Detect Malicious Patterns. In USENIX Security. USENIX Association. https://doi.org/10.21236/ada449067 Google ScholarGoogle ScholarCross RefCross Ref
  24. Guozhu Dong. 1992. On datalog linearization of chain queries. In Theoretical Studies in Computer Science. Elsevier, 181–206. https://doi.org/10.1016/b978-0-12-708240-0.50012-5 Google ScholarGoogle ScholarCross RefCross Ref
  25. Michael J Fischer and Albert R Meyer. 1971. Boolean matrix multiplication and transitive closure. In 12th annual symposium on switching and automata theory (swat 1971). 129–131. https://doi.org/10.1109/swat.1971.4 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Anka Gajentaan and Mark H Overmars. 1995. On a class of O(n^2) problems in computational geometry. Computational geometry, 5, 3 (1995), 165–185. https://doi.org/10.1016/0925-7721(95)00022-2 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Alexander Golovnev, Siyao Guo, Thibaut Horel, Sunoo Park, and Vinod Vaikuntanathan. 2020. Data structures meet cryptography: 3SUM with preprocessing. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing. 294–307. https://doi.org/10.1145/3357713.3384342 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Sheila A. Greibach. 1968. A Note on Undecidable Properties of Formal Languages. Math. Syst. Theory, 2, 1 (1968), 1–6. https://doi.org/10.1007/BF01691341 Google ScholarGoogle ScholarCross RefCross Ref
  29. Sheila A. Greibach. 1973. The Hardest Context-Free Language. SIAM J. Comput., 2, 4 (1973), 304–310. https://doi.org/10.1137/0202025 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Jakob Cetti Hansen, Adam Husted Kjelstrøm, and Andreas Pavlogiannis. 2021. Tight bounds for reachability problems on one-counter and pushdown systems. Inform. Process. Lett., 171 (2021), 106135. https://doi.org/10.1016/j.ipl.2021.106135 Google ScholarGoogle ScholarCross RefCross Ref
  31. Nevin Heintze and David McAllester. 1997. On the cubic bottleneck in subtyping and flow analysis. In Proceedings of Twelfth Annual IEEE Symposium on Logic in Computer Science. 342–351. https://doi.org/10.1109/lics.1997.614960 Google ScholarGoogle ScholarCross RefCross Ref
  32. Monika Henzinger, Sebastian Krinninger, Danupon Nanongkai, and Thatchaphol Saranurak. 2015. Unifying and strengthening hardness for dynamic problems via the online matrix-vector multiplication conjecture. In Proceedings of the forty-seventh annual ACM symposium on Theory of computing. 21–30. https://doi.org/10.1007/11575467_8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Martin Hirzel, Amer Diwan, and Michael Hind. 2004. Pointer analysis in the presence of dynamic class loading. In European Conference on Object-Oriented Programming. 96–122. https://doi.org/10.1007/978-3-540-24851-4_5 Google ScholarGoogle ScholarCross RefCross Ref
  34. Jens Keppeler. 2020. Answering Conjunctive Queries and FO+ MOD Queries under Updates. https://doi.org/10.4230/LIPIcs.ICDT.2018.8 Google ScholarGoogle ScholarCross RefCross Ref
  35. Adam Husted Kjelstrøm and Andreas Pavlogiannis. 2022. The decidability and complexity of interleaved bidirected Dyck reachability. Proceedings of the ACM on Programming Languages, 6, POPL (2022), 1–26. https://doi.org/10.1145/3498673 Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Rucha Kulkarni, Umang Mathur, and Andreas Pavlogiannis. 2021. Dynamic Data-Race Detection Through the Fine-Grained Lens. In 32nd International Conference on Concurrency Theory. https://doi.org/10.4230/LIPIcs.CONCUR.2021.16 Google ScholarGoogle ScholarCross RefCross Ref
  37. Rio LaVigne, Andrea Lincoln, and Virginia Vassilevska Williams. 2019. Public-key cryptography in the fine-grained setting. In Annual International Cryptology Conference. 605–635. https://doi.org/10.1007/978-3-030-26954-8_20 Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Yuanbo Li, Qirun Zhang, and Thomas Reps. 2020. Fast graph simplification for interleaved Dyck-reachability. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation. 780–793. https://doi.org/10.1145/3385412.3386021 Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Yuanbo Li, Qirun Zhang, and Thomas Reps. 2021. On the complexity of bidirected interleaved Dyck-reachability. Proceedings of the ACM on Programming Languages, 5, POPL (2021), 1–28. https://doi.org/10.1145/3434340 Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Andrea Lincoln and Nikhil Vyas. 2020. Algorithms and Lower Bounds for Cycles and Walks: Small Space and Sparse Graphs. In ITCS (LIPIcs, Vol. 151). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 11:1–11:17. https://doi.org/10.4230/LIPIcs.ITCS.2020.11 Google ScholarGoogle ScholarCross RefCross Ref
  41. Andrea Lincoln, Virginia Vassilevska Williams, and R. Ryan Williams. 2018. Tight Hardness for Shortest Cycles and Paths in Sparse Graphs. In SODA. SIAM, 1236–1252. https://doi.org/10.1137/1.9781611975031.80 Google ScholarGoogle ScholarCross RefCross Ref
  42. V. Benjamin Livshits and Monica S. Lam. 2005. Finding Security Vulnerabilities in Java Applications with Static Analysis. In USENIX Security, Patrick McDaniel (Ed.). USENIX Association. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Steven Lyde, William E Byrd, and Matthew Might. 2015. Control-flow analysis of dynamic languages via pointer analysis. ACM SIGPLAN Notices, 51, 2 (2015), 54–62. https://doi.org/10.1145/2816707.2816712 Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Wim Martens and Tina Trautner. 2018. Evaluation and enumeration problems for regular path queries. In 21st International Conference on Database Theory (ICDT 2018). https://doi.org/10.4230/LIPIcs.ICDT.2018.19 Google ScholarGoogle ScholarCross RefCross Ref
  45. Anders Alnor Mathiasen and Andreas Pavlogiannis. 2021. The fine-grained and parallel complexity of andersen’s pointer analysis. Proc. ACM Program. Lang., 5, POPL (2021), 1–29. https://doi.org/10.1145/3434315 Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Umang Mathur, Andreas Pavlogiannis, and Mahesh Viswanathan. 2020. The complexity of dynamic data race prediction. In Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science. 713–727. https://doi.org/10.1145/3373718.3394783 Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Jirí Matousek. 1991. Computing Dominances in E^n. Inf. Process. Lett., 38, 5 (1991), 277–278. https://doi.org/10.1016/0020-0190(91)90071-o Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. David Melski and Thomas Reps. 2000. Interconvertibility of a class of set constraints and context-free-language reachability. Theoretical Computer Science, 248, 1-2 (2000), 29–98. https://doi.org/10.1016/s0304-3975(00)00049-9 Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Oswaldo Olivo, Isil Dillig, and Calvin Lin. 2015. Static detection of asymptotic performance bugs in collection traversals. In PLDI, David Grove and Steve Blackburn (Eds.). ACM, 369–378. https://doi.org/10.1145/2737924.2737966 Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. David J Pearce, Paul HJ Kelly, and Chris Hankin. 2004. Online cycle detection and difference propagation: Applications to pointer analysis. Software Quality Journal, 12, 4 (2004), 311–337. https://doi.org/10.1023/b:sqjo.0000039791.93071.a2 Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Jakob Rehof and Manuel Fähndrich. 2001. Type-base flow analysis: from polymorphic subtyping to CFL-reachability. In POPL. ACM, 54–66. https://doi.org/10.1145/360204.360208 Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Thomas W. Reps. 1995. Shape Analysis as a Generalized Path Problem. In PEPM. ACM Press, 1–11. https://doi.org/10.1145/215465.215466 Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. 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 ScholarCross RefCross Ref
  54. Thomas W. Reps, Susan Horwitz, and Shmuel Sagiv. 1995. Precise Interprocedural Dataflow Analysis via Graph Reachability. In POPL. ACM Press, 49–61. https://doi.org/10.1145/199448.199462 Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Philipp Johann Schepper. 2018. The Complexity of Formal Language Decision Problems. Google ScholarGoogle Scholar
  56. Lei Shang, Xinwei Xie, and Jingling Xue. 2012. On-demand dynamic summary-based points-to analysis. In CGO. ACM, 264–274. https://doi.org/10.1145/2259016.2259050 Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Yannis Smaragdakis and George Balatsouras. 2015. Pointer Analysis. Found. Trends Program. Lang., 2, 1 (2015), 1–69. https://doi.org/10.1561/9781680830217 Google ScholarGoogle ScholarCross RefCross Ref
  58. Yannis Smaragdakis and Martin Bravenboer. 2010. Using Datalog for Fast and Easy Program Analysis. In Datalog (Lecture Notes in Computer Science, Vol. 6702). Springer, 245–251. https://doi.org/10.1007/978-3-642-24206-9_14 Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Volker Strassen. 1969. Gaussian elimination is not optimal. Numerische mathematik, 13, 4 (1969), 354–356. https://doi.org/10.1007/bf02165411 Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Jeffrey D Ullman and Allen Van Gelder. 1988. Parallel complexity of logical query programs. Algorithmica, 3, 1 (1988), 5–42. https://doi.org/10.1007/bf01762108 Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. John Whaley, Dzintars Avots, Michael Carbin, and Monica S Lam. 2005. Using Datalog with binary decision diagrams for program analysis. In Asian Symposium on Programming Languages and Systems. 97–118. https://doi.org/10.1007/11575467_8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. John Whaley and Monica S Lam. 2002. An efficient inclusion-based points-to analysis for strictly-typed languages. In International Static Analysis Symposium. 180–195. https://doi.org/10.1007/3-540-45789-5_15 Google ScholarGoogle ScholarCross RefCross Ref
  63. Virginia Vassilevska Williams. 2018. On some fine-grained questions in algorithms and complexity. In Proceedings of the International Congress of Mathematicians: Rio de Janeiro 2018. 3447–3487. https://doi.org/10.1142/9789813272880_0188 Google ScholarGoogle ScholarCross RefCross Ref
  64. Virginia Vassilevska Williams and R Ryan Williams. 2018. Subcubic equivalences between path, matrix, and triangle problems. Journal of the ACM (JACM), 65, 5 (2018), 1–38. https://doi.org/10.1145/3186893 Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. Virginia Vassilevska Williams and Yinzhan Xu. 2020. Monochromatic Triangles, Triangle Listing and APSP. In FOCS. IEEE, 786–797. https://doi.org/10.1109/focs46700.2020.00078 Google ScholarGoogle ScholarCross RefCross Ref
  66. Mihalis Yannakakis. 1990. Graph-Theoretic Methods in Database Theory. In PODS. ACM Press, 230–242. https://doi.org/10.1145/298514.298576 Google ScholarGoogle ScholarDigital LibraryDigital Library
  67. Qirun Zhang. 2020. Conditional Lower Bound for Inclusion-Based Points-to Analysis. arXiv preprint arXiv:2007.05569. Google ScholarGoogle Scholar
  68. Xin Zheng and Radu Rugina. 2008. Demand-driven alias analysis for C. In POPL. ACM, 197–208. https://doi.org/10.1145/1328438.1328464 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The Fine-Grained Complexity of CFL 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

        • Article Metrics

          • Downloads (Last 12 months)275
          • Downloads (Last 6 weeks)16

          Other Metrics

        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!