Inference and Checking of Object Ownership

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.

[1]  Jens Palsberg,et al.  Object-oriented type systems , 1994, Wiley professional computing.

[2]  Craig Chambers,et al.  Alias annotations for program understanding , 2002, OOPSLA '02.

[3]  Michael D. Ernst,et al.  Practical pluggable types for java , 2008, ISSTA '08.

[4]  Michael D. Ernst,et al.  Javari: adding reference immutability to Java , 2005, OOPSLA '05.

[5]  Eran Yahav,et al.  PHALANX: parallel checking of expressive heap assertions , 2010, ISMM '10.

[6]  Dan Grossman,et al.  EnerJ: approximate data types for safe and general low-power computation , 2011, PLDI '11.

[7]  Werner Dietl,et al.  Runtime Universe Type Inference , 2007 .

[8]  Sophia Drossopoulou,et al.  Universe Types for Topology and Encapsulation , 2007, FMCO.

[9]  Michael D. Ernst,et al.  Converting java programs to use generic libraries , 2004, OOPSLA '04.

[10]  Wei Huang,et al.  Towards Effective Inference and Checking of Ownership Types , 2011 .

[11]  Theo D'Hondt ECOOP 2010 - Object-Oriented Programming, 24th European Conference, Maribor, Slovenia, June 21-25, 2010. Proceedings , 2010, ECOOP.

[12]  Frank D. Valencia,et al.  Formal Methods for Components and Objects , 2002, Lecture Notes in Computer Science.

[13]  Jens Palsberg,et al.  Inference of User-Defined Type Qualifiers and Qualifier Rules , 2006, ESOP.

[14]  Jan Vitek,et al.  Static Dominance Inference , 2011, TOOLS.

[15]  Jeffrey S. Foster,et al.  Type qualifier inference for java , 2007, OOPSLA.

[16]  Antonio Vallecillo,et al.  Objects, Models, Components, Patterns , 2011, Lecture Notes in Computer Science.

[17]  Nick Mitchell,et al.  The Runtime Structure of Object Ownership , 2006, ECOOP.

[18]  Dave Thomas,et al.  ECOOP 2006 - Object-Oriented Programming , 2006 .

[19]  Michael D. Ernst,et al.  Building and using pluggable type-checkers , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[20]  Peter Müller,et al.  Universes: Lightweight Ownership for JML , 2005, J. Object Technol..

[21]  James Noble,et al.  Ownership types for flexible alias protection , 1998, OOPSLA '98.

[22]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[23]  Frank Tip,et al.  Refactoring for Parameterizing Java Classes , 2007, 29th International Conference on Software Engineering (ICSE'07).

[24]  Michael D. Ernst,et al.  Parameter reference immutability: formal definition, inference tool, and comparison , 2009, Automated Software Engineering.

[25]  James Noble,et al.  Checking ownership and confinement , 2004, Concurr. Pract. Exp..

[26]  Michael D. Ernst,et al.  Tunable Static Inference for Generic Universe Types , 2011, ECOOP.

[27]  Frank Tip,et al.  Refactoring using type constraints , 2011, TOPL.

[28]  Jeffrey S. Foster,et al.  Inferring aliasing and encapsulation properties for java , 2007, OOPSLA.

[29]  Jan Vitek,et al.  A Type System for Data-Centric Synchronization , 2010, ECOOP.

[30]  Dave Clarke,et al.  Gradual Ownership Types , 2012, ESOP.

[31]  Andrew D. Gordon,et al.  Maintaining Database Integrity with Refinement Types , 2011, ECOOP.

[32]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.