Lecture Notes in Computer Science 7850 Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen Editorial Board David Hutchison Lancaster University, UK Takeo Kanade Carnegie Mellon University, Pittsburgh, PA, USA Josef Kittler University of Surrey, Guildford, UK Jon M. Kleinberg Cornell University, Ithaca, NY, USA Alfred Kobsa University of California, Irvine, CA, USA Friedemann Mattern ETH Zurich, Switzerland John C. Mitchell Stanford University, CA, USA Moni Naor Weizmann Institute of Science, Rehovot, Israel Oscar Nierstrasz University of Bern, Switzerland C. Pandu Rangan Indian Institute of Technology, Madras, India Bernhard Steffen TU Dortmund University, Germany Madhu Sudan Microsoft Research, Cambridge, MA, USA Demetri Terzopoulos University of California, Los Angeles, CA, USA Doug Tygar University of California, Berkeley, CA, USA Gerhard Weikum Max Planck Institute for Informatics, Saarbruecken, Germany
Dave Clarke James Noble Tobias Wrigstad (Eds.) Aliasing in Object-Oriented Programming Types, Analysis, and Verification 13
Volume Editors Dave Clarke Katholieke Universiteit Leuven, Department of Computer Science Celestijnenlaan 200A, 3001 Heverlee, Belgium E-mail: dave.clarke@cs.kuleuven.be James Noble Victoria University of Wellington, School of Engineering and Computer Science Cotton Building, Gate 6, Kelburn Parade, Wellington 6140, New Zealand E-mail: kjx@ecs.vuw.ac.nz Tobias Wrigstad Uppsala University, Department of Information Technology Lägerhyddsvägen 2, 752 37 Uppsala, Sweden E-mail: tobias.wrigstad@it.uu.se ISSN 0302-9743 e-issn 1611-3349 ISBN 978-3-642-36945-2 e-isbn 978-3-642-36946-9 DOI 10.1007/978-3-642-36946-9 Springer Heidelberg Dordrecht London New York Library of Congress Control Number: 2013932225 CR Subject Classification (1998): D.1.5, D.1.3, D.4.2, D.2.4-5, D.2.7, D.3.1-3, A.1, K.2 LNCS Sublibrary: SL 2 Programming and Software Engineering Springer-Verlag Berlin Heidelberg 2013 This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in ist current version, and permission for use must always be obtained from Springer. Violations are liable to prosecution under the German Copyright Law. The use of general descriptive names, registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. Typesetting: Camera-ready by author, data conversion by Scientific Publishing Services, Chennai, India Printed on acid-free paper Springer is part of Springer Science+Business Media (www.springer.com)
Preface Aliasing is one of the key features of object-oriented programming languages, but it is both a blessing and a curse. On one hand it enables the expression of sophisticated designs involving sharing, but on the other hand it makes reasoning about programs difficult for programmers, for tools such as compilers, and for programming verification. This book presents a survey of the state of the art on techniques for dealing with aliasing in object-oriented programming. It marks the 20th anniversary of the paper The Geneva Convention on The Treatment of Object Aliasing by John Hogg, Doug Lea, Alan Wills, Dennis dechampeaux, and Richard Holt, which stressed the need for a systematic study of aliasing in object-oriented programming. Since that paper was published in 1992, several workshops have been devoted to this topic, including the Intercontinental Workshop on Aliasing in Object Oriented Systems (IWAOOS) in 1999 and five instalments of the International Workshop on Aliasing, Confinement and Ownership in object-oriented programming (IWACO) in 2003, 2007, 2008, 2009 and 2011. The most recent IWACO was dedicated to 20 years of aliasing in objectoriented languages and at that venue it was decided to produce a state-of-theart LNCS volume dedicated to research in this field. This is the volume you are reading now.papers were solicited from contributors to IWACO and other experts in the area. The result is a broad collection of papers covering many aspects of aliasing in object-oriented programming. Each paper has been extensively reviewed to ensure the highest quality. We hope that this collection will be a valuable addition to researchers bookshelves, and that it will be useful to both active researchers and graduate students alike. January 2013 Dave Clarke James Noble Tobias Wrigstad
Table of Contents The Geneva Convention Beyond the Geneva Convention on the Treatment of Object Aliasing... 1 Dave Clarke, James Noble, and Tobias Wrigstad The Geneva Convention on the Treatment of Object Aliasing... 7 John Hogg, Doug Lea, Alan Wills, Dennis de Champeaux, and Richard Holt Ownership Ownership Types: A Survey... 15 Dave Clarke, Johan Östlund, Ilya Sergey, and Tobias Wrigstad Notions of Aliasing and Ownership... 59 Alan Mycroft and Janina Voigt Understanding Ownership Types with Dependent Types... 84 Nicholas Cameron, Sophia Drossopoulou, and James Noble Object Graphs with Ownership Domains: An Empirical Study... 109 Radu Vanciu and Marwan Abi-Antoun Concurrency Alias Control for Deterministic Parallelism... 156 Robert L. Bocchino Jr. Alias Analysis Alias Analysis for Object-Oriented Programs... 196 Manu Sridharan, Satish Chandra, Julian Dolby, Stephen J. Fink, and Eran Yahav Controlling Effects Immutability... 233 Alex Potanin, Johan Östlund, Yoav Zibin, and Michael D. Ernst Fractional Permissions... 270 John Boyland
VIII Table of Contents Verification Object Ownership in Program Verification... 289 Werner Dietl and Peter Müller State Based Encapsulation for Modular Reasoning about Behavior-Preserving Refactorings... 319 Anindya Banerjee and David A. Naumann Separation Logic for Object-Oriented Programming... 366 Matthew Parkinson and Gavin Bierman VeriFast for Java: A Tutorial... 407 Jan Smans, Bart Jacobs, and Frank Piessens Programming Languages Confined Roles and Decapsulation in Object Teams Contradiction or Synergy?... 443 Stephan Herrmann Location Types for Safe Programming with Near and Far References... 471 Yannick Welsch, Jan Schäfer, and Arnd Poetzsch-Heffter Visions The Future of Aliasing in Parallel Programming... 501 Robert L. Bocchino Jr. Aliasing Visions: Ownership and Location... 503 Alan Mycroft Alias Analysis: Beyond the Code... 505 Manu Sridharan How, Then, Should We Program?... 507 James Noble A Retrospective on Aliasing Type Systems: 2012-2022... 509 Jonathan Aldrich Structured Aliasing... 512 Tobias Wrigstad Author Index... 515