## Unification and Polymorphism in Region Inference (1996)

Venue: | In Proof, Language, and Interaction: Essays in Honour of Robin Milner |

Citations: | 10 - 2 self |

### BibTeX

@INPROCEEDINGS{Tofte96unificationand,

author = {Mads Tofte and Lars Birkedal},

title = {Unification and Polymorphism in Region Inference},

booktitle = {In Proof, Language, and Interaction: Essays in Honour of Robin Milner},

year = {1996},

pages = {389--425},

publisher = {MIT Press}

}

### Years of Citing Articles

### OpenURL

### Abstract

Region Inference is a technique for inferring lifetimes of values in strict, higher-order programming languages such as Standard ML. The purpose of this paper is to show how ideas from Milner's polymorphic type discipline can serve as a basis for region inference, even in the presence of a limited form of polymorphic recursion.

### Citations

945 |
A machine-oriented logic based on the resolution principle
- Robinson
- 1965
(Show Context)
Citation Context ... towers of Hanoi. We then introduce a technical notion, consistency, which is required for the statement and proof of a key lemma. Informally speaking, this lemma (Lemma 6) says that Robinson's result=-=[17]-=- concerning most general unifiers of terms generalises to the case where terms are types which are annotated with regions and effects, provided the annotation is done consistently. We define operation... |

936 | A theory of type polymorphism in progra.mming
- Milner
- 1978
(Show Context)
Citation Context ...nference specialises memory management to the particular program that is being compiled. The relevance of region inference to this Festschrift is that Milner's work on type inference and type checking=-=[10]-=- has provided many of the technical insights which underlie region inference. (Other origins of region inference are listed in Section 3.) In particular, the idea of using unification in type checking... |

605 |
The Definition of Standard ML (Revised
- Milner, Tofte, et al.
- 1997
(Show Context)
Citation Context ... for a suitable choice of concrete representation of regions. Rather than forcing the programmer to introduce and eliminate regions, we have taken the approach to use an existing language, Standard ML=-=[11]-=-, as the source language. The region scheme, including the algorithms presented in this paper, are implemented in the ML Kit with Regions [21] which compiles Standard ML Core Language programs to C an... |

436 | R.: Uniprocessor Garbage Collection Techniques
- Wilson
- 1992
(Show Context)
Citation Context ... storage cells. The term "garbage collection" is traditionally used for a range of heap memory management techniques, including reference counting, copying collection and generational collec=-=tion (see [25]-=- for an excellent overview). 1 Common to all of these techniques is that there is a strict separation between the program which allocates memory, called the mutator, and the part of the runtime system... |

280 | Region-based memory management
- Tofte, Talpin
- 1997
(Show Context)
Citation Context ...27 are used for. 3 Related Work The basic ideas of the region inference scheme are described in [23]. An extended version, including a proof that the region inference rules are sound, may be found in =-=[24]-=-. Other analysis which have been combined with region inference are described in [1, 2]. The emphasis of this paper is on using unification to constrain region variables and arrow effects. (Arrow effe... |

233 |
Principal type schemes for functional programs
- Damas, Milner
- 1982
(Show Context)
Citation Context ...cts than the most general unifier, but they also lead to unnecessary identifications of regions and are therefore undesirable. 9 Type Schemes Type schemes resemble the type schemes of Damas and Milner=-=[3] but-=- with additional quantification over region variables and effect variables: oe ::= 8ff 1 \Delta \Delta \Delta ff n ae 1 \Delta \Delta \Delta ae k ffl 1 \Delta \Delta \Delta ffl m :�� (ns0, ks0 and... |

150 | The type and effect discipline
- Talpin, Jouvelot
- 1994
(Show Context)
Citation Context ...n proved in the present paper. A different approach to region inference is to use constraints. Constraints have been used in previous work on ML type inference[5], subtyping [12, 4] and effect systems=-=[19, 18, 14, 13]-=-. We are currently exploring using constraints for region inference. The relative merits of the two approaches to region inference (syntax-directed region inference versus constraint generation and co... |

142 |
The principal type-scheme of an object in combinatory logic
- Hindley
- 1969
(Show Context)
Citation Context ...also on regions and effects. In order to satisfy the premises of the inference rule, the region inference algorithm needs to be able to unify types which contain region and effect information. Hindley=-=[6]-=- and Milner[10] discovered that Robinson's unification algorithm can be used for unifying types. We assume that type inference has already been carried out by the time region inference is performed. T... |

135 | Type inference with polymorphic recursion
- Henglein
- 1993
(Show Context)
Citation Context ...it relies on the results about unification proved in the present paper. A different approach to region inference is to use constraints. Constraints have been used in previous work on ML type inference=-=[5]-=-, subtyping [12, 4] and effect systems[19, 18, 14, 13]. We are currently exploring using constraints for region inference. The relative merits of the two approaches to region inference (syntax-directe... |

129 |
Typechecking records and variants in a natural extension of ML
- Remy
- 1989
(Show Context)
Citation Context ...on of how the function uses regions.) In the case of arrow effects, the difficulty is that the unification is of sets rather than terms. Similar forms of unification have been studied in record typing=-=[16]-=- and in type systems for polymorphic references[9]. The region inference algorithm that is currently used in the ML Kit is described and proved correct in [20]. It is a syntax-directed algorithm, simi... |

120 | Polymorphic type, region and effect inference
- Talpin, Jouvelot
- 1992
(Show Context)
Citation Context ...n proved in the present paper. A different approach to region inference is to use constraints. Constraints have been used in previous work on ML type inference[5], subtyping [12, 4] and effect systems=-=[19, 18, 14, 13]-=-. We are currently exploring using constraints for region inference. The relative merits of the two approaches to region inference (syntax-directed region inference versus constraint generation and co... |

89 | static memory management: Improving regionbased analysis of higher-order languages
- Aiken, Fahndrich, et al.
- 1995
(Show Context)
Citation Context ...ort for reasoning about the lifetimes of storage cells, and thus it is in general very difficult for programmers to reason about how much memory their programs will use. Region-based memory management=-=[23, 1, 2]-=- is yet a form of automatic management of dynamic allocation. Conceptually, the store consists of a stack of regions. A region can be thought of as a heap which can grow dynamically depending on how m... |

89 | From region inference to von Neumann machines via region representation inference
- Birkedal, Tofte, et al.
- 1996
(Show Context)
Citation Context ...ort for reasoning about the lifetimes of storage cells, and thus it is in general very difficult for programmers to reason about how much memory their programs will use. Region-based memory management=-=[23, 1, 2]-=- is yet a form of automatic management of dynamic allocation. Conceptually, the store consists of a stack of regions. A region can be thought of as a heap which can grow dynamically depending on how m... |

76 |
P.: Type inference with subtypes
- Fuh, Mishra
(Show Context)
Citation Context ...e results about unification proved in the present paper. A different approach to region inference is to use constraints. Constraints have been used in previous work on ML type inference[5], subtyping =-=[12, 4]-=- and effect systems[19, 18, 14, 13]. We are currently exploring using constraints for region inference. The relative merits of the two approaches to region inference (syntax-directed region inference ... |

71 |
Coercion and type inference
- Mitchell
- 1984
(Show Context)
Citation Context ...e results about unification proved in the present paper. A different approach to region inference is to use constraints. Constraints have been used in previous work on ML type inference[5], subtyping =-=[12, 4]-=- and effect systems[19, 18, 14, 13]. We are currently exploring using constraints for region inference. The relative merits of the two approaches to region inference (syntax-directed region inference ... |

63 | Higher-order concurrent programs with finite communication topology
- Nielson, Nielson
- 1994
(Show Context)
Citation Context ...n proved in the present paper. A different approach to region inference is to use constraints. Constraints have been used in previous work on ML type inference[5], subtyping [12, 4] and effect systems=-=[19, 18, 14, 13]-=-. We are currently exploring using constraints for region inference. The relative merits of the two approaches to region inference (syntax-directed region inference versus constraint generation and co... |

55 |
Type reconstruction in the presence of polymorphic recursion
- Kfoury, Tiuryn, et al.
- 1993
(Show Context)
Citation Context ...ent of recursive functions in ML as far as type polymorphism is concerned[10]. The reason for this limitation is that type inference for (type-) polymorphic recursion is equivalent to semi-unification=-=[5, 8]-=-, which is undecidable[7]. However, it can be proved that every well-typed source expression can be region-annotated in accordance with the region inference rules[24]. Moreover, in the absence of regi... |

54 |
The undecidability of the semi-unification problem
- Kfoury, Tiuryn, et al.
- 1990
(Show Context)
Citation Context ...n ML as far as type polymorphism is concerned[10]. The reason for this limitation is that type inference for (type-) polymorphic recursion is equivalent to semi-unification[5, 8], which is undecidable=-=[7]-=-. However, it can be proved that every well-typed source expression can be region-annotated in accordance with the region inference rules[24]. Moreover, in the absence of region-polymorphic recursion,... |

31 |
Implementing the call-by-value lambda-calculus using a stack of regions
- Tofte, Talpin
- 1994
(Show Context)
Citation Context ...ort for reasoning about the lifetimes of storage cells, and thus it is in general very difficult for programmers to reason about how much memory their programs will use. Region-based memory management=-=[23, 1, 2]-=- is yet a form of automatic management of dynamic allocation. Conceptually, the store consists of a stack of regions. A region can be thought of as a heap which can grow dynamically depending on how m... |

22 |
Typage polymorphe d'un langage algorithmique
- Leroy
- 1992
(Show Context)
Citation Context ...f arrow effects, the difficulty is that the unification is of sets rather than terms. Similar forms of unification have been studied in record typing[16] and in type systems for polymorphic references=-=[9]-=-. The region inference algorithm that is currently used in the ML Kit is described and proved correct in [20]. It is a syntax-directed algorithm, similar to Milner's algorithm W , and it relies on the... |

10 | Programming with regions in the ML-Kit
- Tofte, Birkedal, et al.
- 1997
(Show Context)
Citation Context ...aken the approach to use an existing language, Standard ML[11], as the source language. The region scheme, including the algorithms presented in this paper, are implemented in the ML Kit with Regions =-=[21]-=- which compiles Standard ML Core Language programs to C and HP PA-RISC code. The ML Kit subjects source programs to a particular static analysis, region inference. The analysis decides where regions s... |

6 |
Data region inference for polymorphic functional languages
- Tofte, Talpin
- 1992
(Show Context)
Citation Context ...n be region-annotated in accordance with the region inference rules[24]. Moreover, in the absence of region-polymorphic recursion, Milner's notion of principal type schemes extends to region inference=-=[22]-=-. In the presence of polymorphic recursion, however, it is not known whether (in some sense) it is possible to infer a principal region type scheme for every ML-typable expression. There seems to be a... |

1 | Polymorphic subtyping for effect analysis: the algorithm
- Nielson, Nielson, et al.
- 1996
(Show Context)
Citation Context |

1 |
A region inference algorithm. (Submitted for publication; available at http://www.diku.dk/users/tofte/publ/toplassubm.a4.ps.Z
- Tofte, Birkedal
- 1996
(Show Context)
Citation Context ...cation have been studied in record typing[16] and in type systems for polymorphic references[9]. The region inference algorithm that is currently used in the ML Kit is described and proved correct in =-=[20]-=-. It is a syntax-directed algorithm, similar to Milner's algorithm W , and it relies on the results about unification proved in the present paper. A different approach to region inference is to use co... |