Skip to main content

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3855))

Abstract

We introduce field constraint analysis, a new technique for verifying data structure invariants. A field constraint for a field is a formula specifying a set of objects to which the field can point. Field constraints enable the application of decidable logics to data structures which were originally beyond the scope of these logics, by verifying the backbone of the data structure and then verifying constraints on fields that cross-cut the backbone in arbitrary ways. Previously, such cross-cutting fields could only be verified when they were uniquely determined by the backbone, which significantly limits the range of analyzable data structures.

Field constraint analysis permits non-deterministic field constraints on cross-cutting fields, which allows the verificiation of invariants for data structures such as skip lists. Non-deterministic field constraints also enable the verification of invariants between data structures, yielding an expressive generalization of static type declarations.

The generality of our field constraints requires new techniques. We present one such technique and prove its soundness. We have implemented this technique as part of a symbolic shape analysis deployed in the context of the Hob system for verifying data structure consistency. Using this implementation we were able to verify data structures that were previously beyond the reach of similar techniques.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Back, R.-J., von Wright, J.: Refinement Calculus. Springer, Heidelberg (1998)

    MATH  Google Scholar 

  2. Balaban, I., Pnueli, A., Zuck, L.: Shape analysis by predicate abstraction. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, pp. 164–180. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  3. Cousot, P., Cousot, R.: Systematic design of program analysis frameworks. In: POPL, pp. 269–282 (1979)

    Google Scholar 

  4. Dams, D., Namjoshi, K.S.: Shape analysis through predicate abstraction and model checking. In: Zuck, L.D., Attie, P.C., Cortesi, A., Mukhopadhyay, S. (eds.) VMCAI 2003. LNCS, vol. 2575, pp. 310–323. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  5. Fradet, P., Métayer, D.L.: Shape types. In: Proc. 24th ACM POPL (1997)

    Google Scholar 

  6. Ghiya, R., Hendren, L.: Is it a tree, a DAG, or a cyclic graph? In: Proc. 23rd ACM POPL (1996)

    Google Scholar 

  7. Grädel, E.: Decidable fragments of first-order and fixed-point logic. From prefix-vocabulary classes to guarded logics. In: Proceedings of Kalmár Workshop on Logic and Computer Science, Szeged (2003)

    Google Scholar 

  8. Henzinger, T.A., Jhala, R., Majumdar, R., Sutre, G.: Lazy abstraction. In: POPL (2002)

    Google Scholar 

  9. Immerman, N.: Descriptive Complexity. Springer, Heidelberg (1998)

    Google Scholar 

  10. Immerman, N., Rabinovich, A.M., Reps, T.W., Sagiv, S., Yorsh, G.: The boundary between decidability and undecidability for transitive-closure logics. In: Computer Science Logic (CSL), pp. 160–174 (2004)

    Google Scholar 

  11. Immerman, N., Rabinovich, A.M., Reps, T.W., Sagiv, S., Yorsh, G.: Verification via structure simulation. In: Alur, R., Peled, D.A. (eds.) CAV 2004. LNCS, vol. 3114, pp. 281–294. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  12. Jensen, J.L., Jørgensen, M.E., Klarlund, N., Schwartzbach, M.I.: Automatic verification of pointer programs using monadic second order logic. In: Proc. ACM PLDI, Las Vegas, NV (1997)

    Google Scholar 

  13. Klarlund, N., Møller, A., Schwartzbach, M.I.: MONA implementation secrets. In: Yu, S., Păun, A. (eds.) CIAA 2000. LNCS, vol. 2088, p. 182. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  14. Klarlund, N., Schwartzbach, M.I.: Graph types. In: Proc. 20th ACM POPL, Charleston, SC (1993)

    Google Scholar 

  15. Kuncak, V., Lam, P., Rinard, M.: Role analysis. In: Proc. 29th POPL (2002)

    Google Scholar 

  16. Kuncak, V., Lam, P., Zee, K., Rinard, M.: Implications of a data structure consistency checking system. In: Int. conf. on Verified Software: Theories, Tools, Experiments (VSTTE, IFIP Working Group 2.3 Conference), Zürich (October 2005)

    Google Scholar 

  17. Kuncak, V., Rinard, M.: Boolean algebra of shape analysis constraints. In: Proc. 5th International Conference on Verification, Model Checking and Abstract Interpretation (2004)

    Google Scholar 

  18. Kuncak, V., Rinard, M.: Decision procedures for set-valued fields. In: 1st International Workshop on Abstract Interpretation of Object-Oriented Languages, AIOOL 2005 (2005)

    Google Scholar 

  19. Lahiri, S.K., Qadeer, S.: Verifying properties of well-founded linked lists. In: POPL 2006 (2006)

    Google Scholar 

  20. Lam, P., Kuncak, V., Rinard, M.: Generalized typestate checking for data structure consistency. In: 6th International Conference on Verification, Model Checking and Abstract Interpretation (2005)

    Google Scholar 

  21. Lam, P., Kuncak, V., Rinard, M.: Hob: A tool for verifying data structure consistency. In: 14th International Conference on Compiler Construction (tool demo) (April 2005)

    Google Scholar 

  22. Lee, O., Yang, H., Yi, K.: Automatic verification of pointer programs using grammar-based shape analysis. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 124–140. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  23. Lev-Ami, T., Immerman, N., Reps, T., Sagiv, M., Srivastava, S., Yorsh, G.: Simulating reachability using first-order logic with applications to verification of linked data structures. In: Nieuwenhuis, R. (ed.) CADE 2005. LNCS (LNAI), vol. 3632, pp. 99–115. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  24. Lev-Ami, T., Reps, T., Sagiv, M., Wilhelm, R.: Putting static analysis to work for verification: A case study. In: International Symposium on Software Testing and Analysis (2000)

    Google Scholar 

  25. McPeak, S., Necula, G.C.: Data structure specifications via local equality axioms. In: Etessami, K., Rajamani, S.K. (eds.) CAV 2005. LNCS, vol. 3576, pp. 476–490. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  26. Møller, A., Schwartzbach, M.I.: The Pointer Assertion Logic Engine. In: Programming Language Design and Implementation (2001)

    Google Scholar 

  27. Muchnick, S.S., Jones, N.D. (eds.): Program Flow Analysis: Theory and Applications. Prentice-Hall, Inc., Englewood Cliffs (1981)

    MATH  Google Scholar 

  28. Nelson, G.: Verifying reachability invariants of linked structures. In: POPL (1983)

    Google Scholar 

  29. Podelski, A., Wies, T.: Boolean heaps. In: Hankin, C., Siveroni, I. (eds.) SAS 2005. LNCS, vol. 3672, pp. 268–283. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  30. Pugh, W.: Skip lists: A probabilistic alternative to balanced trees. Communications of the ACM 33(6), 668–676 (1990)

    Article  MathSciNet  Google Scholar 

  31. Reps, T., Sagiv, M., Loginov, A.: Finite differencing of logical formulas for static analysis. In: Degano, P. (ed.) ESOP 2003. LNCS, vol. 2618, pp. 380–398. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

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

    Article  Google Scholar 

  33. Wies, T.: Symbolic shape analysis. Master’s thesis, Universität des Saarlandes, Saarbrücken, Germany (September 2004)

    Google Scholar 

  34. Wies, T., Kuncak, V., Lam, P., Podelski, A., Rinard, M.: On field constraint analysis. Technical Report MIT-CSAIL-TR-2005-072, MIT-LCS-TR-1010, MIT CSAIL (November 2005)

    Google Scholar 

  35. Yorsh, G., Reps, T., Sagiv, M.: Symbolically computing most-precise abstract operations for shape analysis. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 530–545. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  36. Yorsh, G., Reps, T., Sagiv, M., Wilhelm, R.: Logical characterizations of heap abstractions. In: TOCL (2005) (to appear)

    Google Scholar 

  37. Yorsh, G., Skidanov, A., Reps, T., Sagiv, M.: Automatic assume/guarantee reasoning for heap-manupilating programs. In: 1st AIOOL Workshop (2005)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Wies, T., Kuncak, V., Lam, P., Podelski, A., Rinard, M. (2005). Field Constraint Analysis. In: Emerson, E.A., Namjoshi, K.S. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2006. Lecture Notes in Computer Science, vol 3855. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11609773_11

Download citation

  • DOI: https://doi.org/10.1007/11609773_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-31139-3

  • Online ISBN: 978-3-540-31622-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics