scholarly journals Generic Ownership: a Practical Approach to Ownership and Confinement in Object-Oriented  Programming Languages

2021 ◽  
Author(s):  
◽  
Alex Potanin

<p>Modern object-oriented programming languages support many techniques that simplify the work of a programmer. Among them is generic types: the ability to create generic descriptions of algorithms and object structures that will be automatically specialised by supplying the type information when they are used. At the same time, object-oriented technologies still suffer from aliasing: the case of many objects in a program's memory referring to the same object via different references. Ownership types enforce encapsulation in object-oriented programs by ensuring that objects cannot be referred to from the outside of the object(s) that own them. Existing ownership programming languages either do not support generic types or attempt to add them on top of ownership restrictions. The goal of this work is to bring object ownership into mainstream object-oriented programming languages. This thesis presents Generic Ownership which provides perobject ownership on top of a generic imperative language. Surprisingly, the resulting system not only provides ownership guarantees comparable to the established systems, but also requires few additional language mechanisms to achieve them due to full reuse of generic types. In this thesis I formalise the core of Generic Ownership, highlighting that the restriction of this calls, owner preservation over subtyping, and appropriate owner nesting are the only necessary requirements for ownership. I describe two formalisms: (1) a simple formalism, capturing confinement in a functional setting, and (2) a complete formalism, providing a way for Generic Ownership to support both deep and shallow variations of ownership types. I support the formal work by describing how the Ownership Generic Java (OGJ) language is implemented as a minimal extension to Java 5. OGJ is the first publicly available language implementation that supports ownership, confinement, and generic types at the same time. I demonstrate OGJ in practice: show how to use OGJ to write programs and provide insights into the implementations of Generic Ownership.</p>

2021 ◽  
Author(s):  
◽  
Alex Potanin

<p>Modern object-oriented programming languages support many techniques that simplify the work of a programmer. Among them is generic types: the ability to create generic descriptions of algorithms and object structures that will be automatically specialised by supplying the type information when they are used. At the same time, object-oriented technologies still suffer from aliasing: the case of many objects in a program's memory referring to the same object via different references. Ownership types enforce encapsulation in object-oriented programs by ensuring that objects cannot be referred to from the outside of the object(s) that own them. Existing ownership programming languages either do not support generic types or attempt to add them on top of ownership restrictions. The goal of this work is to bring object ownership into mainstream object-oriented programming languages. This thesis presents Generic Ownership which provides perobject ownership on top of a generic imperative language. Surprisingly, the resulting system not only provides ownership guarantees comparable to the established systems, but also requires few additional language mechanisms to achieve them due to full reuse of generic types. In this thesis I formalise the core of Generic Ownership, highlighting that the restriction of this calls, owner preservation over subtyping, and appropriate owner nesting are the only necessary requirements for ownership. I describe two formalisms: (1) a simple formalism, capturing confinement in a functional setting, and (2) a complete formalism, providing a way for Generic Ownership to support both deep and shallow variations of ownership types. I support the formal work by describing how the Ownership Generic Java (OGJ) language is implemented as a minimal extension to Java 5. OGJ is the first publicly available language implementation that supports ownership, confinement, and generic types at the same time. I demonstrate OGJ in practice: show how to use OGJ to write programs and provide insights into the implementations of Generic Ownership.</p>


2021 ◽  
Author(s):  
◽  
Paley Guangping Li

<p>Modern object-oriented programming languages frequently need the ability to clone, duplicate, and copy objects. The usual approaches taken by languages are rudimentary, primarily because these approaches operate with little understanding of the object being cloned. Deep cloning naively copies every object that has a reachable reference path from the object being cloned, even if the objects being copied have no innate relationship with that object. For more sophisticated cloning operations, languages usually only provide the capacity for programmers to define their own cloning operations for specific objects, and with no help from the type system.  Sheep cloning is an automated operation that clones objects by leveraging information about those objects’ structures, which the programmer imparts into their programs with ownership types. Ownership types are a language mechanism that defines an owner for every object in the program. Ownership types create a hierarchical structure for the heap.  In this thesis, we construct an extensible formal model for an object-oriented language with ownership types (Core), and use it to explore different formalisms of sheep cloning. We formalise three distinct operational semantics of sheep cloning, and for each approach we include proofs or proof outlines where appropriate, and provide a comparative analysis of each model’s benefits. Our main contribution is the descripSC formal model of sheep cloning and its proof of type soundness.  The second contribution of this thesis is the formalism of Mojo-jojo, a multiple ownership system that includes existential quantification over types and context parameters, along with a constraint system for context parameters. We prove type soundness for Mojo-jojo. Multiple ownership is a mechanism which allows objects to have more than one owner. Context parameters in Mojo-jojo can use binary operators such as: intersection, union, and disjointness.</p>


2021 ◽  
Author(s):  
◽  
Paley Guangping Li

<p>Modern object-oriented programming languages frequently need the ability to clone, duplicate, and copy objects. The usual approaches taken by languages are rudimentary, primarily because these approaches operate with little understanding of the object being cloned. Deep cloning naively copies every object that has a reachable reference path from the object being cloned, even if the objects being copied have no innate relationship with that object. For more sophisticated cloning operations, languages usually only provide the capacity for programmers to define their own cloning operations for specific objects, and with no help from the type system.  Sheep cloning is an automated operation that clones objects by leveraging information about those objects’ structures, which the programmer imparts into their programs with ownership types. Ownership types are a language mechanism that defines an owner for every object in the program. Ownership types create a hierarchical structure for the heap.  In this thesis, we construct an extensible formal model for an object-oriented language with ownership types (Core), and use it to explore different formalisms of sheep cloning. We formalise three distinct operational semantics of sheep cloning, and for each approach we include proofs or proof outlines where appropriate, and provide a comparative analysis of each model’s benefits. Our main contribution is the descripSC formal model of sheep cloning and its proof of type soundness.  The second contribution of this thesis is the formalism of Mojo-jojo, a multiple ownership system that includes existential quantification over types and context parameters, along with a constraint system for context parameters. We prove type soundness for Mojo-jojo. Multiple ownership is a mechanism which allows objects to have more than one owner. Context parameters in Mojo-jojo can use binary operators such as: intersection, union, and disjointness.</p>


2015 ◽  
Vol 131 ◽  
pp. 333-342 ◽  
Author(s):  
Victor Berdonosov ◽  
Alena Zhivotova ◽  
Tatiana Sycheva

1999 ◽  
Vol 9 (3) ◽  
pp. 253-286 ◽  
Author(s):  
G. DELZANNO ◽  
D. GALMICHE ◽  
M. MARTELLI

This paper focuses on the use of linear logic as a specification language for the operational semantics of advanced concepts of programming such as concurrency and object-orientation. Our approach is based on a refinement of linear logic sequent calculi based on the proof-theoretic characterization of logic programming. A well-founded combination of higher-order logic programming and linear logic will be used to give an accurate encoding of the traditional features of concurrent object-oriented programming languages, whose corner-stone is the notion of encapsulation.


Sign in / Sign up

Export Citation Format

Share Document