Quasi-linear types

Linear types (types of values that can be used just once) have been drawing a great deal of attention because they are useful for memory management, in-place update of data structures, etc.: an obvious advantage is that a value of a linear type can be immediately deallocated after being used. However, the linear types have not been applied so widely in practice, probably because linear values (values of linear types) in the traditional sense do not so often appear in actual programs. In order to increase the applicability of linear types, we relax the condition of linearity by extending the types with information on an evaluation order and simple dataflow information. The extended type system, called a quasi-linear type system, is formalized and its correctness is proved. We have implemented a prototype type inference system for the core-ML that can automatically find out which value is linear in the relaxed sense. Promising results were obtained from preliminary experiments with the prototype system.

[1]  Matthias Felleisen,et al.  Abstract models of memory management , 1995, FPCA '95.

[2]  Aleksy Schubert,et al.  The EML Kit Version 1 , 1996 .

[3]  Paul Hudak,et al.  Single-threaded polymorphic lambda calculus , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.

[4]  Martin Odersky Observers for Linear Types , 1992, ESOP.

[5]  Philip Wadler,et al.  Once upon a type , 1995, FPCA '95.

[6]  Naoki Kobayashi A Partially Deadlock-free Typed Process Calculus (I) -- A Simple System , 1996 .

[7]  Robin Milner,et al.  Definition of standard ML , 1990 .

[8]  Henry G. Baker A “linear logic” Quicksort , 1994, SIGP.

[9]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .

[10]  Andrew P. Tolmach Tag-free garbage collection using explicit type parameters , 1994, LFP '94.

[11]  Erik Barendsen,et al.  Conventional and Uniqueness Typing in Graph Rewrite Systems , 1993, FSTTCS.

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

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

[14]  Greg Morrisett,et al.  Compiling with Types , 1995 .

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

[16]  Atsushi Igarashi Type-Based Analysis Of Usage Of Values For Concurrent Programming Languages , 1997 .

[17]  Ian Mackie,et al.  Lilac: a functional programming language based on linear logic , 1994, Journal of Functional Programming.

[18]  Mads Tofte,et al.  Implementation of the typed call-by-value λ-calculus using a stack of regions , 1994, POPL '94.

[19]  Atsushi Igarashi,et al.  Type-Based Analysis of Communication for Concurrent Programming Languages , 1997, SAS.

[20]  Naoki Kobayashi A partially deadlock-free typed process calculus , 1998, TOPL.

[21]  Lars Birkedal,et al.  From region inference to von Neumann machines via region representation inference , 1996, POPL '96.