Abstract
A fundamental problem in refinement verification is to check that the language of behaviors of an implementation is included in the language of the specification. We consider the refinement verification problem where the implementation is a multithreaded shared memory system modeled as a multistack pushdown automaton and the specification is an input-deterministic multistack pushdown language. Our main result shows that the context-bounded refinement problem, where we ask that all behaviors generated in runs of bounded number of context switches belong to a specification given by a Dyck language, is decidable and coNP-complete. The more general case of input-deterministic languages follows, with the same complexity. Context-bounding is essential since emptiness for multipushdown automata is already undecidable, and so is the refinement verification problem for the subclass of regular specifications. Input-deterministic languages capture many non-regular specifications of practical interest and our result opens the way for algorithmic analysis of these properties. The context-bounded refinement problem is coNP-hard already with deterministic regular specifications; our result demonstrates that the problem is not harder despite the stronger class of specifications. Our proof introduces several general techniques for formal languages and counter programs and shows that the search for counterexamples can be reduced in non-deterministic polynomial time to the satisfiability problem for existential Presburger arithmetic. These techniques are essential to ensure the coNP upper bound: existing techniques for regular specifications are not powerful enough for decidability, while simple reductions lead to problems that are either undecidable or have high complexities. As a special case, our decidability result gives an algorithmic verification technique to reason about reference counting and re-entrant locking in multithreaded programs.
- Rajeev Alur, Swarat Chaudhuri, and P. Madhusudan. 2011. Software model checking using languages of nested trees. ACM Trans. Program. Lang. Syst., 33, 5 (2011), 15:1–15:45. https://doi.org/10.1145/2039346.2039347
Google Scholar
Digital Library
- Rajeev Alur, Kousha Etessami, and P. Madhusudan. 2004. A Temporal Logic of Nested Calls and Returns. In Tools and Algorithms for the Construction and Analysis of Systems, 10th International Conference, TACAS 2004, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2004, Barcelona, Spain, March 29 - April 2, 2004, Proceedings, Kurt Jensen and Andreas Podelski (Eds.) (Lecture Notes in Computer Science, Vol. 2988). Springer, 467–481. https://doi.org/10.1007/978-3-540-24730-2_35
Google Scholar
Cross Ref
- Rajeev Alur and P. Madhusudan. 2004. Visibly pushdown languages. In Proceedings of the 36th Annual ACM Symposium on Theory of Computing, Chicago, IL, USA, June 13-16, 2004, László Babai (Ed.). ACM, 202–211. https://doi.org/10.1145/1007352.1007390
Google Scholar
Digital Library
- Rajeev Alur and P. Madhusudan. 2009. Adding nesting structure to words. J. ACM, 56, 3 (2009), 16:1–16:43. https://doi.org/10.1145/1516512.1516518
Google Scholar
Digital Library
- Mohamed Faouzi Atig, Ahmed Bouajjani, and Shaz Qadeer. 2011. Context-Bounded Analysis For Concurrent Programs With Dynamic Creation of Threads. Log. Methods Comput. Sci., 7, 4 (2011), https://doi.org/10.2168/LMCS-7(4:4)2011
Google Scholar
Cross Ref
- Pascal Baumann, Rupak Majumdar, Ramanathan S. Thinniyam, and Georg Zetzsche. 2020. The Complexity of Bounded Context Switching with Dynamic Thread Creation. In 47th International Colloquium on Automata, Languages, and Programming, ICALP 2020, July 8-11, 2020, Saarbrücken, Germany (Virtual Conference) (LIPIcs, Vol. 168). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 111:1–111:16. https://doi.org/10.4230/LIPIcs.ICALP.2020.111
Google Scholar
Cross Ref
- Pascal Baumann, Rupak Majumdar, Ramanathan S. Thinniyam, and Georg Zetzsche. 2021. Context-Bounded Verification of Liveness Properties for Multithreaded Shared-Memory Programs. Proceedings of the ACM on Programming Languages (PACMPL), 5, POPL (2021), Article 44, Jan., 31 pages. https://doi.org/10.1145/3434325
Google Scholar
Digital Library
- Jean Berstel and Luc Boasson. 2002. Formal properties of XML grammars and languages. Acta Informatica, 38, 9 (2002), Aug, 649–671. issn:0001-5903, 1432-0525 https://doi.org/10.1007/s00236-002-0085-4
Google Scholar
Cross Ref
- Alberto Bertoni, Christian Choffrut, and Roberto Radicioni. 2011. The Inclusion Problem of Context-Free Languages: Some Tractable Cases. Int. J. Found. Comput. Sci., 22, 2 (2011), 289–299. https://doi.org/10.1142/S0129054111008040
Google Scholar
Cross Ref
- Michael Blondin, Matthias Englert, Alain Finkel, Stefan Göller, Christoph Haase, Ranko Lazic, Pierre McKenzie, and Patrick Totzke. 2021. The Reachability Problem for Two-Dimensional Vector Addition Systems with States. J. ACM, 68, 5 (2021), 34:1–34:43. https://doi.org/10.1145/3464794
Google Scholar
Digital Library
- I. Borosh and L. B. Treybig. 1976. Bounds on Positive Integral Solutions of Linear Diophantine Equations. Proc. Amer. Math. Soc., 55, 2 (1976), 299–304.
Google Scholar
Cross Ref
- Wojciech Czerwiński and Ł ukasz Orlikowski. 2021. Reachability in Vector Addition Systems is Ackermann-complete. In 62nd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2021, Denver, CO, USA, February 7-10, 2022. IEEE, 1229–1240. https://doi.org/10.1109/FOCS52979.2021.00120
Google Scholar
Cross Ref
- Leonardo Mendonça de Moura and Nikolaj S. Bjørner. 2008. Z3: An Efficient SMT Solver. In Tools and Algorithms for the Construction and Analysis of Systems, 14th International Conference, TACAS 2008, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2008, Budapest, Hungary, March 29-April 6, 2008. Proceedings, C. R. Ramakrishnan and Jakob Rehof (Eds.) (Lecture Notes in Computer Science, Vol. 4963). Springer, 337–340. https://doi.org/10.1007/978-3-540-78800-3_24
Google Scholar
Cross Ref
- Michael Emmi, Ranjit Jhala, Eddie Kohler, and Rupak Majumdar. 2009. Verifying Reference Counting Implementations. In Tools and Algorithms for the Construction and Analysis of Systems, 15th International Conference, TACAS 2009, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, York, UK, March 22-29, 2009. Proceedings, Stefan Kowalewski and Anna Philippou (Eds.) (Lecture Notes in Computer Science, Vol. 5505). Springer, 352–367. https://doi.org/10.1007/978-3-642-00768-2_30
Google Scholar
Digital Library
- Matthias Englert, Piotr Hofman, Slawomir Lasota, Ranko Lazic, Jérôme Leroux, and Juliusz Straszynski. 2021. A lower bound for the coverability problem in acyclic pushdown VAS. Inf. Process. Lett., 167 (2021), 106079. https://doi.org/10.1016/j.ipl.2020.106079
Google Scholar
Cross Ref
- Azadeh Farzan, Zachary Kincaid, and Andreas Podelski. 2014. Proofs that count. In The 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’14, San Diego, CA, USA, January 20-21, 2014, Suresh Jagannathan and Peter Sewell (Eds.). ACM, 151–164. https://doi.org/10.1145/2535838.2535885
Google Scholar
Digital Library
- Kostas Ferles, Jon Stephens, and Isil Dillig. 2021. Verifying correct usage of context-free API protocols. Proc. ACM Program. Lang., 5, POPL (2021), 1–30. https://doi.org/10.1145/3434298
Google Scholar
Digital Library
- Emmanuel Filiot, Jean-François Raskin, Pierre-Alain Reynier, Frédéric Servais, and Jean-Marc Talbot. 2018. Visibly pushdown transducers. J. Comput. Syst. Sci., 97 (2018), 147–181. https://doi.org/10.1016/j.jcss.2018.05.002
Google Scholar
Cross Ref
- Emily P. Friedman. 1976. The inclusion problem for simple languages. Theoretical Computer Science, 1:4 (1976), 297–316.
Google Scholar
Cross Ref
- Sheila A Greibach and Emily P Friedman. 1980. Superdeterministic PDAs: A subcase with a decidable inclusion problem. Journal of the ACM (JACM), 27, 4 (1980), 675–700.
Google Scholar
Digital Library
- Omar Inverso, Ermenegildo Tomasco, Bernd Fischer, Salvatore La Torre, and Gennaro Parlato. 2022. Bounded Verification of Multi-threaded Programs via Lazy Sequentialization. ACM Trans. Program. Lang. Syst., 44, 1 (2022), 1:1–1:50. https://doi.org/10.1145/3478536
Google Scholar
Digital Library
- Donald E. Knuth. 1967. A Characterization of Parenthesis Languages. Information and Control, 11, 3 (1967), Sept., 269–289. issn:00199958 https://doi.org/10.1016/S0019-9958(67)90564-5
Google Scholar
Cross Ref
- Naoki Kobayashi. 2019. Inclusion between the frontier language of a non-deterministic recursive program scheme and the Dyck language is undecidable. Theoretical Computer Science, 777 (2019), 409–416.
Google Scholar
Digital Library
- Salvatore La Torre, P. Madhusudan, and Gennaro Parlato. 2009. Reducing Context-Bounded Concurrent Reachability to Sequential Reachability. In Computer Aided Verification, 21st International Conference, CAV 2009, Grenoble, France, June 26 - July 2, 2009. Proceedings, Ahmed Bouajjani and Oded Maler (Eds.) (Lecture Notes in Computer Science, Vol. 5643). Springer, 477–492. https://doi.org/10.1007/978-3-642-02658-4_36
Google Scholar
Digital Library
- Salvatore La Torre, Parthasarathy Madhusudan, and Gennaro Parlato. 2010. The Language Theory of Bounded Context-Switching. In LATIN 2010: Theoretical Informatics, 9th Latin American Symposium, Oaxaca, Mexico, April 19-23, 2010, Proceedings (Lecture Notes in Computer Science, Vol. 6034). Springer, 96–107. https://doi.org/10.1007/978-3-642-12200-2_10
Google Scholar
Digital Library
- Akash Lal and Thomas W. Reps. 2009. Reducing concurrent analysis under a context bound to sequential analysis. Formal Methods in System Design, 35, 1 (2009), 73–97. https://doi.org/10.1007/s10703-009-0078-9
Google Scholar
Digital Library
- Akash Lal, Tayssir Touili, Nicholas Kidd, and Thomas Reps. 2008. Interprocedural Analysis of Concurrent Programs under a Context Bound. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, 282–298.
Google Scholar
Cross Ref
- Jérôme Leroux. 2021. The Reachability Problem for Petri Nets is Not Primitive Recursive. In 62nd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2021, Denver, CO, USA, February 7-10, 2022. IEEE, 1241–1252. https://doi.org/10.1109/FOCS52979.2021.00121
Google Scholar
Cross Ref
- Jérôme Leroux and Sylvain Schmitz. 2019. Reachability in Vector Addition Systems is Primitive-Recursive in Fixed Dimension. In Proceedings of the 34th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2019, Vancouver, Canada, June 24-27, 2019. 1–13. https://doi.org/10.1109/LICS.2019.8785796
Google Scholar
Cross Ref
- Jérôme Leroux and Grégoire Sutre. 2004. On Flatness for 2-Dimensional Vector Addition Systems with States. In CONCUR 2004 - Concurrency Theory, 15th International Conference, London, UK, August 31 - September 3, 2004, Proceedings, Philippa Gardner and Nobuko Yoshida (Eds.) (Lecture Notes in Computer Science, Vol. 3170). Springer, 402–416. https://doi.org/10.1007/978-3-540-28644-8_26
Google Scholar
Cross Ref
- Jérôme Leroux, Grégoire Sutre, and Patrick Totzke. 2015. On the Coverability Problem for Pushdown Vector Addition Systems in One Dimension. In Automata, Languages, and Programming - 42nd International Colloquium, ICALP 2015, Kyoto, Japan, July 6-10, 2015, Proceedings, Part II, Magnús M. Halldórsson, Kazuo Iwama, Naoki Kobayashi, and Bettina Speckmann (Eds.) (Lecture Notes in Computer Science, Vol. 9135). Springer, 324–336. https://doi.org/10.1007/978-3-662-47666-6_26
Google Scholar
Digital Library
- Xie Li, Taolue Chen, Zhilin Wu, and Mingji Xia. 2020. Computing Linear Arithmetic Representation of Reachability Relation of One-Counter Automata. In Dependable Software Engineering. Theories, Tools, and Applications - 6th International Symposium, SETTA 2020, Guangzhou, China, November 24-27, 2020, Proceedings, Jun Pang and Lijun Zhang (Eds.) (Lecture Notes in Computer Science, Vol. 12153). Springer, 89–107. https://doi.org/10.1007/978-3-030-62822-2_6
Google Scholar
Digital Library
- Richard J Lipton and Yechezkel Zalcstein. 1977. Word problems solvable in logspace. Journal of the ACM (JACM), 24, 3 (1977), 522–526.
Google Scholar
Digital Library
- Raphaela Löbel, Michael Luttenberger, and Helmut Seidl. 2021. On the Balancedness of Tree-to-Word Transducers. Int. J. Found. Comput. Sci., 32, 6 (2021), 761–783. https://doi.org/10.1142/S0129054121420077
Google Scholar
Cross Ref
- Markus Lohrey. 2012. Algorithmics on SLP-compressed strings: A survey. Groups Complex. Cryptol., 4, 2 (2012), 241–299. https://doi.org/10.1515/gcc-2012-0016
Google Scholar
Cross Ref
- Ravichandhran Madhavan, Mikaël Mayer, Sumit Gulwani, and Viktor Kuncak. 2015. Automating grammar comparison. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, part of SPLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015, Jonathan Aldrich and Patrick Eugster (Eds.). ACM, 183–200. https://doi.org/10.1145/2814270.2814304
Google Scholar
Digital Library
- P. Madhusudan and Gennaro Parlato. 2011. The tree width of auxiliary storage. In Proceedings of the 38th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2011, Austin, TX, USA, January 26-28, 2011, Thomas Ball and Mooly Sagiv (Eds.). ACM, 283–294. https://doi.org/10.1145/1926385.1926419
Google Scholar
Digital Library
- Sebastian Maneth and Helmut Seidl. 2018. Balancedness of MSO transductions in polynomial time. Inform. Process. Lett., 133 (2018), 26–32.
Google Scholar
Cross Ref
- Roland Meyer, Sebastian Muskalla, and Georg Zetzsche. 2018. Bounded Context Switching for Valence Systems. In 29th International Conference on Concurrency Theory, CONCUR 2018, September 4-7, 2018, Beijing, China, Sven Schewe and Lijun Zhang (Eds.) (LIPIcs, Vol. 118). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 12:1–12:18. https://doi.org/10.4230/LIPIcs.CONCUR.2018.12
Google Scholar
Cross Ref
- Andrzej S. Murawski, C.-H. Luke Ong, and Igor Walukiewicz. 2005. Idealized Algol with Ground Recursion, and DPDA Equivalence. In Automata, Languages and Programming, 32nd International Colloquium, ICALP 2005, Lisbon, Portugal, July 11-15, 2005, Proceedings, Luís Caires, Giuseppe F. Italiano, Luís Monteiro, Catuscia Palamidessi, and Moti Yung (Eds.) (Lecture Notes in Computer Science, Vol. 3580). Springer, 917–929. https://doi.org/10.1007/11523468_74
Google Scholar
Digital Library
- Madanlal Musuvathi and Shaz Qadeer. 2007. Iterative context bounding for systematic testing of multithreaded programs. In Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation, PLDI 2007, San Diego, CA, USA, June 10-13, 2007. ACM, 446–455. https://doi.org/10.1145/1250734.1250785
Google Scholar
Digital Library
- Tmima Olshansky and Amir Pnueli. 1977. A direct algorithm for checking equivalence of LL(k) grammars. Theoretical Computer Science, 4, 3 (1977), 321–349. issn:0304-3975 https://doi.org/10.1016/0304-3975(77)90016-0
Google Scholar
Cross Ref
- C.-H. Luke Ong. 2002. Observational Equivalence of 3rd-Order Idealized Algol is Decidable. In 17th IEEE Symposium on Logic in Computer Science (LICS 2002), 22-25 July 2002, Copenhagen, Denmark, Proceedings. IEEE Computer Society, 245–256. https://doi.org/10.1109/LICS.2002.1029833
Google Scholar
Cross Ref
- Wojciech Plandowski. 1994. Testing Equivalence of Morphisms on Context-Free Languages. In Algorithms - ESA ’94, Second Annual European Symposium, Utrecht, The Netherlands, September 26-28, 1994, Proceedings, Jan van Leeuwen (Ed.) (Lecture Notes in Computer Science, Vol. 855). Springer, 460–470. https://doi.org/10.1007/BFb0049431
Google Scholar
Cross Ref
- 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. https://doi.org/10.1007/978-3-540-31980-1_7
Google Scholar
Digital Library
- Shaz Qadeer and Dinghao Wu. 2004. KISS: keep it simple and sequential. In Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation 2004, Washington, DC, USA, June 9-11, 2004, William W. Pugh and Craig Chambers (Eds.). ACM, 14–24. https://doi.org/10.1145/996841.996845
Google Scholar
Digital Library
- Thomas W. Reps, Susan Horwitz, and Shmuel Sagiv. 1995. Precise Interprocedural Dataflow Analysis via Graph Reachability. In Conference Record of POPL’95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Francisco, California, USA, January 23-25, 1995, Ron K. Cytron and Peter Lee (Eds.). ACM Press, 49–61. https://doi.org/10.1145/199448.199462
Google Scholar
Digital Library
- Thomas W. Reps, Stefan Schwoon, Somesh Jha, and David Melski. 2005. Weighted pushdown systems and their application to interprocedural dataflow analysis. Sci. Comput. Program., 58, 1-2 (2005), 206–263. https://doi.org/10.1016/j.scico.2005.02.009
Google Scholar
Digital Library
- Robert W Ritchie and Frederick N Springsteel. 1972. Language recognition by marking automata. Information and Control, 20, 4 (1972), 313–330.
Google Scholar
Cross Ref
- Daniel J. Rosenkrantz and Richard E. Stearns. 1970. Properties of deterministic top-down grammars. Information and Control, 17, 3 (1970), 226–256. issn:0019-9958 https://doi.org/10.1016/S0019-9958(70)90446-8
Google Scholar
Cross Ref
- Shmuel Sagiv, Thomas W. Reps, and Susan Horwitz. 1996. Precise Interprocedural Dataflow Analysis with Applications to Constant Propagation. Theor. Comput. Sci., 167, 1&2 (1996), 131–170. https://doi.org/10.1016/0304-3975(96)00072-2
Google Scholar
Digital Library
- Saul Schleimer. 2008. Polynomial-time word problems. Commentarii mathematici helvetici, 83, 4 (2008), 741–765.
Google Scholar
- Géraud Sénizergues. 1997. The equivalence problem for deterministic pushdown automata is decidable. In International Colloquium on Automata, Languages, and Programming. 671–681.
Google Scholar
- Aneesh K. Shetty, Shankara Narayanan Krishna, and Georg Zetzsche. 2021. Scope-Bounded Reachability in Valence Systems. In 32nd International Conference on Concurrency Theory, CONCUR 2021, August 24-27, 2021, Virtual Conference, Serge Haddad and Daniele Varacca (Eds.) (LIPIcs, Vol. 203). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 29:1–29:19. https://doi.org/10.4230/LIPIcs.CONCUR.2021.29
Google Scholar
Cross Ref
- Michael Sipser. 2012. Introduction to the Theory of Computation (3rd ed.). Cengage Learning, Inc.
Google Scholar
- Salvatore La Torre, Margherita Napoli, and Gennaro Parlato. 2020. Reachability of scope-bounded multistack pushdown systems. Inf. Comput., 275 (2020), 104588. https://doi.org/10.1016/j.ic.2020.104588
Google Scholar
Cross Ref
- Akihiko Tozawa and Yasuhiko Minamide. 2007. Complexity Results on Balanced Context-Free Languages. In Foundations of Software Science and Computational Structures, 10th International Conference, FOSSACS 2007, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2007, Braga, Portugal, March 24-April 1, 2007, Proceedings, Helmut Seidl (Ed.) (Lecture Notes in Computer Science, Vol. 4423). Springer, 346–360. https://doi.org/10.1007/978-3-540-71389-0_25
Google Scholar
Cross Ref
- Akihiko Tozawa and Yasuhiko Minamide. 2007. Complexity Results on Balanced Context-Free Languages (Lecture Notes in Computer Science, Vol. 4423). Springer Berlin Heidelberg, 346–360. isbn:978-3-540-71388-3 https://doi.org/10.1007/978-3-540-71389-0_25
Google Scholar
Cross Ref
- Kumar Neeraj Verma, Helmut Seidl, and Thomas Schwentick. 2005. On the Complexity of Equational Horn Clauses. In Automated Deduction - CADE-20, 20th International Conference on Automated Deduction, Tallinn, Estonia, July 22-27, 2005, Proceedings, Robert Nieuwenhuis (Ed.) (Lecture Notes in Computer Science, Vol. 3632). Springer, 337–352. https://doi.org/10.1007/11532231_25
Google Scholar
Digital Library
Index Terms
Context-Bounded Verification of Context-Free Specifications
Recommendations
Context-bounded verification of thread pools
Thread pooling is a common programming idiom in which a fixed set of worker threads are maintained to execute tasks concurrently. The workers repeatedly pick tasks and execute them to completion. Each task is sequential, with possibly recursive code, ...
Context-bounded verification of liveness properties for multithreaded shared-memory programs
We study context-bounded verification of liveness properties of multi-threaded, shared-memory programs, where each thread can spawn additional threads. Our main result shows that context-bounded fair termination is decidable for the model; context-...
Limited Automata and Context-Free Languages
Non-Classical Models of Automata and Applications VLimited automata are one-tape Turing machines which are allowed to rewrite each tape cell only in the first d visits, for a given constant d. For each d ≥ 2, these devices characterize the class of context-free languages. We investigate the equivalence ...






Comments