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.
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- Lars Ole Andersen. 1994. Program analysis and specialization for the C programming language. Ph. D. Dissertation. Citeseer.
Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Peter Chini. 2022. Fine-Grained Complexity of Program Verification. Ph. D. Dissertation.
Google Scholar
- 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 Scholar
Cross Ref
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- Sheila A. Greibach. 1973. The Hardest Context-Free Language. SIAM J. Comput., 2, 4 (1973), 304–310. https://doi.org/10.1137/0202025
Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- Jens Keppeler. 2020. Answering Conjunctive Queries and FO+ MOD Queries under Updates. https://doi.org/10.4230/LIPIcs.ICDT.2018.8
Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- Philipp Johann Schepper. 2018. The Complexity of Formal Language Decision Problems.
Google Scholar
- 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 Scholar
Digital Library
- Yannis Smaragdakis and George Balatsouras. 2015. Pointer Analysis. Found. Trends Program. Lang., 2, 1 (2015), 1–69. https://doi.org/10.1561/9781680830217
Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- Volker Strassen. 1969. Gaussian elimination is not optimal. Numerische mathematik, 13, 4 (1969), 354–356. https://doi.org/10.1007/bf02165411
Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- Mihalis Yannakakis. 1990. Graph-Theoretic Methods in Database Theory. In PODS. ACM Press, 230–242. https://doi.org/10.1145/298514.298576
Google Scholar
Digital Library
- Qirun Zhang. 2020. Conditional Lower Bound for Inclusion-Based Points-to Analysis. arXiv preprint arXiv:2007.05569.
Google Scholar
- 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 Scholar
Digital Library
Index Terms
The Fine-Grained Complexity of CFL Reachability
Recommendations
The fine-grained and parallel complexity of andersen’s pointer analysis
Pointer analysis is one of the fundamental problems in static program analysis. Given a set of pointers, the task is to produce a useful over-approximation of the memory locations that each pointer may point-to at runtime. The most common formulation is ...
Optimal Dyck reachability for data-dependence and alias analysis
A fundamental algorithmic problem at the heart of static analysis is Dyck reachability. The input is a graph where the edges are labeled with different types of opening and closing parentheses, and the reachability information is computed via paths ...
Fine-grained parameterized complexity analysis of graph coloring problems
AbstractThe q-Coloring problem asks whether the vertices of a graph can be properly colored with q colors. In this paper we perform a fine-grained analysis of the complexity of q-Coloring with respect to a hierarchy of structural parameters. ...






Comments