Abstract
One of the remaining problems on the path towards fully automatic partial evaluation is ensuring termination of the specialization phase. In [10] we gave a termination analysis which could be applied to partial evaluation of first-order strict languages, using a new result about inductive arguments (loosely: if whenever something grows, something gets smaller then the program will only enter finitely many different states). In this paper we extend this work to cover higher-order functional languages. We take an operational approach to the problem and consider the closure representation of higher-order functions to perform a combined data- and control-dependency analysis. The result of this analysis is then used, as in the first-order case, to decide which arguments need to be dynamic to guarantee termination of partial evaluation of the analysed program. The new methods have been tested on a variety of programs, and will be incorporated in a future release of the Similix partial evaluator for Scheme.
Preview
Unable to display preview. Download preview PDF.
References
The Similix system, version 5.1. 1995.
Lars Ole Andersen. Binding-time analysis and the taming of C pointers. In David Schmidt, editor, Proc. of ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, PEPM'93, pages 47–58, 1993.
Lars Ole Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994. (DIKU report 94/19).
Peter Holst Andersen and Carsten Kehler Holst. Termination Analysis for Offline Partial Evaluation of a Higher Order Functional Language. Technical Report, DIKU, University of Copenhagen, Denmark, 1996. To appear.
Anders Bondorf and Jesper JØrgensen. Efficient analyses for realistic off-line partial evaluation: extended version. Technical Report 93/4, DIKU, University of Copenhagen, Denmark, 1993.
Charles Consel. A tour of Schism: a partial evaluation system for higher-order applicative languages. In David Schmidt, editor, ACM SIGPLAN Symposium on Partial Evaluation and Semantics Based Program Manipulation, pages 145–154, June 1993.
Charles Consel and Olivier Danvy. Partial evaluation of pattern matching in strings. Information Processing Letters, 30:79–86, January 1989.
B. A. Davey and H. A. Priestley. Introduction to Lattices and Order. Cambridge Mathematical Textbooks, Cambridge University Press, 1990.
Arne J. Glenstrup and Neil D. Jones. BTA algorithms to ensure termination of off-line partial evaluation. In Andrei Ershov Second International Conference “Perspectives of System Informatics∝, Lecture Notes in Computer Science, 1996. Upcoming.
Carsten Kehler Holst. Finiteness analysis. In John Hughes, editor, Functional Programming Languages and Computer Architectures, pages 473–495, ACM, Springer-Verlag, Cambridge, Massachusetts, USA, August 1991.
Neil D. Jones, Carsten Gomaxd, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. C.A.R. Hoare, Series Editor, Prentice Hall International, International Series in Computer Science, June 1993. ISBN number 0-13-020249-5 (pbk).
Neil D. Jones and Steven S. Muchnick. Flow analysis and optimization of Lisp-like structures. In Steven S. Muchnick and Neil D. Jones, editors, Program Flow Analysis: Theory and Applications, chapter 4, pages 102–131, Prentice-Hall, 1981.
H.G. Rice. Classes of recursively enumerable sets and their decision problems. Transaction of the AMS, 89:25–59, 1953.
Peter Sestoft. Replacing Function Parameters by Global Variables. Master's thesis, DIKU, University of Copenhagen, Denmark, October 1988. 107 pages.
David N. Turner, Philip Wadler, and Christian Mossin. Once upon a type. In 7'th International Conference on Functional Programming and Computer Architecture, pages 1–11, ACM Press, La Jolla, California, June 1995.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Andersen, P.H., Holst, C.K. (1996). Termination analysis for offline partial evaluation of a higher order functional language. In: Cousot, R., Schmidt, D.A. (eds) Static Analysis. SAS 1996. Lecture Notes in Computer Science, vol 1145. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61739-6_34
Download citation
DOI: https://doi.org/10.1007/3-540-61739-6_34
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61739-6
Online ISBN: 978-3-540-70674-8
eBook Packages: Springer Book Archive