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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Aggarwal, A., Randall, K.H.: Related field analysis. In: PLDI 2001, June 2001, ACM Press, New York (2001)
Blanchet, B.: Escape analysis for object oriented languages. Application to Java. In: OOPSLA 1999, November 1999, ACM Press, New York (1999)
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)
Chatterjee, R., Ryder, B.G., Landi, W.A.: Relevant context inference. In: POPL 1999, January 1999, ACM Press, New York (1999)
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)
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)
Eckel, B.: Thinking in C++, 2nd edn., vol. 1. Prentice-Hall, Englewood Cliffs (2000)
Ernst, M.: Dynamically Discovering Likely Program Invariants. PhD thesis, University of Washington Department of Computer Science and Engineering (2002)
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)
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)
Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 2nd edn. Sun Microsystems (2001)
Logozzo, F.: Class-level modular analysis for object oriented languages. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, Springer, Heidelberg (2003)
Logozzo, F.: Approximating module semantics with constraints. In: SAC 2004, March 2004, ACM Press, New York (2004)
Meyer, B.: Object-Oriented Software Construction. Prentice-Hall, Englewood Cliffs (1997)
Miné, A.: The octagon abstract domain. In: AST 2001 in WCRE 2001, October 2001, IEEE CS Press, Los Alamitos (2001)
Palsberg, J., Schwartzbach, M.I.: Object-Oriented Type Systems. John Wiley & Sons, Chichester (1994)
Ramalingam, G., Warshavsky, A., Field, J., Goyal, D., Sagiv, M.: Deriving specialized program analyses for certifying component-client conformance. In: PLDI 2002 (June 2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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