Skip to main content

Automatic Inference of Class Invariants

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2937))

Abstract

We present a generic framework for the automatic and modular inference of sound class invariants for class-based object oriented languages. The idea is to derive a sound class invariant as a conservative abstraction of the class semantics. In particular we show how a class invariant can be characterized as the solution of a set of equations extracted from the program source. Once a static analysis for the method bodies is supplied, a solution for the former equation system can be iteratively computed. Thus, the class invariant can be automatically inferred. Moreover, our framework is modular since it allows the derivation of class invariants without any hypothesis on the instantiation context and, in the case of subclassing, without accessing to the parent code.

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aggarwal, A., Randall, K.H.: Related field analysis. In: PLDI 2001, June 2001, ACM Press, New York (2001)

    Google Scholar 

  2. Blanchet, B.: Escape analysis for object oriented languages. Application to Java. In: OOPSLA 1999, November 1999, ACM Press, New York (1999)

    Google Scholar 

  3. Blanchet, B., Cousot, P., Cousot, R., Feret, J., Mauborgne, L., Min, A., Monniaux, D., Rival, X.: A Static Analyzer for Large Safety-Critical Software. In: PLDI 2003, June 2003, ACM Press, New York (2003)

    Google Scholar 

  4. Chatterjee, R., Ryder, B.G., Landi, W.A.: Relevant context inference. In: POPL 1999, January 1999, ACM Press, New York (1999)

    Google Scholar 

  5. Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: POPL 1977, January 1977, ACM Press, New York (1977)

    Google Scholar 

  6. Cousot, P., Cousot, R.: Modular static program analysis. In: Horspool, R.N. (ed.) CC 2002. LNCS, vol. 2304, p. 159. Springer, Heidelberg (2002) (invited paper)

    Chapter  Google Scholar 

  7. Eckel, B.: Thinking in C++, 2nd edn., vol. 1. Prentice-Hall, Englewood Cliffs (2000)

    Google Scholar 

  8. Ernst, M.: Dynamically Discovering Likely Program Invariants. PhD thesis, University of Washington Department of Computer Science and Engineering (2002)

    Google Scholar 

  9. Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for Java. In: PLDI 2002, June 2002, ACM Press, New York (2002)

    Google Scholar 

  10. Genaim, S., Codish, M.: Incremental refinement of semantic based program analysis for logic programs. In: ACSC 1999, January 1999. LNCS, vol. 1587, Springer, Heidelberg (1999)

    Google Scholar 

  11. Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 2nd edn. Sun Microsystems (2001)

    Google Scholar 

  12. Logozzo, F.: Class-level modular analysis for object oriented languages. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  13. Logozzo, F.: Approximating module semantics with constraints. In: SAC 2004, March 2004, ACM Press, New York (2004)

    Google Scholar 

  14. Meyer, B.: Object-Oriented Software Construction. Prentice-Hall, Englewood Cliffs (1997)

    MATH  Google Scholar 

  15. Miné, A.: The octagon abstract domain. In: AST 2001 in WCRE 2001, October 2001, IEEE CS Press, Los Alamitos (2001)

    Google Scholar 

  16. Palsberg, J., Schwartzbach, M.I.: Object-Oriented Type Systems. John Wiley & Sons, Chichester (1994)

    MATH  Google Scholar 

  17. Ramalingam, G., Warshavsky, A., Field, J., Goyal, D., Sagiv, M.: Deriving specialized program analyses for certifying component-client conformance. In: PLDI 2002 (June 2002)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Logozzo, F. (2004). Automatic Inference of Class Invariants. In: Steffen, B., Levi, G. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2004. Lecture Notes in Computer Science, vol 2937. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24622-0_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24622-0_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-20803-7

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics