A region inference algorithm
- 1 July 1998
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 20 (4) , 724-767
- https://doi.org/10.1145/291891.291894
Abstract
Region Inference is a program analysis which infers lifetimes of values. It is targeted at a runtime model in which the store consists of a stack of regions and memory management predominantly consists of pushing and popping regions, rather than performing garbage collection. Region Inference has previously been specified by a set of inference rules which formalize when regions may be allocated and deallocated. This article presents an algorithm which implements the specification. We prove that the algorithm is sound with respect to the region inference rules and that it always terminates even though the region inference rules permit polymorphic recursion in regions. The algorithm is the result of several years of experiments with region inference algorithms in the ML Kit, a compiler from Standard ML to assembly language. We report on practical experience with the algorithm and give hints on how to implement it.Keywords
This publication has 16 references indexed in Scilit:
- A theory of type polymorphism in programmingPublished by Elsevier ,2003
- Region-Based Memory ManagementInformation and Computation, 1997
- From region inference to von Neumann machines via region representation inferencePublished by Association for Computing Machinery (ACM) ,1996
- Type inference with polymorphic recursionACM Transactions on Programming Languages and Systems, 1993
- Extending record typing to type parametric modules with sharingPublished by Association for Computing Machinery (ACM) ,1993
- Polymorphic type, region and effect inferenceJournal of Functional Programming, 1992
- Algebraic reconstruction of types and effectsPublished by Association for Computing Machinery (ACM) ,1991
- Type checking records and variants in a natural extension of MLPublished by Association for Computing Machinery (ACM) ,1989
- Polymorphic effect systemsPublished by Association for Computing Machinery (ACM) ,1988
- Revised report on the algorithmic language ALGOL 60Communications of the ACM, 1963