Types for 0, 1 or many uses
This paper will present an analysis for detecting single uses of values in functional programs during call-by-need reduction. There are several reasons why such information can be useful. The Clean language uses a uniqueness type system for detecting single-threaded uses which allow destructive updating. Single-use information has also been proposed for compile-time garbage collection. Turner, Wadler and Mossin have presented a single-use analysis which is intended to detect cases where call-by-need can safely be replaced by call-by-name.
This paper will focus on this last application of single-use analysis and present a type-based analysis which overcomes some limitations present in the abovementioned analysis.
KeywordsProgram analysis storage management functional programming types constraints
Unable to display preview. Download preview PDF.
- Erik Barendsen and Sjaak Smetsers. Uniqueness type inference. In PLILP'95, Utrecht, The Netherlands (Lecture Notes in Computer Science, vol. 982), pages 189–206. Springer-Verlag LNCS 982, 1995.Google Scholar
- Thomas P. Jensen and Torben Æ. Mogensen. A backwards analysis for compiletime garbage collection. In ESOP '90, Copenhagen, Denmark (Lecture Notes in Computer Science, vol. 432), pages 227–239. Springer-Verlag LNCS 432, 1990.Google Scholar
- Simon L. Peyton Jones and David Lester. Implementing Functional Languages. Prentice Hall Series in Computer Science. Prentice Hall, New York, London, Toronto, Syney, Tokyo, Signapore, 1 edition, 1992.Google Scholar
- G. Kildall. A unified approach to global program optimization. In Proceedings of the 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 194–206. ACM Press, January 1993.Google Scholar
- M.J. Plasmeijer and M.C.J.D. van Eekelen. Concurrent clean 1.0 language report. Technical report, Computing Science Institute, University of Nijmegen, 1995.Google Scholar
- Jakob Rehof and Torben Æ. Mogensen. Tractable constraints in finite semilattices. In R. Cousot and D.A. Sscmidt, editors, Third International Static Analysis Symposium (SAS), volume 1145 of Lecture Notes in Computer Science, pages 285–301. Springer, September 1996.Google Scholar
- Mads Tofte, Lars Birkedal, Martin Elsman, Niels Hallenberg, Tommy Højfeld Olesen, Peter Sestoft, and Peter Bertelsen. Programming with regions in the ML Kit. Technical report, Dept. of Computer Science, University of Copenhagen, 1997.Google Scholar
- Mads Tofte and Jean-Pierre Talpin. Implementing the call-by-value lambda-calculus using a stack of regions. In Proceedings of the 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, January 1994.Google Scholar
- David N. Turner, Philip Wadler, and Christian Mossin. Once upon a type. In 1th International Conference on Functional Programming and Computer Architecture, pages 1–11, La Jolla, California, June 1995. ACM Press.Google Scholar