Skip to main content

Termination Analysis of Higher-Order Functional Programs

  • Conference paper
Programming Languages and Systems (APLAS 2005)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3780))

Included in the following conference series:

Abstract

Size-change termination (SCT) automatically identifies termination of first-order functional programs. The SCT principle: a program terminates if every infinite control flow sequence would cause an infinite descent in a well-founded data value (POPL 2001).

More recent work (RTA 2004) developed a termination analysis of the pure untyped λ-calculus using a similar approach, but an entirely different notion of size was needed to compare higher-order values. Again this is a powerful analysis, even proving termination of certain λ-expressions containing the fixpoint combinator Y. However the language analysed is tiny, not even containing constants.

These techniques are unified and extended significantly, to yield a termination analyser for higher-order, call-by-value programs as in ML’s purely functional core or similar functional languages. Our analyser has been proven correct, and implemented for a substantial subset of OCaml.

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. Avery, J.: Size-change termination for programs with non-well-founded data. Graduate project, University of Copenhagen

    Google Scholar 

  2. Bird, R.: Using circular programs to eliminate multiple traversals of data. Acta Informatica 21, 239–250 (1984)

    Article  MATH  Google Scholar 

  3. Danvy, O.: Lambda-lifting in quadratic time. In: Hu, Z., Rodríguez-Artalejo, M. (eds.) FLOPS 2002. LNCS, vol. 2441, pp. 134–151. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  4. Giesl, J., Thiemann, R., Schneider-Kamp, P.: Proving and disproving termination of higher-order functions. In: Gramlich, B. (ed.) FroCos 2005. LNCS (LNAI), vol. 3717, pp. 216–231. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  5. Girard, J.-Y., Taylor, P., Lafont, Y.: Proofs and Types. Cambridge tracts in Theoretical Computer Science. Cambridge University Press, Cambridge (1989)

    MATH  Google Scholar 

  6. Gordon, M.J.C., Melham, T.F. (eds.): Introduction to HOL: A Theorem Proving Environment for Higher Order Logic. Cambridge University Press, Cambridge (1993)

    MATH  Google Scholar 

  7. Johnsson, T.: Lambda lifting: transforming programs to recursive equations. In: Proceedings of a conference on Functional Programming languages and Computer Architecture. Springer, Heidelberg (1985)

    Google Scholar 

  8. Jones, N.D., Bohr, N.: Termination analysis of the untyped λ-calculus. In: van Oostrom, V. (ed.) RTA 2004. LNCS, vol. 3091, pp. 1–23. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  9. Landin, P.J.: The mechanical evaluation of expressions. The Computer Journal 6, 308–320 (1964)

    MATH  Google Scholar 

  10. Lee, C.S., Jones, N.D., Ben-Amram, A.M.: The size-change principle for program termination. In: Proceedings of the 28th Annual ACM SIGPLAN - SIGACT Symposium on Principles of Programming Languagaes, pp. 81–92. ACM Press, New York (2001)

    Google Scholar 

  11. Leroy, X.: The Objective Caml System: Documentation and User’s Manual (2004)

    Google Scholar 

  12. Lindenstrauss, N., Sagiv, Y.: Automatic termination analysis of prolog programs. In: Proceedings of the Fourteenth International Conference on Logic Programming, pp. 64–67 (1997)

    Google Scholar 

  13. Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)

    Book  Google Scholar 

  14. Peyton-Jones, S.: The Implementation of Functional Programming Languages. Prentice-Hall, Englewood Cliffs (1987)

    MATH  Google Scholar 

  15. Sereni, D.: Higher-order size-change termination analyser (2004), Available at http://web.comlab.ox.ac.uk/oucl/work/damien.sereni/hoterm.tar.gz

  16. Sereni, D.: Termination analysis of higher-order functional programs. Technical Report PRG-RR-04-20, Oxford University Computing Laboratory (2004), http://web.comlab.ox.ac.uk/oucl/publications/tr/rr-04-20.html

  17. Shivers, O.: Control-flow analysis in scheme. In: Proceedings of the SIGPLAN 1988 Conference on Programming Language Design and Implementation, June 1988, pp. 164–174 (1988)

    Google Scholar 

  18. Shivers, O.: Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University (May 1991)

    Google Scholar 

  19. Slind, K.: Reasoning about Terminating Functional Programs. PhD thesis, Institut für Informatik der Technischen Universität München (1999)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Sereni, D., Jones, N.D. (2005). Termination Analysis of Higher-Order Functional Programs. In: Yi, K. (eds) Programming Languages and Systems. APLAS 2005. Lecture Notes in Computer Science, vol 3780. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11575467_19

Download citation

  • DOI: https://doi.org/10.1007/11575467_19

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-29735-2

  • Online ISBN: 978-3-540-32247-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics