Nested General Recursion and Partiality in Type Theory
We extend Bove’s technique for formalising simple general recursive algrithms in constructive type theory to nested recursive algorithms. The method consists in defining an inductive special-purpose accessibility predicate, that characterizes the inputs on which the algorithm terminates. As a result, the type-theoretic version of the algorithm can be defined by structural recursion on the proof that the input values satisfy this predicate. This technique results in definitions in which the computational and logical parts are clearly separated; hence, the type-theoretic version of the algorithm is given by its purely functional content, similarly to the corresponding program in a functional programming language. In the case of nested recursion, the special predicate and the type-theoretic algorithm must be defined simultaneously, because they depend on each other. This kind of definitions is not allowed in ordinary type theory, but it is provided in type theories extended with Dybjer’s schema for simultaneous inductive-recursive definitions. The technique applies also to the formalisation of partial functions as proper type-theoretic functions, rather than relations representing their graphs.
KeywordsNatural Number Type Theory Partial Function Recursive Algorithm Recursive Call
Unable to display preview. Download preview PDF.
- [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
- [Aud91]P. Audebaud. Partial Objects in the Calculus of Constructions. In 6th Annual IEEE Symposium on Logic in Computer Science, Amsterdam, pages 86–95, July 1991.Google Scholar
- [BB00]Antonia Balaa and Yves Bertot. Fix-point equations for well-founded recursion in type theory. In 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. Harrison and Aagaard [HA00]}, pages 1–16.CrossRefGoogle Scholar
- [CM85]R. L. Constable and N. P. Mendler. Recursive Definitions in Type Theory. In Logic of Programs, Brooklyn, volume 193 of Lecture Notes in Computer Science, pages 61–78. Springer-Verlag, June 1985.Google Scholar
- [Con83]R. L. Constable. Partial Functions in Constructive Type Theory. In Theoretical Computer Science, 6th GI-Conference, Dortmund, volume 145 of Lecture Notes in Computer Science, pages 1–18. Springer-Verlag, January 1983.Google Scholar
- [CS87]R. L. Constable and S. F. Smith. Partial Objects in Constructive Type Theory. In Logic in Computer Science, Ithaca, New York, pages 183–193, June 1987.Google Scholar
- [Dyb00]Peter Dybjer. A general formulation of simultaneous inductive-recursive definitions in type theory. Journal of Symbolic Logic, 65(2), June 2000.Google Scholar
- [JHe+99]_Simon Peyton Jones, John Hughes, (editors), Lennart Augustsson, Dave Barton, Brian Boutel, Warren Burton, Joseph Fasel, Kevin Hammond, Ralf Hinze, Paul Hudak, Thomas Johnsson, Mark Jones, John Launchbury, Erik Meijer, John Peterson, Alastair Reid, Colin Runciman, and Philip Wadler. Report on the Programming Language Haskell 98, a Non-strict, Purely Functional Language. Available from http://haskell.org, February 1999.
- [ML84]P. Martin-Löf. Intuitionistic Type Theory. Bibliopolis, Napoli, 1984.Google Scholar
- [MN94]L. Magnusson and B. Nordström. The ALF proof editor and its proof engine. In Types for Proofs and Programs, volume 806 of LNCS, pages 213–237, Nijmegen, 1994. Springer-Verlag.Google Scholar
- [Nor88]B. Nordström. Terminating General Recursion. BIT, 28(3):605–619, October 1988.Google Scholar