Skip to main content

General Recursion in Type Theory

  • Conference paper
  • First Online:
Types for Proofs and Programs (TYPES 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2646))

Included in the following conference series:

Abstract

In this work, a method to formalise general recursive algorithms in constructive type theory is presented throughout examples. The method separates the computational and logical parts of the definitions. As a consequence, the resulting type-theoretic algorithms are clear, compact and easy to understand. They are as simple as their equivalents in a functional programming language, where there is no restriction on recursive calls. Given a general recursive algorithm, the method consists in defining an inductive special-purpose accessibility predicate that characterises the inputs on which the algorithm terminates. The type-theoretic version of the algorithm can then be defined by structural recursion on the proof that the input values satisfy this predicate. When formalising nested algorithms, the special-purpose accessibility predicate and the type-theoretic version of the algorithm must be defined simultaneously because they depend on each other. Since the method separates the computational part from the logical part of a definition, formalising partial functions becomes also possible

This work is based on work the author has done with Venanzio Capretta, INRIA Sophia Antipolis, France.

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. A. Abel. Termination checking with types — Strong normalization for Mendler-style course-of-value recursion. Technical Report 0201, Institut für Informatik, Ludwig-Maximilians — Universität München, 2002.

    Google Scholar 

  2. P. Aczel. An Introduction to Inductive Definitions. In J. Barwise, editor, Handbook of Mathematical Logic, pages 739–782. North-Holland Publishing Company, 1977.

    Google Scholar 

  3. A. Balaa and Y. Bertot. Fix-point equations for well-founded recursion in type theory. In Harrison and Aagaard [HA00], pages 1–16.

    Chapter  Google Scholar 

  4. A. Balaa and Y. Bertot. Fonctions récursives générales par itération en théorie des types. Journées Francophones des Langages Applicatifs — JFLA02, INRIA, January 2002.

    Google Scholar 

  5. A. Bove and V. Capretta. Nested general recursion and partiality in type theory. In R. J. Boulton and P. B. Jackson, editors, Theorem Proving in Higher Order Logics: 14th International Conference, TPHOLs 2001, volume 2152 of Lecture Notes in Computer Science, Springer-Verlag, pages 121–135, September 2001.

    Chapter  Google Scholar 

  6. A. Bove and V. Capretta. Modelling general recursion in type theory, September 2002. Available on the WWW http://cs.chalmers.se/~bove/Papers/general_presentation.ps.gz.

  7. Y. Bertot, V. Capretta, and K. Das Barman. Type-theoretic functional semantics. In Theorem Proving in Higher Order Logics: 15th International Conference, TPHOLs 2002, 2002.

    Google Scholar 

  8. G. Barthe, M.J. Frade, E. Giménez, L. Pinto, and T. Uustalu. Type-based termination of recursive definitions. Under consideration for publication in Math. Struct. in Comp. Science, December 2000.

    Google Scholar 

  9. A. Bove. Programming in Martin-Löf type theory: Unification — A nontrivial example, November 1999. Licentiate Thesis of the Department of Computer Science, Chalmers University of Technology. Available on the WWW http://cs.chalmers.se/~bove/Papers/lic_thesis.ps.gz.

  10. A. Bove. Simple general recursion in type theory. Nordic Journal of Computing, 8(1):22–42, Spring 2001.

    MATH  MathSciNet  Google Scholar 

  11. A. Bove. General Recursion in Type Theory. PhD thesis, Department of Computing Science, Chalmers University of Technology, November 2002. Available on the WWW http://cs.chalmers.se/~bove/Papers/phd_thesis.ps.gz.

  12. A. Bove. Mutual general recursion in type theory, May 2002. Available on the WWW http://cs.chalmers.se/~bove/Papers/mutual_rec.ps.gz.

  13. T. Coquand and G. Huet. The Calculus of Constructions. Information and Computation, 76: 95–120, 1988.

    Article  MathSciNet  MATH  Google Scholar 

  14. T. Coquand, B. Nordström, J. M. Smith, and B. von Sydow. Type theory and programming. EATCS, 52, February 1994.

    Google Scholar 

  15. C. Dubois and V. Viguié Donzeau-Gouge. A step towards the mechanization of partial functions: Domains as inductive predicates. In M. Kerber, editor, CADE-15, The 15th International Conference on Automated Deduction, pages 53–62, July 1998. WORKSHOP Mechanization of Partial Functions.

    Google Scholar 

  16. P. Dybjer. A general formulation of simultaneous inductive-recursive definitions in type theory. Journal of Symbolic Logic, 65(2), June 2000.

    Google Scholar 

  17. S. Finn, M.P. Fourman, and J. Longley. Partial functions in a total setting. Journal of Automated Reasoning, 18(1):85–104, 1997.

    Article  MATH  MathSciNet  Google Scholar 

  18. J. Giesl. Termination of nested and mutually recursive algorithms. Journal of Automated Reasoning, 19:1–29, 1997.

    Article  MATH  MathSciNet  Google Scholar 

  19. J. Harrison and M. Aagaard, editors. Theorem Proving in Higher Order Logics: 13th International Conference, TPHOLs 2000, volume 1869 of Lecture Notes in Computer Science. Springer-Verlag, 2000.

    MATH  Google Scholar 

  20. W. A. Howard. The formulae-as-types notion of construction. In J. P. Seldin and J. R. Hindley, editors, To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, pages 479–490. Academic Press, London, 1980.

    Google Scholar 

  21. S. Peyton Jones, J. Hughes, (editors), L. Augustsson, D. Barton, B. Boutel, W. Burton, J. Fasel, K. Hammond, R. Hinze, P. Hudak, T. Johnsson, M. Jones, J. Launchbury, E. Meijer, J. Peterson, A. Reid, C. Runciman, and P. Wadler. Report on the Programming Language Haskell 98, a Nonstrict, Purely Functional Language. Available from http://haskell.org, February 1999.

  22. P. Martin-Löf. Intuitionistic Type Theory. Bibliopolis, Napoli, 1984.

    MATH  Google Scholar 

  23. Z. Manna and J. McCarthy. Properties of programs and partial function logic. Machine Intelligence, 5:27–37, 1970.

    MathSciNet  Google Scholar 

  24. C. McBride and J. McKinna. The view from the left, 2002. Under consideration for publication in Journal of Functional Programming.

    Google Scholar 

  25. B. Nordström. Terminating General Recursion. BIT, 28(3):605–619, October 1988.

    Article  MATH  MathSciNet  Google Scholar 

  26. B. Nordström, K. Petersson, and J. M. Smith. Programming in Martin-Löf’s Type Theory. An Introduction. Oxford University Press, 1990.

    Google Scholar 

  27. L. C. Paulson. Proving Termination of Normalization Functions for Conditional Expressions. Journal of Automated Reasoning, 2:63–74, 1986.

    Article  MATH  MathSciNet  Google Scholar 

  28. K. Slind. Function definition in higher-order logic. In Theorem Proving in Higher Order Logics, volume 1125 of Lecture Notes in Computer Science, Turku, Finland, August 1996.

    Google Scholar 

  29. K. Slind. Another look at nested recursion. In Harrison and Aagaard [HA00], pages 498–518.

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bove, A. (2003). General Recursion in Type Theory. In: Geuvers, H., Wiedijk, F. (eds) Types for Proofs and Programs. TYPES 2002. Lecture Notes in Computer Science, vol 2646. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-39185-1_3

Download citation

  • DOI: https://doi.org/10.1007/3-540-39185-1_3

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-14031-3

  • Online ISBN: 978-3-540-39185-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics