L3: A Linear Language with Locations

We present a simple, but expressive type system that supports strong updates - updating a memory cell to hold values of unrelated types at different points in time. Our formulation is based upon a standard linear lambda calculus and, as a result, enjoys a simple semantic interpretation for types that is closely related to models for spatial logics. The typing interpretation is strong enough that, in spite of the fact that our core programming language supports shared, mutable references and cyclic graphs, every well-typed program terminates. We then consider extensions needed to model ML-style references, where the capability to access a reference cell is unrestricted, but strong updates are disallowed. Our extensions include a thaw primitive for re-gaining the capability to perform strong updates on unrestricted references. The thaw primitive is closely related to other mechanisms that support strong updates, such as CQUAL's restrict.

[1]  M. Hofmann A Type System for Bounded Space and Functional In-Place Update , 2000, Nord. J. Comput..

[2]  John Tang Boyland,et al.  Connecting effects and uniqueness with adoption , 2005, POPL '05.

[3]  Philip Wadler,et al.  Linear Types can Change the World! , 1990, Programming Concepts and Methods.

[4]  Andrew Barber,et al.  Dual Intuitionistic Linear Logic , 1996 .

[5]  Nick Benton Strong Normalisation for the Linear Term Calculus , 1995, J. Funct. Program..

[6]  Amal Ahmed,et al.  Semantics of types for mutable state , 2004 .

[7]  Alexander Aiken,et al.  Checking and inferring local non-aliasing , 2003, PLDI '03.

[8]  Dave Clarke,et al.  External Uniqueness Is Unique Enough , 2003, ECOOP.

[9]  Matthew Fluet,et al.  A Linear Language with Locations , 2007 .

[10]  Jan Vitek,et al.  Confined types in Java , 2001, Softw. Pract. Exp..

[11]  Martin Rinard,et al.  A Type System for Safe Region-Based Memory Management in Real-Time Java , 2002 .

[12]  Andrew W. Appel,et al.  An Indexed Model of Impredicative Polymorphism and Mutable References , 2003 .

[13]  David Walker,et al.  Typed memory management in a calculus of capabilities , 1999, POPL '99.

[14]  Viktor Kuncak,et al.  Role analysis , 2002, POPL '02.

[15]  Jens Palsberg,et al.  Encapsulating objects with confined types , 2001, OOPSLA 2001.

[16]  Andrew W. Appel,et al.  An indexed model of recursive types for foundational proof-carrying code , 2001, TOPL.

[17]  Peter W. O'Hearn,et al.  From Algol to polymorphic linear lambda-calculus , 2000, JACM.

[18]  Peter W. O'Hearn,et al.  BI as an assertion language for mutable data structures , 2001, POPL '01.

[19]  Martin C. Rinard,et al.  Ownership types for safe region-based memory management in real-time Java , 2003, PLDI '03.

[20]  Samson Abramsky,et al.  Computational Interpretations of Linear Logic , 1993, Theor. Comput. Sci..

[21]  Paulo Sérgio Almeida Balloon Types: Controlling Sharing of State in Data Types , 1997, ECOOP.

[22]  Atsushi Igarashi,et al.  A generic type system for the Pi-calculus , 2001, POPL '01.

[23]  Dan Grossman,et al.  Experience with safe manual memory-management in cyclone , 2004, ISMM '04.

[24]  Marko C. J. D. van Eekelen,et al.  Guaranteeing Safe Destructive Updates Through a Type System with Uniqueness Information for Graphs , 1993, Dagstuhl Seminar on Graph Transformations in Computer Science.

[25]  David Walker,et al.  Stack-based typed assembly language , 1998, Journal of Functional Programming.

[26]  Nick Benton,et al.  A Term Calculus for Intuitionistic Linear Logic , 1993, TLCA.

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

[28]  David Aspinall,et al.  Heap-Bounded Assembly Language , 2004, Journal of Automated Reasoning.

[29]  Robert DeLine,et al.  Enforcing high-level protocols in low-level software , 2001, PLDI '01.

[30]  Jean-Yves Girard,et al.  Linear Logic , 1987, Theor. Comput. Sci..

[31]  Robert DeLine,et al.  Adoption and focus: practical linear types for imperative programming , 2002, PLDI '02.

[32]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[33]  John Tang Boyland,et al.  Capabilities for Sharing: A Generalisation of Uniqueness and Read-Only , 2001, ECOOP.

[34]  Marko C. J. D. van Eekelen,et al.  Keep it clean: a unique approach to functional programming. , 1999, SIGP.

[35]  David Walker,et al.  Alias Types for Recursive Data Structures , 2000, Types in Compilation.

[36]  David Gerard Clarke,et al.  Object ownership and containment , 2003 .

[37]  David Walker,et al.  Typed memory management via static capabilities , 2000, TOPL.

[38]  Kohei Honda,et al.  An Interaction-based Language and its Typing System , 1994, PARLE.

[39]  Martin Hofmann,et al.  Another Type System for In-Place Update , 2002, ESOP.

[40]  James Cheney,et al.  A Linearly Typed Assembly Language , 2003 .

[41]  Henry G. Baker,et al.  Lively linear Lisp: “look ma, no garbage!” , 1992, SIGP.

[42]  Dan Grossman,et al.  TALx86: A Realistic Typed Assembly Language∗ , 1999 .

[43]  David Walker,et al.  Alias Types , 2000, ESOP.

[44]  Benjamin C. Pierce,et al.  Linearity and the pi-calculus , 1999, TOPL.

[45]  Marinus J. Plasmeijer,et al.  The Ins and Outs of Clean I/O , 1995, J. Funct. Program..

[46]  John Hogg,et al.  Islands: aliasing protection in object-oriented languages , 1991, OOPSLA '91.

[47]  John Tang Boyland,et al.  Alias burying: Unique variables without destructive reads , 2001, Softw. Pract. Exp..