Skip to main content
Log in

Automata-based verification of programs with tree updates

  • Original Article
  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

This paper describes a verification framework for Hoare-style pre- and post-conditions of programs manipulating balanced tree-like data structures. Since the considered verification problem is undecidable, we appeal to the standard semi-algorithmic approach in which the user has to provide loop invariants, which are then automatically checked, together with the program pre- and post-conditions. We specify sets of program states, representing tree-like memory configurations, using Tree Automata with Size Constraints (TASC). The main advantage of this new class of tree automata is that they recognise tree languages based on arithmetic reasoning about the lengths of various (possibly all) paths in trees, like, e.g., in AVL trees or red–black trees. TASCs are closed under union, intersection, and complement, and their emptiness problem is decidable. Thus we obtain a class of automata which are an interesting theoretical contribution by itself. Further, we show that, under few restrictions, one can automatically compute the effect of tree-updating program statements on the set of configurations represented by a TASC, which makes TASC a practical verification tool. We tried out our approach on the insertion procedure for red–black trees, for which we verified that the output on an arbitrary balanced red–black tree is also a balanced red–black tree.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Alur, R., Madhusudan, P.: Visibly pushdown languages. In: Proceedings of STOC’04. ACM Press (2004)

  2. Baldan, P., Corradini, A., Esparza, J., Heindel, T., König, B., Kozioura, V.: Verifying red–black trees. In: Proceedings of COSMICAH’05 (2005)

  3. Barnett, M., Rustan, K., Leino, M., Schulte, W.: The Spec# programming system: an overview. In: Proceedings of CASSIS’04. Lectures Notes in Computer Science, vol. 3362. Springer (2004)

  4. Bouajjani, A., Esparza, J., Maler, O.: Reachability analysis of pushdown automata: application to model-checking. In: Proceedings of CONCUR’97. Lectures Notes in Computer Science, vol. 1243. Springer (1997)

  5. Bouajjani, A., Habermehl, P., Rogalewicz, A., Vojnar, T.: Abstract regular tree model checking of complex dynamic data structures. In: Proceedings of the 13th International Symposium Static Analysis (SAS’06). Lecture Notes in Computer Science, vol. 4134, pp. 52–70. Springer (2006)

  6. Burdy L., Cheon Y., Cok D., Ernst M., Kiniry J., Leavens G.T., Rustan K., Leino M., Poll E.: An overview of JML tools and applications. Int. J. Softw. Tools Technol. Transf. 7(3), 212–232 (2005)

    Article  Google Scholar 

  7. Calcagno, C., Gardner, P., Zarfaty, U.: Context logic and tree update. In: Proceedings of POPL’05. ACM Press (2005)

  8. Comon-Lundh H., Cortier V.: Tree automata with one memory, set constraints and cryptographic protocols. Theo. Comput. Sci. 331, 143–214 (2005)

    Article  Google Scholar 

  9. Comon-Lundh, H., Dauchet, M., Gilleron, R., Jacquemard, F., Lugiez, D., Tison, S., Tommasi. M.: Tree automata techniques and applications. Available at: http://www.grappa.univ-lille3.fr/tata. Release Oct 1, 2002 (1997)

  10. Comon-Lundh, H., Jaquemard, F., Perrin, N.: Tree automata with memory, visibility and structural constraints. In: Proceedings of FoSSaCS. Lecture Notes in Computer Science, vol. 4423. Springer (2007)

  11. Cormen T.H., Leiserson C.E., Rivest R.L.: Introduction to Algorithms. The MIT Press, Cambridge (1990)

    MATH  Google Scholar 

  12. Dal Zilio, S., Lugiez, D.: Multitrees automata, Presburger’s constraints and tree logics. Technical Report 08-2002, LIF (2002)

  13. Darga, P.T., Boyapati, C.: Efficient software model checking of data structure properties. In: Proceedings of OOPSLA’06. ACM Press (2006)

  14. Geidmanis D.: Unsolvability of the emptiness problem for alternating 1-way multi-head and multi-tape finite automata over single-letter alphabet. Comput. Artif. Intell. 10, 133–141 (1991)

    MATH  MathSciNet  Google Scholar 

  15. Khurshid S., Marinov D.: TestEra: specification-based testing of Java programs using SAT. Automat. Softw. Eng. 11(4), 403–434 (2004)

    Article  Google Scholar 

  16. Manna, Z., Sipma, H.B., Zhang, T.: Verifying balanced trees. In: Proceedings of the Symposium on Logical Foundations of Computer Science (LFCS 2007). Lecture Notes in Computer Science, vol. 4514. Springer (2007)

  17. Moeller, A., Schwartzbach, M.: The pointer assertion logic engine. In: Proceeedings of PLDI’01. ACM Press (2001)

  18. Nguyen, H.H., David, C., Qin, S., Chin, W.N.: Automated verification of shape and size properties via separation logic. In: Proceedings of VMCAI’07. Lecture Notes in Computer Science, vol. 4349. Springer (2007)

  19. Parduhn, S.: Algorithm animation using shape analysis with special regard to binary trees. Technical Report, Universität des Saarlandes (2005)

  20. Petersen, H.: Alternation in simple devices. In: Proceedings of ICALP’95. Lecture Notes in Computer Science, vol. 944. Springer (1995)

  21. Rabin M.O.: Decidability of second order theories and automata on infinite trees. Trans. Am. Math. Soc. 141, 1–35 (1969)

    Article  MATH  MathSciNet  Google Scholar 

  22. Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: Proceedings of LICS’02. IEEE Computer Society Press (2002)

  23. Rugina, R.: Quantitative shape analysis. In: Proceedings of SAS’04. Lecture Notes in Computer Sciences, vol. 3148. Springer (2004)

  24. Sagiv S., Reps T.W., Wilhelm R.: Parametric shape analysis via 3-valued logic. TOPLAS 24(3), 217–298 (2002)

    Article  Google Scholar 

  25. Seidl, H., Schwentick, T., Muscholl, A., Habermehl, P.: Counting in trees for free. In: Proceedings of ICALP’04. Lecture Notes in Computer Sciences, vol. 3142. Springer (2004)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Peter Habermehl.

Additional information

A short version of this paper appeared in the Proceedings of TACAS 2006. The work was supported by the French Ministry of Research (RNTL project AVERILES), the Czech Science Foundation within the project 102/07/0322, the Czech-French Barrande project MEB 020840, and the Czech Ministry of Education, Youth, and Sports by the project MSM 0021630528.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Habermehl, P., Iosif, R. & Vojnar, T. Automata-based verification of programs with tree updates. Acta Informatica 47, 1–31 (2010). https://doi.org/10.1007/s00236-009-0108-5

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-009-0108-5

Keywords

Navigation