Skip to main content

Typestates for Objects

  • Conference paper
ECOOP 2004 – Object-Oriented Programming (ECOOP 2004)

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

Included in the following conference series:

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.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for Java. In: [18]

    Google Scholar 

  2. Strom, R.E., Yemini, S.: Typestate: A programming language concept for enhancing software reliability. IEEE TSE 12, 157–171 (1986)

    Google Scholar 

  3. 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)

    Google Scholar 

  4. Fähndrich, M., DeLine, R.: Adoption and focus: Practical linear types for imperative programming. In: [18] 13–24

    Google Scholar 

  5. Guttag, J.V., Horning, J.J.: Larch: Languages and Tools for Formal Specification. Texts and Monographs in Computer Science. Springer, Heidelberg (1993)

    MATH  Google Scholar 

  6. 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

  7. Smith, F., Walker, D., Morrisett, J.G.: Alias types. In: European Symposium on Programming, pp. 366–381 (2000)

    Google Scholar 

  8. Walker, D., Morrisett, G.: Alias types for recursive data structures. In: Proceedings of the 4th Workshop on Types in Compilation (2000)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. Wadler, P.: Linear types can change the world! In: Broy, M., Jones, C. (eds.) Programming Concepts and Methods, IFIP TC 2 Working Conference (1990)

    Google Scholar 

  12. Boyland, J.: Alias burying: Unique variables without destructive reads. Software— Practice and Experience 31, 533–553 (2001)

    Article  MATH  Google Scholar 

  13. Kuncak, V., Lam, P., Rinard, M.: Role analysis. In: Conference Record of the 29th Annual ACM Symposium on Principles of Programming Languages (2002)

    Google Scholar 

  14. Detlefs, D.L., Leino, K.R.M., Nelson, G., Saxe, J.B.: Extended static checking. Research Report 159, Compaq Systems Research Center (1998)

    Google Scholar 

  15. Leino, K.R.M., Stata, R.: Checking object invariants. Technical Report #1997-007, DEC SRC, Palo Alto, USA (1997)

    Google Scholar 

  16. Liskov, B.H., Wing, J.M.: A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems 16, 1811–1841 (1994)

    Article  Google Scholar 

  17. Rémy, D., Vouillon, J.: Objective ML: an effective object-oriented extension to ML. Theory and Practice of Object Systems 4, 27–50 (1998)

    Article  Google Scholar 

  18. Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation (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

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

Publish with us

Policies and ethics