Skip to main content

Encoding Ownership Types in Java

  • Conference paper
Book cover Objects, Models, Components, Patterns (TOOLS 2010)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6141))

Abstract

Ownership types systems organise the heap into a hierarchy which can be used to support encapsulation properties, effects, and invariants. Ownership types have many applications including parallelisation, concurrency, memory management, and security. In this paper, we show that several flavours and extensions of ownership types can be entirely encoded using the standard Java type system.

Ownership types systems usually require a sizable effort to implement and the relation of ownership types to standard type systems is poorly understood. Our encoding demonstrates the connection between ownership types and parametric and existential types. We formalise our encoding using a model for Java’s type system, and prove that it is sound and enforces an ownership hierarchy. Finally, we leverage our encoding to produce lightweight compilers for Ownership Types and Universe Types — each compiler took only one day to implement.

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. Accompanying webpage, https://ecs.victoria.ac.nz/Main/Encoding

  2. Abi-Antoun, M., Aldrich, J.: Ownership Domains in the Real World. In: International Workshop on Aliasing, Confinement and Ownership in object-oriented programming, IWACO (2008)

    Google Scholar 

  3. Aldrich, J., Chambers, C.: Ownership Domains: Separating Aliasing Policy from Mechanism. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 1–25. Springer, Heidelberg (2004)

    Google Scholar 

  4. Armbruster, A., Baker, J., Cunei, A., Flack, C., Holmes, D., Pizlo, F., Pla, E., Prochazka, M., Vitek, J.: A Real-Time Java Virtual Machine with Applications in Avionics. Transactions on Embedded Computing Systems 7(1), 1–49 (2007)

    Article  Google Scholar 

  5. Bocchino Jr., R.L., Adve, V.S., Dig, D., Adve, S.V., Heumann, S., Komuravelli, R., Overbey, J., Simmons, P., Sung, H., Vakilian, M.: A Type and Effect System for Deterministic Parallel Java. In: Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA (2009)

    Google Scholar 

  6. Boyapati, C., Lee, R., Rinard, M.C.: Ownership Types for Safe Programming: Preventing Data Races and Deadlocks. In: Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA (2002)

    Google Scholar 

  7. Boyapati, C., Liskov, B., Shrira, L.: Ownership Types for Object Encapsulation. In: Principles of Programming Languages, POPL (2003)

    Google Scholar 

  8. Cameron, N.: Existential Types for Variance | Java Wildcards and Ownership Types. PhD thesis, Imperial College London (2009)

    Google Scholar 

  9. Cameron, N., Dietl, W.: Comparing Universes and Existential Own- ership Types. In: International Workshop on Aliasing, Confinement and Ownership in object-oriented programming, IWACO (2009)

    Google Scholar 

  10. Cameron, N., Drossopoulou, S.: Existential Quantification for Variant Ownership. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 128–142. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  11. Cameron, N., Drossopoulou, S., Ernst, E.: A Model for Java with Wildcards. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 2–26. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  12. Cameron, N., Drossopoulou, S., Noble, J., Smith, M.: Multiple Ownership. In: Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA (2007)

    Google Scholar 

  13. Cameron, N., Noble, J.: OGJ Gone Wild. In: International Workshop on Aliasing, Confinement and Ownership in object-oriented programming, IWACO (2009)

    Google Scholar 

  14. Clarke, D.G.: Object Ownership and Containment. PhD thesis, School of Computer Science and Engineering, The University of New South Wales, Sydney, Australia (2001)

    Google Scholar 

  15. Clarke, D.G., Drossopoulou, S.: Ownership, Encapsulation and the Disjointness of Type and Effect. In: Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA (2002)

    Google Scholar 

  16. Clarke, D.G., Potter, J.M., Noble, J.: Ownership Types for Flexible Alias Protection. In: Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA (1998)

    Google Scholar 

  17. Cunningham, D., Dietl, W., Drossopoulou, S., Francalanza, A., Müller, P., Summers, A.J.: Universe Types for Topology and Encapsulation. In: Formal Methods for Components and Objects, FMCO (2008)

    Google Scholar 

  18. Cunningham, D., Drossopoulou, S., Eisenbach, S.: Universe Types for Race Safety. In: Verification and Analysis of Multi-threaded Java-like Programs, VAMP (2007)

    Google Scholar 

  19. Dietl, W., Drossopoulou, S., Müller, P.: Generic Universe Types. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 28–53. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  20. Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. Addison-Wesley, Boston (2005)

    Google Scholar 

  21. Hinze, R.: The Fun. of Programming, pp. 245–262. Palgrave Macmillan, Basingstoke (2003)

    Google Scholar 

  22. Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a Minimal Core Calculus For Java and GJ. ACM Trans. Program. Lang. Syst. 23(3), 396–450 (2001); An earlier version of this work appeared at OOPSLA’99

    Article  Google Scholar 

  23. Lu, Y., Potter, J.: On Ownership and Accessibility. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 99–123. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  24. Müller, P., Poetzsch-Heffter, A., Leavens, G.T.: Modular Invariants for Layered Object Structures. Science of Computer Programming 62, 253–286 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  25. Pearce, D.: Jkit compiler, http://www.ecs.vuw.ac.nz/~djp/jkit

  26. Potanin, A., Noble, J., Clarke, D., Biddle, R.: Featherweight Generic Confinement. J. Funct. Program. 16(6), 793–811 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  27. Potanin, A., Noble, J., Clarke, D., Biddle, R.: Generic Ownership for Generic Java. In: Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA (2006)

    Google Scholar 

  28. Torgersen, M., Hansen, C.P., Ernst, E., von der Ahé, P., Bracha, G., Gafter, N.: Adding Wildcards to the Java Programming Language. Journal of Object Technology 3(11), 97–116 (2004)

    Google Scholar 

  29. Wright, A.K., Felleisen, M.: A Syntactic Approach to Type Soundness. Information and Computation 115(1), 38–94 (1994)

    Article  MATH  MathSciNet  Google Scholar 

  30. Wrigstad, T.: Ownership-Based Alias Managemant. PhD thesis, KTH, Sweden (2006)

    Google Scholar 

  31. Wrigstad, T., Clarke, D.G.: Existential Owners for Ownership Types. Journal of Object Technology 6(4) (2007)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Cameron, N., Noble, J. (2010). Encoding Ownership Types in Java. In: Vitek, J. (eds) Objects, Models, Components, Patterns. TOOLS 2010. Lecture Notes in Computer Science, vol 6141. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-13953-6_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-13953-6_15

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-13952-9

  • Online ISBN: 978-3-642-13953-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics