Abstract
Interpreters that detect some forms of non-termination have a variety of applications, from abstract interpretation to partial evaluation. A simple and often used strategy is to test for a repeated state, but this cannot handle infinite values (such as first-class functions) or unevaluated states such as arise in lazy programs. In this paper we propose using Berry and Curien’s theory of sequential algorithms as a semantic foundation for loop detection: we obtain straightforwardly a loop detector for lazy higher-order functional programs, which is more effective than the simple strategy even for strict first order cases.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Patrick Cousot and Radhia Cousot, Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints, ACM Principles of Programming Languages, 1977.
Neil D. Jones, Peter Sestoft and Harald Søndergârd, Mix: a self-applicable partial evaluator for experiments in compiler generation, Lisp and Symbolic Computation, 2(1):9–50, 1989.
Jonathon Young and Paul Hudak, Finding fixpoints on function spaces, Research Report YALEU/DCS/R.R-505, Dept. of Computer Science, Yale University (December 1986).
Carsten Kehler Holst and John Hughes, A Loop Detecting Interpreter for Lazy Programs, Proc. Glasgow 1991 Workshop on Functional Programming, Springer-Verlag Workshops in Computing, 1992.
G. Berry and P.-L. Curien, Theory and practice of sequential algorithms: the kernel of the applicative language CDS, in Algebraic Methods. in semantics, 35–87, Cambridge University Press (1985).
Carsten Kehler Holst, Finiteness analysis, in ACM Conference on Functional Programming Languages and Computer Architectures, Cambridge MA, 1991.
A.B. Ferguson and John Hughes, Abstract Interpretation of Higher Order Functions using Concrete Data Structures, in Functional Programming, Glasgow 1992, eds. J. Launchbury and P. M. Sansom, Springer Verlag Workshops in Computing, 1992.
Sebastian Hunt, personal communications, 1992.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1993 British Computer Society
About this paper
Cite this paper
Hughes, J., Ferguson, A.B. (1993). A Loop-detecting Interpreter for Lazy, Higher-order Programs. In: Launchbury, J., Sansom, P. (eds) Functional Programming, Glasgow 1992. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3215-8_8
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3215-8_8
Publisher Name: Springer, London
Print ISBN: 978-3-540-19820-8
Online ISBN: 978-1-4471-3215-8
eBook Packages: Springer Book Archive