Linear Types for Aliased Resources (Extended Version)

Type systems that track aliasing can verify state-dependent program properties. For example, such systems can verify that a program does not access a resource after deallocating the resource. The simplest way to track aliasing is to use linear types, which on the surface appear to ban the aliasing of linear resources entirely. Since banning aliasing is considered too draconian for many practical programs, researchers have proposed type systems that allow limited forms of aliasing, without losing total control over state-dependent properties. This paper describes how to encode one such system, the capability calculus, using a type system based on plain linear types with no special support for aliasing. Given well-typed capability calculus source programs, the encodings produce well-typed target programs based on linear types. These encodings demonstrate that, contrary to common expectations, linear type systems can express aliasing of linear resources.

[1]  Decision problems for propositional linear logic , 1990, Proceedings [1990] 31st Annual Symposium on Foundations of Computer Science.

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

[3]  Philip Wadler Is there a use for linear logic , 1991 .

[4]  Thierry Coquand,et al.  Inheritance as Implicit Coercion , 1991, Inf. Comput..

[5]  B. Pierce Programming with intersection types and bounded polymorphism , 1992 .

[6]  Philip Wadler,et al.  A Taste of Linear Logic , 1993, MFCS.

[7]  Martin Odersky,et al.  Call-by-name, call-by-value, call-by-need and the linear lambda calculus , 1995, MFPS.

[8]  Carl A. Gunter,et al.  Reference counting as a computational interpretation of linear logic , 1996, Journal of Functional Programming.

[9]  Martín Abadi,et al.  Syntactic considerations on recursive types , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[10]  Mads Tofte,et al.  Region-based Memory Management , 1997, Inf. Comput..

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

[12]  Philip Wadler,et al.  Operational Interpretations of Linear Logic , 1999, Theor. Comput. Sci..

[13]  MorrisettGreg,et al.  From system F to typed assembly language , 1999 .

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

[15]  Karl Crary Typed compilation of inclusive subtyping , 2000, ICFP '00.

[16]  David Walker,et al.  On regions and linear types (extended abstract) , 2001, ICFP '01.

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

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

[19]  Karl Crary,et al.  An expressive, scalable type theory for certified code , 2002, ICFP '02.

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

[21]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

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

[23]  Heng Huang,et al.  Low-Level Linear Memory Management , 2003 .

[24]  J. Gregory Morrisett,et al.  Monadic regions , 2004, ICFP '04.

[25]  Chris Hawblitzel,et al.  Type-Safe Operating System Abstractions , 2004 .

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