Inference and Checking of Object Ownership

  • Wei Huang
  • Werner Dietl
  • Ana Milanova
  • Michael D. Ernst
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7313)


Ownership type systems describe a heap topology and enforce an encapsulation discipline; they aid in various program correctness and understanding tasks. However, the annotation overhead of ownership type systems has hindered their widespread use. We present a unified framework for specification, type inference and type checking of ownership type systems, and instantiate the framework for two such systems: Universe Types and Ownership Types. We present an objective metric defining a “best typing” for these type systems, and develop an inference approach that maximizes the metric. The programmer can influence the inference by adding partial annotations to the program. We implemented the approach on top of the Checker Framework and present the results of an experimental evaluation.


Type System Preference Ranking Current Object Typing Rule Type Inference 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aldrich, J., Kostadinov, V., Chambers, C.: Alias annotations for program understanding. In: OOPSLA, pp. 311–330 (2002)Google Scholar
  2. 2.
    Artzi, S., Kieżun, A., Quinonez, J., Ernst, M.D.: Parameter reference immutability: formal definition, inference tool, and comparison. ASE 16, 145–192 (2008)Google Scholar
  3. 3.
    Chin, B., Markstrum, S., Millstein, T., Palsberg, J.: Inference of User-Defined Type Qualifiers and Qualifier Rules. In: Sestoft, P. (ed.) ESOP 2006. LNCS, vol. 3924, pp. 264–278. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  4. 4.
    Clarke, D., Potter, J.M., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA, vol. 33, pp. 48–64 (1998)Google Scholar
  5. 5.
    Cunningham, D., Dietl, W., Drossopoulou, S., Francalanza, A., Müller, P., Summers, A.J.: Universe Types for Topology and Encapsulation. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2007. LNCS, vol. 5382, pp. 72–112. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  6. 6.
    Dietl, W., Dietzel, S., Ernst, M.D., Muşlu, K., Schiller, T.W.: Building and Using Pluggable Type-Checkers. In: ICSE, pp. 681–690 (2011)Google Scholar
  7. 7.
    Dietl, W., Ernst, M.D., Müller, P.: Tunable Static Inference for Generic Universe Types. In: Mezini, M. (ed.) ECOOP 2011. LNCS, vol. 6813, pp. 333–357. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  8. 8.
    Dietl, W., Müller, P.: Universes: Lightweight ownership for JML. Journal of Object Technology 4(8), 5–32 (2005)CrossRefGoogle Scholar
  9. 9.
    Dietl, W., Müller, P.: Runtime Universe type inference. In: IWACO (2007)Google Scholar
  10. 10.
    Donovan, A., Kiežun, A., Tschantz, M.S., Ernst, M.D.: Converting Java programs to use generic libraries. In: OOPSLA, pp. 15–34 (2004)Google Scholar
  11. 11.
    Greenfieldboyce, D., Foster, J.S.: Type qualifier inference for Java. In: OOPSLA, pp. 321–336 (2007)Google Scholar
  12. 12.
    Huang, W., Milanova, A.: Towards effective inference and checking of ownership types. In: IWACO (2011)Google Scholar
  13. 13.
    Huang, W., Milanova, A.: A Type System for Reference Immutability. Technical report, Rensselaer Polytechnic Institute, Department of Computer Science (2011)Google Scholar
  14. 14.
    Huang, W., Milanova, A.: On optimality of ownership type inference. Poster at ECOOP (2011)Google Scholar
  15. 15.
    Kieżun, A., Ernst, M.D., Tip, F., Fuhrer, R.M.: Refactoring for parameterizing Java classes. In: ICSE, pp. 437–446 (2007)Google Scholar
  16. 16.
    Ma, K.-K., Foster, J.S.: Inferring aliasing and encapsulation properties for Java. In: OOPSLA, pp. 423–440 (2007)Google Scholar
  17. 17.
    Milanova, A., Vitek, J.: Static Dominance Inference. In: Bishop, J., Vallecillo, A. (eds.) TOOLS 2011. LNCS, vol. 6705, pp. 211–227. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  18. 18.
    Mitchell, N.: The Runtime Structure of Object Ownership. In: Hu, Q. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 74–98. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  19. 19.
    Nielson, F., Nielson, H.R., Hankin, C.: Principles of program analysis. Springer-Verlag New York, Inc. (1999)Google Scholar
  20. 20.
    Papi, M.M., Ali, M., Correa Jr., T.L., Perkins, J.H., Ernst, M.D.: Practical pluggable types for Java. In: ISSTA, pp. 201–212 (2008)Google Scholar
  21. 21.
    Potanin, A., Noble, J., Biddle, R.: Checking ownership and confinement. Concurrency and Computation: Practice and Experience 16(7), 671–687 (2004)CrossRefGoogle Scholar
  22. 22.
    Sampson, A., Dietl, W., Fortuna, E., Gnanapragasam, D., Ceze, L., Grossman, D.: EnerJ: Approximate Data Types for Safe and General Low-Power Computation. In: PLDI, pp. 164–174 (2011)Google Scholar
  23. 23.
    Sergey, I., Clarke, D.: Gradual Ownership Types. In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 579–599. Springer, Heidelberg (2012)Google Scholar
  24. 24.
    Palsberg, J., Schwartzbach, M.I.: Object-Oriented Type Systems. John Wiley and Sons (1994)Google Scholar
  25. 25.
    Tschantz, M.S., Ernst, M.D.: Javari: Adding reference immutability to Java. In: OOPSLA, pp. 211–230 (2005)Google Scholar
  26. 26.
    Vaziri, M., Tip, F., Dolby, J., Hammer, C., Vitek, J.: A Type System for Data-Centric Synchronization. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 304–328. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  27. 27.
    Vetchev, M., Yahav, E., Yorsh, G.: PHALANX: Parallel Checking of Expressive Heap Assertions. In: ISMM, pp. 41–50 (2010)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Wei Huang
    • 1
  • Werner Dietl
    • 2
  • Ana Milanova
    • 1
  • Michael D. Ernst
    • 2
  1. 1.Rensselaer Polytechnic InstituteUSA
  2. 2.University of WashingtonUSA

Personalised recommendations