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]  David Walker,et al.  Stack-based typed assembly language , 1998, Journal of Functional Programming.

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

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

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

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

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

[7]  Philip Wadler,et al.  There's No Substitute for Linear Logic , 1991 .

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

[9]  Patrick Lincoln,et al.  Linear logic , 1992, SIGA.

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

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

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

[13]  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.

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

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

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

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

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

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

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

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

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

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

[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]  John Tang Boyland,et al.  Alias burying: Unique variables without destructive reads , 2001, Softw. Pract. Exp..

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

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

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

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

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

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

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

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

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

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

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

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

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

[39]  Atsushi Igarashi,et al.  A generic type system for the Pi-calculus , 2004, Theor. Comput. Sci..

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