Region analysis and a pi-calculus with groups

We show that the typed region calculus of Tofte and Talpin can be encoded in a typed π-calculus equipped with name groups and a novel effect analysis. In the region calculus, each boxed value has a statically determined region in which it is stored. Regions are allocated and de-allocated according to a stack discipline, thus improving memory management. The idea of name groups arose in the typed ambient calculus of Cardelli, Ghelli, and Gordon. There, and in our π-calculus, each name has a statically determined group to which it belongs. Groups allow for type-checking of certain mobility properties, as well as effect analyses. Our encoding makes precise the intuitive correspondence between regions and groups. We propose a new formulation of the type preservation property of the region calculus, which avoids Tofte and Talpin's rather elaborate co-inductive formulation. We prove the encoding preserves the static and dynamic semantics of the region calculus. Our proof of the correctness of region de-allocation shows it to be a specific instance of a general garbage collection principle for the π-calculus with effects. We propose new equational laws for letregion, analogous to scope mobility laws in the π-calculus, and show them sound in our semantics.

[1]  Philip Wadler,et al.  The marriage of effects and monads , 1998, ICFP '98.

[2]  Simon L. Peyton Jones,et al.  State in Haskell , 1995, LISP Symb. Comput..

[3]  Robin Milner,et al.  A Calculus of Mobile Processes, II , 1992, Inf. Comput..

[4]  Luca Cardelli,et al.  Ambient Groups and Mobility Types , 2000, IFIP TCS.

[5]  Davide Sangiorgi,et al.  Typing and subtyping for mobile processes , 1993, [1993] Proceedings Eighth Annual IEEE Symposium on Logic in Computer Science.

[6]  Robin Milner,et al.  A Calculus of Mobile Processes, II , 1992, Inf. Comput..

[7]  John Hughes,et al.  Recursion and dynamic data-structures in bounded space: towards embedded ML programming , 1999, ICFP '99.

[8]  Xavier Leroy,et al.  A syntactic theory of type generativity and sharing , 1996, Journal of Functional Programming.

[9]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[10]  Colin J. Taylor,et al.  Formalising and reasoning about fudgets , 1998 .

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

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

[13]  Flemming Nielson,et al.  Higher-order concurrent programs with finite communication topology (extended abstract) , 1994, POPL '94.

[14]  Davide Sangiorgi,et al.  The Pi-Calculus - a theory of mobile processes , 2001 .

[15]  Martín Abadi,et al.  A calculus for cryptographic protocols: the spi calculus , 1997, CCS '97.

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

[17]  Dal ZilioSilvano,et al.  Region analysis and a -calculus with groups , 2002 .

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

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

[20]  Nobuko Yoshida,et al.  Graph Types for Monadic Mobile Processes , 1996, FSTTCS.

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

[22]  Martín Abadi,et al.  A Calculus for Cryptographic Protocols: The spi Calculus , 1999, Inf. Comput..

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

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

[25]  David N. Turner,et al.  The polymorphic Pi-calculus : theory and implementation , 1996 .

[26]  Davide Sangiorgi,et al.  Behavioral equivalence in the polymorphic pi-calculus , 2000, JACM.

[27]  Claudio V. Russo Standard ML Type Generativity as Existential Quantification , 1996 .

[28]  HanneRiisNielson ComputerScienceDepartment From Cml to Process Algebras , 1993 .

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

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

[31]  Flemming Nielson,et al.  From CML to Process Algebras (Extended Abstract) , 1993, CONCUR.

[32]  Martín Abadi,et al.  Object Types against Races , 1999, CONCUR.

[33]  Robin Milner,et al.  Barbed Bisimulation , 1992, ICALP.

[34]  Amr Sabry,et al.  Monadic encapsulation in ML , 1999, ICFP '99.

[35]  Silvano Dal Zilio A Bisimulation for the Blue Calculus , 1999 .

[36]  David K. Gifford,et al.  Integrating functional and imperative programming , 1986, LFP '86.

[37]  Eugenio Moggi,et al.  Monadic Encapsulation of Effects: a Revised Approach , 1999, Electron. Notes Theor. Comput. Sci..

[38]  Cédric Fournet,et al.  The reflexive CHAM and the join-calculus , 1996, POPL '96.

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

[40]  Jean-Pierre Talpin,et al.  Aspects Theoriques Et Pratiques De L'inferences De Type Et Effets , 1993 .

[41]  Davide Sangiorgi,et al.  On asynchrony in name-passing calculi , 1998, Mathematical Structures in Computer Science.

[42]  Jean-Pierre Talpin A Simplified Account of Region Inference , 2001 .

[43]  Robin Milner,et al.  Communicating and mobile systems - the Pi-calculus , 1999 .

[44]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[45]  David Walker,et al.  Objects in the pi-Calculus , 1992, Inf. Comput..

[46]  Greg Morrisett,et al.  Typed memory management , 2001 .

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

[48]  Davide Sangiorgi,et al.  Interpreting Functions as Pi-Calculus Processes: A Tutorial , 1999 .

[49]  Benjamin C. Pierce,et al.  Pict: a programming language based on the Pi-Calculus , 2000, Proof, Language, and Interaction.

[50]  P. Wadler The Marriage of Eeects and Monads , 1998 .

[51]  Davide Sangiorgi,et al.  Communicating and Mobile Systems: the π-calculus, , 2000 .

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