Typing with Conditions and Guarantees for Functional In-place Update

Hofmann's LFPL is a functional language with constructs that can be interpreted as referring to heap locations. In this view, the language is suitable for expressing and verifying in-place update algorithms. Correctness of in-place evaluation is guaranteed by a linear typing. As linearity prevents sharing on the heap, LFPL rejects many sound, natural in-place update algorithms with sharing. Recently, Aspinall and Hofmann added usage aspects to parameters of terms in first-order LFPL in order to type-check sound non-linear programs. Nevertheless, soundness of this system has not been fully established. We show a more subtle meaning of the usage aspects as preconditions and (rely-)guarantees about the heap layout before and after evaluation. This interpretation allows a manageable proof of soundness for Aspinall and Hofmann's system. Secondly, we present an algorithm for inferring the strongest sound usage aspects for typable recursive programs. We outline two other annotated typings of LFPL as systems inferring preconditions and (rely-)guarantees, both extending usage aspects. One is Atkey's system based on explicit indication of sharing among parameters in typing contexts and the other one is a system by the author which admits LFPL programs in which datatypes share at different layers. The latter is based on the author's conditions-and-guarantees approach to usage aspects.

[1]  Michal Konečný,et al.  LFPL with Types for Deep Sharing , 2002 .

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

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

[4]  Martin Hofmann,et al.  The strength of non-size increasing computation , 2002, POPL '02.

[5]  Michal Konečný,et al.  Typing with Conditions and Guarantees in LFPL , 2002 .

[6]  Steffen Jost Static prediction of dynamic space usage of linear functional programs , 2002 .

[7]  Peter W. O'Hearn,et al.  The Logic of Bunched Implications , 1999, Bulletin of Symbolic Logic.

[8]  John C. Reynolds,et al.  Syntactic control of interference , 1978, POPL.

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

[10]  John C. Reynolds,et al.  Syntactic Control of Inference, Part 2 , 1989, ICALP.

[11]  Martin Hofmann,et al.  Static prediction of heap space usage for first-order functional programs , 2003, POPL '03.

[12]  Peter W. O'Hearn,et al.  Syntactic control of interference revisited , 1995, MFPS.

[13]  Martin Hofmann Linear types and non-size-increasing polynomial time computation , 2003, Inf. Comput..

[14]  Peter W. O'Hearn On bunched typing , 2003, J. Funct. Program..

[15]  Martin Hofmann,et al.  Linear types and non-size-increasing polynomial time computation , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

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

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

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