|
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.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
1
|
Alexander Aiken , Manuel Fähndrich , Raph Levien, Better static memory management: improving region-based analysis of higher-order languages, Proceedings of the ACM SIGPLAN 1995 conference on Programming language design and implementation, p.174-185, June 18-21, 1995, La Jolla, California, United States
|
 |
2
|
|
 |
3
|
Lars Birkedal , Mads Tofte , Magnus Vejlstrup, From region inference to von Neumann machines via region representation inference, Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.171-183, January 21-24, 1996, St. Petersburg Beach, Florida, United States
[doi> 10.1145/237721.237771]
|
 |
4
|
|
| |
5
|
DIJKSTRA, E. W. 1960. Recursive programming. Numerische Math 2, 312-318. Also in Rosen: "Programming Systems and Languages", McGraw-Hill, 1967.
|
| |
6
|
HALLENBERG, N. 1997. ML Kit test report. (Automatically generated test report; available at http:////www, diku. dk//reseat ch-gr o ups//to p ps//act ivi ties//ki t 2//test. ps).
|
| |
7
|
|
 |
8
|
|
 |
9
|
|
 |
10
|
A. J. Kfoury , J. Tiuryn , P. Urzyczyn, The undecidability of the semi-unification problem, Proceedings of the twenty-second annual ACM symposium on Theory of computing, p.468-476, May 13-17, 1990, Baltimore, Maryland, United States
[doi> 10.1145/100216.100279]
|
| |
11
|
LEROY, X. 1992. Typage polymophe d'un language Mgorithmique. Ph.D. thesis, University Paris VII. English version: Polymorphic Typing of an Algorithmic Language, INRIA Research Report no. 1778, October 1992.
|
 |
12
|
|
| |
13
|
MILNER, R. 1978. A theory of type polymorphism in programming. J. Computer and System Sciences 17, 348-375.
|
| |
14
|
|
| |
15
|
|
 |
16
|
J. W. Backus , F. L. Bauer , J. Green , C. Katz , J. McCarthy , A. J. Perlis , H. Rutishauser , K. Samelson , B. Vauquois , J. H. Wegstein , A. van Wijngaarden , M. Woodger , P. Naur, Revised report on the algorithm language ALGOL 60, Communications of the ACM, v.6 n.1, p.1-17, Jan. 1963
[doi> 10.1145/366193.366201]
|
| |
17
|
NIELSON, F., NIELSON, H. R., AND AMTOFT, T. 1996. Polymorphic subtyping for effect analysis: the algorithm. Tech. Rep. LOMAPS-DAIMI-16, Department of Computer Science, University of Aarhus (DAIMI). April.
|
 |
18
|
|
 |
19
|
|
| |
20
|
TALPIN, J.-P. 1993. Theoretical and practical aspects of type and effect inference. Doctoral Dissertation. Also available as Research Report EMP//CRI//A-236, Ecole des Mines de Paris.
|
| |
21
|
TALPIN, J.-P. AND JOUVELOT, P. 1992a. Polymorphic type, region and effect inference. Journal of Functional Programming 2, 3.
|
| |
22
|
TALPIN, J.-P. AND JOUVELOT, P. 1992b. The type and effect discipline. In Proceedings of the seventh IEEE Conference on Logic in Computer Science. 162-173. Also, (extended version) technical report EMP//CRI//A-206, Ecole des Mines de Paris, April 1992.
|
| |
23
|
TOFTE, M. 1988. Operational semantics and polymorphic type inference. Ph.D. thesis, Edinburgh University, Department of Computer Science, Edinburgh University, Mayfield Rd., EH9 3JZ Edinburgh. Available as Technical Report CST-52-88.
|
| |
24
|
TOFTE, M. AND BIRKEDAL, L. 1996. Unification and polymorphism in region inference. Submitted to the Milner Festschrift. http ://www. diku. dk/users/tofte/publ/milner, ps.
|
| |
25
|
TOFTE, M., BIRKEDAL, L., ELSMAN, M.,, HALLENBERG, N., OLESEN, T. H., SESTOFT, P., AND BERTELSEN, P. 1997. Programming with regions in the ML Kit. Tech. Rep. DIKU-TR-97/12, Dept. of Computer Science, University of Copenhagen. (http://www.diku.dk/research-groups/ topps / activities/kit 2).
|
| |
26
|
TOFTE, M. AND TALPIN, J.-P. 1992. Data region inference for polymorphic functional languages (technical summary). Tech. Rep. EMP/CRI/A-229, Ecole des Mines de Paris.
|
 |
27
|
|
| |
28
|
|
| |
29
|
|
CITED BY 32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Karl Crary , David Walker , Greg Morrisett, Typed memory management in a calculus of capabilities, Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.262-275, January 20-22, 1999, San Antonio, Texas, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ADDITIONAL RESOURCES
Appendices A-C do not appear in the print version of this
article. They are contained in the online version of this article
and are also available in a separate online document.
|