Simple Ownership Types for Object Containment

  • David G. Clarke
  • James Noble
  • John M. Potter
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2072)


Containment of objects is a natural concept that has been poorly supported in object-oriented programming languages. For a predefined set of ownership contexts, this paper presents a type system that enforces certain containment relationships for run-time objects. A fixed ordering relationship is presumed between the owners.

The formalisation of ownership types has developed from our work with flexible alias protection together with an investigation of structural properties of object graphs based on dominator trees. Our general ownership type system permits fresh ownership contexts to be created at run-time. Here we present a simplified system in which the ownership contexts are predefined. This is powerful enough to express and enforce constraints about a system’s high-level structure.

Our formal system is presented in an imperative variant of the object calculus. We present type preservation and soundness results. Furthermore we highlight how these type theoretic results establish a containment invariant for objects, in which access to contained objects is only permitted via their owners. In effect, the predefined ownership ordering restricts the permissible inter-object reference structure.


OO type systems ownership types object containment flexible alias protection 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Martín Abadi and Luca Cardelli. A Theory of Objects. Springer-Verlag, 1996.Google Scholar
  2. [2]
    Jonathan Aldrich, Craig Chambers, Emin Gun Sirer, and Susan Eggers. Static analyses for eliminating unnecessary synchronization from Java programs. In Sixth International Static Analysis Symposium. Springer-Verlag, September 1999.Google Scholar
  3. [3]
    Paulo Sérgio Almeida. Balloon Types: Controlling sharing of state in data types. In ECOOP Proceedings, June 1997.Google Scholar
  4. [4]
    David F. Bacon, Robert E. Strom, and Ashis Tarafdar. Guava: A dialect of Java without data races. In OOPSLA’00 Conference Proceedings—Object-Oriented Programming Systems, Languages and Applications, volume 35, pages 382–400, New York, October 2000. ACM Press.Google Scholar
  5. [5]
    Henry G. Baker. ’Use-once’ variables and linear objects-storage management, reflection and multi-threading. ACM SIGPLAN Notices, 30(1), January 1995.Google Scholar
  6. [6]
    Bruno Blanchet. Escape analysis for object-oriented languages. application to Java. In OOPSLA Proceedings, pages 20–34. ACM, 1999.Google Scholar
  7. [7]
    Jeff Bogda and Urs Hölzle. Removing unnecessary synchronization in Java. In OOPSLA Proceedings, pages 35–46. ACM, 1999.Google Scholar
  8. [8]
    Boris Bokowski and Jan Vitek. Confined Types. In OOPSLA Proceedings, 1999.Google Scholar
  9. [9]
    John Boyland. Alias burying. Software—Practice & Experience, 2001. To appear.Google Scholar
  10. [10]
    Edwin C. Chan, John T. Boyland, and William L. Scherlis. Promises: Limitied specifications for analysis and manipulation. In IEEE International Conference on Software Engineering (ICSE), 1998.Google Scholar
  11. [11]
    Jong-Deok Choi, M. Gupta, Mauricio Serrano, Vugranam C. Sreedhar, and Sam Midkiff. Escape analysis for Java. In OOPSLA Proceedings, pages 1–19. ACM, 1999.Google Scholar
  12. [12]
    Franco Civello. Roles for composite objects in object-oriented analysis and design. In OOPSLA Proceedings, 1993.Google Scholar
  13. [13]
    David Clarke. An object calculus with ownership and containment. In Foundations of Object-Oriented Languages (FOOL) 2001, 2001.Google Scholar
  14. [14]
    David Clarke. Object Ownership and Containment. PhD thesis, School of Computer Science and Engineering, University of New SouthWales, Sydney, Australia, 2001. In preparation.Google Scholar
  15. [15]
    David G. Clarke, John M. Potter, and James Noble. Ownership types for flexible alias protection. In OOPSLA Proceedings, 1998.Google Scholar
  16. [16]
    Alain Deutsch. Interprocedural May-Alias Analysis for Pointers: Beyond klimiting. In Proceedings of the ACM SIGPLAN’94 Conference on Programming Language Design and Implementation, June 1994.Google Scholar
  17. [17]
    Jin Song Dong and Roger Duke. Exclusive control within object oriented systems. In TOOLS Pacific 18, 1995.Google Scholar
  18. [18]
    Daniela Genius, Martin Trapp, and Wolf Zimmermann. An approach to improve locality using sandwich types. In Proceedings of the 2nd Types in Compilation workshop, number 1473 in Lecture Notes in Computer Science, pages 194–214, Kyoto, Japan, March 1998. Springer-Verlag.CrossRefGoogle Scholar
  19. [19]
    A. D. Gordon, P. D. Hankin, and S. B. Lassen. Compilation and equivalence of imperative objects. Journal of Functional Programming, 9(4):373–426, July 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  20. [20]
    Peter Grogono and Patrice Chalin. Copying, sharing, and aliasing. In Proceedings of the Colloquium on Object Orientation in Databases and Software Engineering (COODBSE’94), Montreal, Quebec, May 1994.Google Scholar
  21. [21]
    Douglas E. Harms and Bruce W. Weide. Copying and swapping: Influences on the design of reusable software components. IEEE Transactions on Software Engineering, 17(5), May 1991.Google Scholar
  22. [22]
    Laurie J. Hendren and G. R. Gao. Designing programming languages for analyzability: A fresh look at pointer data structures. In Proceedings of the IEEE 1992 International Conference on Programming Languages, April 1992.Google Scholar
  23. [23]
    John Hogg. Islands: Aliasing protection in object-oriented languages. In OOPSLA Proceedings, November 1991.Google Scholar
  24. [24]
    John Hogg, Doug Lea, Alan Wills, Dennis de Champeaux, and Richard Holt. The Geneva convention on the treatment of object aliasing. OOPS Messenger, 3(2), April 1992.Google Scholar
  25. [25]
    Neil D. Jones and Steven Muchnick. Flow analysis and optimization of LISPlike structures. In Steven Muchnick and Neil D. Jones, editors, Program Flow Analysis: Theory and Applications. Prentice Hall, 1981.Google Scholar
  26. [26]
    Stuart Kent and Ian Maung. Encapsulation and aggregation. In TOOLS Pacific 18, 1995.Google Scholar
  27. [27]
    William Landi. Undecidability of static analysis. ACM Letters on Programming Languages and Systems, 1(4), December 1992.Google Scholar
  28. [28]
    K. Rustan M. Leino and Raymie Stata. Virginity: A contribution to the specification of object-oriented software. Technical Report SRC-TN-97-001, Digital Systems Research Center, April 1997.Google Scholar
  29. [29]
    Bertrand Meyer. Eiffel: The Language. Prentice Hall, 1992.Google Scholar
  30. [30]
    Naftaly Minsky. Towards alias-free pointers. In ECOOP Proceedings, July 1996.Google Scholar
  31. [31]
    P. Müller and A. Poetzsch-Heffter. Universes: A type system for controlling representation exposure. In A. Poetzsch-Heffter and J. Meyer, editors, Programming Languages and Fundamentals of Programming. Fernuniversitäat Hagen, 1999.Google Scholar
  32. [32]
    James Noble, David Clarke, and John Potter. Object ownership for dynamic alias protection. In TOOLS Pacific, Melbourne, Australia, November 1999.Google Scholar
  33. [33]
    James Noble, Jan Vitek, and Doug Lea. Report of the Intercontinental Workshop on Aliasing in Object-Oriented Systems, volume 1743 of Lecture Notes in Computer Science. Springer, Berlin, Heidelberg, New York, 2000.Google Scholar
  34. [34]
    James Noble, Jan Vitek, and John Potter. Flexible alias protection. In Eric Jul, editor, ECOOP’98— Object-Oriented Programming, volume 1445 of Lecture Notes In Computer Science, pages 158–185, Berlin, Heidelberg, New York, July 1998. Springer-Verlag.CrossRefGoogle Scholar
  35. [35]
    John Potter and James Noble. Conglomeration: Realising aliasing protection. In Proceedings of the Australian Computer Science Conference (ACSC), Canberra, January 2000.Google Scholar
  36. [36]
    John Potter, James Noble, and David Clarke. The ins and outs of objects. In Australian Software Engineering Conference, Adelaide, Australia, November 1998. IEEE Press.Google Scholar
  37. [37]
    Amr Sabry and Matthias Felleisen. Reasoning about programs in continuationpassing style. In 1992 ACM Conference on LISP and Functional Programming, pages 288–298, San Francisco, CA, June 1992. ACM.Google Scholar
  38. [38]
    John Whaley and Martin Rinard. Compositional pointer and escape analysis for Java programs. In OOPSLA’99 Conference Proceedings—Object-Oriented Programming Systems, Languages and Applications, volume 34, pages 187–206, New York, October 1999. ACM Press.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • David G. Clarke
    • 1
  • James Noble
    • 2
  • John M. Potter
    • 3
  1. 1.Institute of Information and Computing SciencesUtrecht University UtrechtThe Netherlands
  2. 2.School of Mathematical and Computing SciencesVictoria University WellingtonNew Zealand
  3. 3.School of Computer Science and EngineeringUniversity of New South WalesSydneyAustralia

Personalised recommendations