Comparing Universes and Existential Ownership Types Nicholas Cameron Werner Dietl ETH Zurich Victoria University of Wellington.

Slides:



Advertisements
Similar presentations
Joint work with Mike Barnett, Robert DeLine, Manuel Fahndrich, and Wolfram Schulte Verifying invariants in object-oriented programs K. Rustan M. Leino.
Advertisements

Lecture 4 Towards a Verifying Compiler: Data Abstraction Wolfram Schulte Microsoft Research Formal Methods 2006 Purity, Model fields, Inconsistency _____________.
Substitution & Evaluation Order cos 441 David Walker.
1 A Model for Java with Wildcards Nicholas Cameron Sophia Drossopoulou Erik Ernst.
1 Variant Ownership with Existential Types Nicholas Cameron Sophia Drossopoulou Imperial College London.
Type Analysis and Typed Compilation Stephanie Weirich Cornell University.
Constraint Semantics for Abstract Read Permissions 28 th July 2014, FTfJP, Uppsala John Tang Boyland (UW-Milwaukee/ETH Zurich) Peter Müller, Malte Schwerhoff,
Ownership, Encapsulation and the Disjointness of Type and Effect Dave Clarke, Sophia Drossopoulou/2002 Encapsulation seminar Dec Sharon Goldschlager.
Changing perspective can be useful Relating alternative logics for automatic software verification Alex Summers (ETH Zurich) partly based on joint work.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Architectural Reasoning in ArchJava Jonathan Aldrich Craig Chambers David Notkin University of Washington ECOOP ‘02, 13 June 2002.
Parametric Polymorphism COS 441 Princeton University Fall 2004.
Inheritance (notes for 10/26 lecture). Inheritance Inheritance is the last of the relationships we will study this semester. Inheritance is (syntactically)
Laboratory for Computer Science Massachusetts Institute of Technology Ownership Types for Safe Region-Based Memory Management in Real-Time Java Chandrasekhar.
1 Type Type system for a programming language = –set of types AND – rules that specify how a typed program is allowed to behave Why? –to generate better.
1 A Short Introduction to (Object-Oriented) Type Systems Kris De Volder.
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Java Classes, Interfaces, and Types 1.
Inference and Checking of Object Ownership Wei Huang 1, Werner Dietl 2, Ana Milanova 1, Michael D. Ernst 2 1 Rensselaer Polytechnic Institute 2 University.
Generic Ownership for Generic Java Alex Potanin, Dave Clarke (CWI) James Noble, Robert Biddle (Carleton)
Existential Quantification for Variant Ownership Nicholas Cameron Sophia Drossopoulou Imperial College London (Victoria University of Wellington)‏
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
A Universe-Type-Based Verification Technique for Mutable Static Fields and Methods Alexander J Summers Sophia Drossopoulou Imperial College London Peter.
Multiple Ownership Nicholas Cameron Sophia Drossopoulou James Noble Matthew Smith.
Multiple Ownership Nicholas Cameron Sophia Drossopoulou James Noble Matthew Smith.
A Type System for Borrowing Permissions Karl Naden, Rob Bocchino Jonathan Aldrich, Kevin Bierhoff POPL – January 27, 2012 School of Computer Science.
Featherweight Generic Ownership Alex Potanin, James Noble Victoria University of Wellington Dave Clarke CWI, Netherlands Robert Biddle Carlton University.
Mechanizing Metatheory without Typing Contexts TYPES 2011 September 10, 2011 Jonghyun Park, Jeongbong Seo, Sungwoo Park, Gyesik Lee* Pohang University.
Encoding Ownership Types in Java Nicholas Cameron James Noble Victoria University of Wellington, New Zealand.
CS412/413 Introduction to Compilers Radu Rugina Lecture 13 : Static Semantics 18 Feb 02.
SHEEP CLONING Paley Li, Nicholas Cameron, and James Noble 1.
ReIm & ReImInfer: Checking and Inference of Reference Immutability and Method Purity Wei Huang 1, Ana Milanova 1, Werner Dietl 2, Michael D. Ernst 2 1.
1 Verification of object-oriented programs with invariants Mike Barnett, Robert DeLine, Manuel Fahndrich, K. Rustan M. Leino, Wolfram Schulte ECOOP 2003.
CSE 341 Section 10 Subtyping, Review, and The Future.
Towards a Semantic Model for Java Wildcards Sophia Drossopoulou Mariangiola Dezani-Ciancaglini Imperial College London Università di Torino Italy Nicholas.
1 Closure E.g., we understand number systems partly by understanding closure properties: Naturals are closed under +, , but not -, . Integers are closed.
LECTURE 10 Semantic Analysis. REVIEW So far, we’ve covered the following: Compilation methods: compilation vs. interpretation. The overall compilation.
On Subtyping, Wildcards, and Existential Types
Operational Semantics of Scheme
Nicholas Cameron James Noble Victoria University of Wellington
Updating SF-Tree Speaker: Ho Wai Shing.
Main issues: • What do we want to build • How do we write this down
The Relationship Between Separation Logic and Implicit Dynamic Frames
Action Editor Storyboard
Handling Exceptionally Sticky Problems
Implicit Differentiation
Chapter 20 Generic Classes and Methods
The Relationship Between Separation Logic and Implicit Dynamic Frames
Chien-Chung Shen CIS/UD
Modular Verification of Message Passing Programs
Sequences Objectives:
Regression Models - Introduction
Concurrent Graph Exploration with Multiple Robots
Copyright © Cengage Learning. All rights reserved.
Objects and Aspects: What we’ve seen so far
This Lecture Substitution model
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
READY?.
(Indefinite) Integration
Inheritance in Java CS 3331 Fall 2009.
Predicates and Quantifiers
A simple function.
Handling Exceptionally Sticky Problems
Object Oriented System Design Class Diagrams
Completing the Square.
This Lecture Substitution model
SECTION 4: OO METHODOLOGIES
Group 4: Song Li, Ying Lu, Hexin Wang, and Michael Walker May 1, 2000
Sequences Objectives:
Presentation transcript:

Comparing Universes and Existential Ownership Types Nicholas Cameron Werner Dietl ETH Zurich Victoria University of Wellington

Ownership

● Structure the heap into a hierarchy ● Enforce this structure statically ● Many ways to implement this idea ● Topology (description) vs encapsulation

Ownership Types ● Ownership information presented using context parameters class C { C f1; C f2; } – Clarke, Potter, Noble; OOPSLA '98 – Clarke; PhD Thesis '01 – Clarke, Drossopoulou; OOPSLA '02 –....

Universes ● Ownership information expressed using annotations – Universe modifiers class C { peer C f1; rep C f2; any C f3; } – Müller, Poetzsch-Heffter; PLFP '99 – Müller '01 – Dietl, Müller; JOT '05 – Cunningham et al; FMCO '08 –....

Universes ● Internal types – lost C – self C

Comparison ● rep C ● peer C ● self C ● any C ● lost C ● C

Existential Quantification ● Jo Ǝ – Cameron, Drossopoulou; ESOP '09 ● Expresses partial knowledge about ownership – Ǝ x.C ● Denotes an object owned by some unknown object

Comparison ● rep C ● peer C ● self C ● any C ● lost C ● C ● Ǝ x.C ● C – Where x is fresh

Comparison - Jo Ǝ - ● Full power of Jo Ǝ not required to model Universes ● We use a smaller calculus - Jo Ǝ -

Comparison - Jo Ǝ - ● In – Owner parameter – this and owner contexts – Existential quantification – Implicit packing and unpacking – subclassing ● Out – Context parameters – Local variables as contexts – Generics – Bounded quantification – Explicit packing and unpacking – Parametric methods

Comparison - Subtyping ● Universe modifier ordering corresponds to existential introduction in subtyping ● eg, – peer C <: any C – C

Comparison – Type Checking ● Viewpoint adaptation used in Universes to adapt modifiers to a different context ● Corresponds to substitution of context parameters, existential unpacking, and some extras

Comparison - Repacking ● Universes can give an expression a lost type ● Jo Ǝ repacks unpacked context parameters

Formalisation of Universes ● An alternative formalisation of Universes ● More closely matches Jo Ǝ – i.e., more closely matches the underlying typing properties

Formalisation of Universes ● lost types are closed to any types – Safe because any C is a supertype of lost C, but can't do anything with lost C ● lost types are only sub- (or super)types of any types ● C – Not even reflexivity ● C – Don't need to check for lost in the type rules

Formalisation of Universes

Formal Properties ● We prove translation from Universes to alternate Universes to Jo Ǝ -

Summary ● Universes and Ownership Types describe the heap structures – We've only examined the descriptive, topological factors ● Universes can be formalised more closely to existing type systems ● A starting point to compare expressivity – Generics

Generics ● Future work ● Add type parameters to Universes and Jo Ǝ - ● Compares GUT ● Expressivity of context parameters mostly given by type parameters: – class List { List next; Object datum; } – class List { List next; X datum; }

Thank you! Questions?