Language-Theoretic Abstraction Refinement

  • Zhenyue Long
  • Georgel Calin
  • Rupak Majumdar
  • Roland Meyer
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7212)


We give a language-theoretic counterexample-guided abstraction refinement (CEGAR) algorithm for the safety verification of recursive multi-threaded programs. First, we reduce safety verification to the (undecidable) language emptiness problem for the intersection of context-free languages. Initially, our CEGAR procedure overapproximates the intersection by a context-free language. If the overapproximation is empty, we declare the system safe. Otherwise, we compute a bounded language from the overapproximation and check emptiness for the intersection of the context free languages and the bounded language (which is decidable). If the intersection is non-empty, we report a bug. If empty, we refine the overapproximation by removing the bounded language and try again. The key idea of the CEGAR loop is the language-theoretic view: different strategies to get regular overapproximations and bounded approximations of the intersection give different implementations. We give concrete algorithms to approximate context-free languages using regular languages and to generate bounded languages representing a family of counterexamples. We have implemented our algorithms and provide an experimental comparison on various choices for the regular overapproximation and the bounded underapproximation.


Regular Language Context Free Grammar Resource Allocator Downward Closure Multithreaded Program 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Armstrong, J., Virding, R., Wikström, C., Williams, M.: Concurrent Programming in Erlang, 2nd edn. Prentice Hall (1996)Google Scholar
  2. 2.
    Ball, T., Rajamani, S.K.: The SLAM project: debugging system software via static analysis. In: POPL 2002: Principles of Programming Languages, pp. 1–3. ACM (2002)Google Scholar
  3. 3.
    Bouajjani, A., Esparza, J., Touili, T.: A generic approach to the static analysis of concurrent programs with procedures. International Journal on Foundations of Computer Science 14(4), 551–582 (2003)MathSciNetzbMATHCrossRefGoogle Scholar
  4. 4.
    Chaki, S., Clarke, E., Kidd, N., Reps, T., Touili, T.: Verifying Concurrent Message-Passing C Programs with Recursive Calls. In: Hermanns, H. (ed.) TACAS 2006. LNCS, vol. 3920, pp. 334–349. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  5. 5.
    Clarke, E.M., Grumberg, O., Jha, S., Lu, Y., Veith, H.: Counterexample-guided abstraction refinement for symbolic model checking. J. ACM 50(5), 752–794 (2003)MathSciNetCrossRefGoogle Scholar
  6. 6.
    Clarke, E.M., Talupur, M., Veith, H.: Proving Ptolemy Right: The Environment Abstraction Framework for Model Checking Concurrent Systems. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 33–47. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  7. 7.
    Eğecioğlu, Ö.: Strongly Regular Grammars and Regular Approximation of Context-Free Languages. In: Diekert, V., Nowotka, D. (eds.) DLT 2009. LNCS, vol. 5583, pp. 207–220. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  8. 8.
    Esparza, J., Ganty, P.: Complexity of pattern-based verification for multithreaded programs. In: POPL 2011: Principles of Programming Languages, pp. 499–510. ACM (2011)Google Scholar
  9. 9.
    Ganty, P., Majumdar, R., Monmege, B.: Bounded Underapproximations. In: Touili, T., Cook, B., Jackson, P. (eds.) CAV 2010. LNCS, vol. 6174, pp. 600–614. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  10. 10.
    Ginsburg, S., Spanier, E.H.: Bounded Algol-like languages. Transactions of the American Mathematical Society 113(2), 333–368 (1964)MathSciNetzbMATHGoogle Scholar
  11. 11.
    Gupta, A., Popeea, C., Rybalchenko, A.: Predicate abstraction and refinement for verifying multi-threaded programs. In: POPL 2011: Principles of Programming Languages, pp. 331–344. ACM (2011)Google Scholar
  12. 12.
    Henzinger, T.A., Jhala, R., Majumdar, R.: Race checking by context inference. In: PLDI 2004: Programming Language Design and Implementation, pp. 1–13. ACM (2004)Google Scholar
  13. 13.
    Henzinger, T.A., Jhala, R., Majumdar, R., Qadeer, S.: Thread-Modular Abstraction Refinement. In: Hunt Jr., W.A., Somenzi, F. (eds.) CAV 2003. LNCS, vol. 2725, pp. 262–274. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  14. 14.
    Henzinger, T.A., Jhala, R., Majumdar, R., Sutre, G.: Lazy abstraction. In: POPL 2002: Principles of Programming Languages, pp. 58–70. ACM (2002)Google Scholar
  15. 15.
    Hopcroft, J.E., Ullman, J.D.: Introduction to Automata Theory, Languages and Computation. Addison-Wesley (1979)Google Scholar
  16. 16.
    Kahlon, V.: Boundedness vs. unboundedness of lock chains: Characterizing decidability of pairwise CFL-reachability for threads communicating via locks. In: LICS 2009: Logic in Computer Science, pp. 27–36. IEEE Computer Society (2009)Google Scholar
  17. 17.
    Kahlon, V., Gupta, A.: On the analysis of interacting pushdown systems. In: POPL 2003: Principles of Programming Languages, pp. 303–314. ACM (2007)Google Scholar
  18. 18.
    Kidd, N.: Bluetooth protocol,
  19. 19.
    Lal, A., Reps, T.: Reducing Concurrent Analysis Under a Context Bound to Sequential Analysis. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 37–51. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  20. 20.
    Latteux, M., Leguy, J.: Une propriété de la famille GRE. In: FCT 1979, pp. 255–261. Akademie-Verlag (1979)Google Scholar
  21. 21.
    Mohri, M., Nederhof, M.-J.: Regular approximation of context-free grammars through transformation. In: Robustness in Language and Speech Technology, vol. 9, pp. 251–261. Kluwer Academic Publishers (2000)Google Scholar
  22. 22.
    Patin, G., Sighireanu, M., Touili, T.: Spade: Verification of Multithreaded Dynamic and Recursive Programs. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 254–257. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  23. 23.
    Qadeer, S., Rehof, J.: Context-Bounded Model Checking of Concurrent Software. In: Halbwachs, N., Zuck, L.D. (eds.) TACAS 2005. LNCS, vol. 3440, pp. 93–107. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  24. 24.
    Qadeer, S., Wu, D.: Kiss: keep it simple and sequential. In: PLDI 2004: Programming Language Design and Implementation, pp. 14–24. ACM (2004)Google Scholar
  25. 25.
    Ben Rajeb, N., Nasraoui, B., Robbana, R., Touili, T.: Verifying multithreaded recursive programs with integer variables. Electr. Notes Theor. Comput. Sci. 239, 143–154 (2009)CrossRefGoogle Scholar
  26. 26.
    Ramalingam, G.: Context-sensitive synchronization-sensitive analysis is undecidable. ACM TOPLAS 22(2), 416–430 (2000)CrossRefGoogle Scholar
  27. 27.
    Suwimonteerabuth, D., Esparza, J., Schwoon, S.: Symbolic Context-Bounded Analysis of Multithreaded Java Programs. In: Havelund, K., Majumdar, R. (eds.) SPIN 2008. LNCS, vol. 5156, pp. 270–287. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  28. 28.
    van Leeuwen, J.: Effective constructions in well-partially-ordered free monoids. Discrete Mathematics 21(3), 237–252 (1978)MathSciNetCrossRefGoogle Scholar
  29. 29.
    Peterson, G.L.: Myths about the mutual exclusion problem. Inf. Process. Lett. 3(12), 115–116 (1981)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Zhenyue Long
    • 1
    • 2
    • 3
  • Georgel Calin
    • 4
  • Rupak Majumdar
    • 1
  • Roland Meyer
    • 4
  1. 1.Max Planck Institute for Software SystemsGermany
  2. 2.State Key Laboratory of Computer Science, Institute of SoftwareChinese Academy of SciencesChina
  3. 3.Graduate University, Chinese Academy of SciencesChina
  4. 4.Department of Computer ScienceUniversity of KaiserslauternGermany

Personalised recommendations