Skip to main content

A Loop-detecting Interpreter for Lazy, Higher-order Programs

  • Conference paper
Functional Programming, Glasgow 1992

Part of the book series: Workshops in Computing ((WORKSHOPS COMP.))

  • 89 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. 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.

    Article  Google Scholar 

  3. 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).

    Google Scholar 

  4. 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.

    Google Scholar 

  5. 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).

    Google Scholar 

  6. Carsten Kehler Holst, Finiteness analysis, in ACM Conference on Functional Programming Languages and Computer Architectures, Cambridge MA, 1991.

    Google Scholar 

  7. 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.

    Google Scholar 

  8. Sebastian Hunt, personal communications, 1992.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics