General Recursion in Type Theory
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
Unable to display preview. Download preview PDF.
- [Abe02]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
- [Acz77]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
- [BB02]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
- [BC01]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.CrossRefGoogle Scholar
- [BC02]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.
- [BCB02]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
- [BFG+00]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
- [Bov99]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.
- [Bov02a]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.
- [Bov02b]A. Bove. Mutual general recursion in type theory, May 2002. Available on the WWW http://cs.chalmers.se/~bove/Papers/mutual_rec.ps.gz.
- [CNSvS94]T. Coquand, B. Nordström, J. M. Smith, and B. von Sydow. Type theory and programming. EATCS, 52, February 1994.Google Scholar
- [DDG98]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
- [Dyb00]P. Dybjer. A general formulation of simultaneous inductive-recursive definitions in type theory. Journal of Symbolic Logic, 65(2), June 2000.Google Scholar
- [How80]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
- [JHe+99]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.
- [MM02]C. McBride and J. McKinna. The view from the left, 2002. Under consideration for publication in Journal of Functional Programming.Google Scholar
- [NPS90]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
- [Sli96]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