Syntactic Type Soundness for the Region Calculus

Abstract The region calculus of Tofte and Talpin is an annotated polymorphically typed lambda calculus which makes memory allocation and deallocation explicit. It is intended as an intermediate language in a compiler for ML-like languages. The region annotations are obtained by static region and effect inference, which makes it an attractive alternative for garbage collection. Soundness of the region and effect system is crucial to guarantee safe deallocation of regions, i.e. deallocation should only take place for objects which are provable dead. Tofte and Talpin have proved type soundness of the region calculus using rule-based co-induction. This proof is quite complicated and not very intuitive. Much of the problem lies in the low-level big-step operational semantics which involves manipulations of an explicit store and which has a co-inductive definition. In this paper, we present a small-step operational semantics for the region calculus, based on syntactic rewriting. We prove type soundness following the approach of Wright and Felleisen, leading to very simple inductive proofs.

[1]  Lars Birkedal,et al.  A region inference algorithm , 1998, TOPL.

[2]  Anindya Banerjee,et al.  Region analysis and the polymorphic lambda calculus , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[3]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[4]  Robert Harper,et al.  A Simplified Account of Polymorphic References , 1994, Inf. Process. Lett..

[5]  Andrew D. Gordon,et al.  Region Analysis and a pi-Calculus wiht Groups , 2000, MFCS.

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

[7]  Lars Birkedal,et al.  Unification and polymorphism in region inference , 2000, Proof, Language, and Interaction.

[8]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[9]  Jack Belzer,et al.  Encyclopedia of Computer Science and Technology , 2002 .

[10]  Cristiano Calcagno Stratified operational semantics for safety and correctness of the region calculus , 2001, POPL '01.

[11]  Andrew D. Gordon,et al.  Region analysis and a pi-calculus with groups , 2002, J. Funct. Program..

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

[13]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[14]  Haskell B. Curry,et al.  Combinatory Logic, Volume I , 1959 .

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

[16]  Lars Birkedal,et al.  A constraint-based region inference algorithm , 2001, Theor. Comput. Sci..

[17]  Peter Sestoft,et al.  Partial Evaluation , 1996 .

[18]  Robert Hieb,et al.  The Revised Report on the Syntactic Theories of Sequential Control and State , 1992, Theor. Comput. Sci..

[19]  Olivier Danvy,et al.  A computational formalization for partial evaluation , 1996, Mathematical Structures in Computer Science.

[20]  Olivier Danvy,et al.  Tutorial notes on partial evaluation , 1993, POPL '93.

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