Abstract
Today’s mainstream object-oriented compilers and tools do not support declaring and statically checking simple pre- and postconditions on methods and invariants on object representations. The main technical problem preventing static verification is reasoning about the sharing relationships among objects as well as where object invariants should hold. We have developed a programming model of typestates for objects with a sound modular checking algorithm. The programming model handles typical aspects of object-oriented programs such as down-casting, virtual dispatch, direct calls, and subclassing. The model also permits subclasses to extend the interpretation of typestates and to introduce additional typestates. We handle aliasing by adapting our previous work on practical linear types developed in the context of the Vault system. We have implemented these ideas in a tool called Fugue for specifying and checking typestates on Microsoft .NET-based programs.
Keywords
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.
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
Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for Java. In: [18]
Strom, R.E., Yemini, S.: Typestate: A programming language concept for enhancing software reliability. IEEE TSE 12, 157–171 (1986)
DeLine, R., Fähndrich, M.: Enforcing high-level protocols in low-level software. In: Proceedings of the 2001 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 59–69 (2001)
Fähndrich, M., DeLine, R.: Adoption and focus: Practical linear types for imperative programming. In: [18] 13–24
Guttag, J.V., Horning, J.J.: Larch: Languages and Tools for Formal Specification. Texts and Monographs in Computer Science. Springer, Heidelberg (1993)
DeLine, R., Fähndrich, M.: The Fugue protocol checker: Is your software Baroque? Technical Report MSR-TR-2004-07, Microsoft Research (2004), http://research.microsoft.com/~maf/fugue
Smith, F., Walker, D., Morrisett, J.G.: Alias types. In: European Symposium on Programming, pp. 366–381 (2000)
Walker, D., Morrisett, G.: Alias types for recursive data structures. In: Proceedings of the 4th Workshop on Types in Compilation (2000)
Tofte, M., Talpin, J.P.: Implementation of the typed call-by-value λ-calculus using a stack of regions. In: Conference Record of the 21st Annual ACM Symposium on Principles of Programming Languages, pp. 188–201 (1994)
Crary, K., Walker, D., Morrisett, G.: Typed memory management in a calculus of capabilities. In: Conference Record of the 26th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, ACM Press, New York (1999)
Wadler, P.: Linear types can change the world! In: Broy, M., Jones, C. (eds.) Programming Concepts and Methods, IFIP TC 2 Working Conference (1990)
Boyland, J.: Alias burying: Unique variables without destructive reads. Software— Practice and Experience 31, 533–553 (2001)
Kuncak, V., Lam, P., Rinard, M.: Role analysis. In: Conference Record of the 29th Annual ACM Symposium on Principles of Programming Languages (2002)
Detlefs, D.L., Leino, K.R.M., Nelson, G., Saxe, J.B.: Extended static checking. Research Report 159, Compaq Systems Research Center (1998)
Leino, K.R.M., Stata, R.: Checking object invariants. Technical Report #1997-007, DEC SRC, Palo Alto, USA (1997)
Liskov, B.H., Wing, J.M.: A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems 16, 1811–1841 (1994)
Rémy, D., Vouillon, J.: Objective ML: an effective object-oriented extension to ML. Theory and Practice of Object Systems 4, 27–50 (1998)
Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation (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
DeLine, R., Fähndrich, M. (2004). Typestates for Objects. In: Odersky, M. (eds) ECOOP 2004 – Object-Oriented Programming. ECOOP 2004. Lecture Notes in Computer Science, vol 3086. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24851-4_21
Download citation
DOI: https://doi.org/10.1007/978-3-540-24851-4_21
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-22159-3
Online ISBN: 978-3-540-24851-4
eBook Packages: Springer Book Archive