Stratified operational semantics for safety and correctness of the region calculus

The region analysis of Tofte and Talpin is an attempt to determine statically the life span of dynamically allocated objects. But the calculus is at once intuitively simple, yet deceptively subtle, and previous theoretical analyses have been frustratingly complex: no analysis has revealed and explained in simple terms the connection between the subleties of the calculus and the imperative features it builds on. We present a novel approach for proving safety and correctness of a simplified version of the region calculus. We give a stratified operational semantics, composed of a highlevel semantics dealing with the conceptual difficulties of effect annotations, and a low-level one with explicit operations on a region-indexed store. The main results of the paper are a proof simpler than previous ones, and a modular approach to type safety and correctness. The flexibility of this approach is demonstrated by the simplicity of the extension to the full calculus with type and region polymorphism.

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

[2]  Peter W. O'Hearn,et al.  Semantic analysis of pointer aliasing, allocation and disposal in Hoare logic , 2000, PPDP '00.

[3]  David K. Gifford,et al.  Polymorphic effect systems , 1988, POPL '88.

[4]  Richard Bornat,et al.  Proving Pointer Programs in Hoare Logic , 2000, MPC.

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

[6]  Alexander Aiken,et al.  Better static memory management: improving region-based analysis of higher-order languages , 1995, PLDI '95.

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

[8]  Pierre Jouvelot,et al.  Polymorphic type, region and effect inference , 1992, Journal of Functional Programming.

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

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

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

[12]  George C. Necula,et al.  Proof-carrying code , 1997, POPL '97.

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

[14]  Peter Thiemann,et al.  Syntactic Type Soundness for the Region Calculus , 2001, HOOTS.

[15]  Nick Benton,et al.  Compiling standard ML to Java bytecodes , 1998, ICFP '98.

[16]  Karl Crary,et al.  From system F to typed assembly language , 1999, TOPL.

[17]  Nick Benton,et al.  Monads, Effects and Transformations , 1999, Electron. Notes Theor. Comput. Sci..

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