Termination Analysis of Higher-Order Functional Programs

  • Damien Sereni
  • Neil D. Jones
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3780)


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.


Operational Semantic Functional Program Graph Basis Call Graph Depth Parameter 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Avery, J.: Size-change termination for programs with non-well-founded data. Graduate project, University of CopenhagenGoogle Scholar
  2. 2.
    Bird, R.: Using circular programs to eliminate multiple traversals of data. Acta Informatica 21, 239–250 (1984)zbMATHCrossRefGoogle Scholar
  3. 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)CrossRefGoogle Scholar
  4. 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)CrossRefGoogle Scholar
  5. 5.
    Girard, J.-Y., Taylor, P., Lafont, Y.: Proofs and Types. Cambridge tracts in Theoretical Computer Science. Cambridge University Press, Cambridge (1989)zbMATHGoogle Scholar
  6. 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)zbMATHGoogle Scholar
  7. 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. 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)CrossRefGoogle Scholar
  9. 9.
    Landin, P.J.: The mechanical evaluation of expressions. The Computer Journal 6, 308–320 (1964)zbMATHGoogle Scholar
  10. 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. 11.
    Leroy, X.: The Objective Caml System: Documentation and User’s Manual (2004)Google Scholar
  12. 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. 13.
    Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)CrossRefGoogle Scholar
  14. 14.
    Peyton-Jones, S.: The Implementation of Functional Programming Languages. Prentice-Hall, Englewood Cliffs (1987)zbMATHGoogle Scholar
  15. 15.
    Sereni, D.: Higher-order size-change termination analyser (2004), Available at
  16. 16.
    Sereni, D.: Termination analysis of higher-order functional programs. Technical Report PRG-RR-04-20, Oxford University Computing Laboratory (2004),
  17. 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. 18.
    Shivers, O.: Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University (May 1991)Google Scholar
  19. 19.
    Slind, K.: Reasoning about Terminating Functional Programs. PhD thesis, Institut für Informatik der Technischen Universität München (1999)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Damien Sereni
    • 1
  • Neil D. Jones
    • 2
  1. 1.Oxford University Computing Laboratory 
  2. 2.DIKUUniversity of Copenhagen 

Personalised recommendations