Recursion on Nested Datatypes in Dependent Type Theory
Nested datatypes are families of datatypes that are indexed over all types and where the datatype constructors relate different members of the family. This may be used to represent variable binding or to maintain certain invariants through typing.
In dependent type theory, a major concern is the termination of all expressible programs, so that types that depend on object terms can still be type-checked mechanically. Therefore, we study iteration and recursion schemes that have this termination guarantee throughout. This is not based on syntactic criteria (recursive calls with “smaller” arguments) but just on types (“type-based termination”). An important concern are reasoning principles that are compatible with the ambient type theory, in our case induction principles.
In previous work, the author has proposed an abstract description of nested datatypes together with a mapping operation (like map for lists) and an iterator on the term side and an induction principle on the logical side that could all be implemented within the Coq system (with impredicative Set that is just needed for the justification, not for the definition and the examples). For verification purposes, it is important to have naturality theorems for the obtained iterative functions. Although intensional type theory does not provide naturality in general, criteria for naturality could be established that are met in case studies on “bushes” and representations of lambda terms (also with explicit flattening).
The new contribution is an extension of this abstract description to full primitive recursion and its illustration by way of examples that have been carried out in Coq. Unlike the iterative system, we do not yet have a justification within Coq.
Unable to display preview. Download preview PDF.
- 2.Bird, R., Gibbons, J., Jones, G.: Program optimisation, naturally. In: Davies, J., Roscoe, B., Woodcock, J. (eds.) Millenial Perspectives in Computer Science, Proceedings (2000)Google Scholar
- 8.Matthes, R.: An induction principle for nested datatypes in intensional type theory. Journal of Functional Programming (to appear, 2008)Google Scholar
- 9.Coquand, T., Paulin, C.: Inductively defined types. In: Martin-Löf, P., Mints, G. (eds.) COLOG 1988. LNCS, vol. 417, pp. 50–66. Springer, Heidelberg (1990)Google Scholar
- 11.Paulin-Mohring, C.: Définitions Inductives en Théorie des Types d’Ordre Supérieur. Habilitation thesis, Université Claude Bernard Lyon I (1996)Google Scholar
- 12.Coq Development Team: The Coq Proof Assistant Reference Manual Version 8.1. Project LogiCal, INRIA (2006), coq.inria.fr
- 13.Mendler, N.P.: Recursive types and type constraints in second-order lambda calculus. In: Proceedings of the Second Annual IEEE Symposium on Logic in Computer Science, Ithaca, N.Y, pp. 30–36. IEEE Computer Society Press, Los Alamitos (1987)Google Scholar
- 14.Abel, A., Matthes, R.: Fixed points of type constructors and primitive recursion. In: Marcinkowski, J., Tarlecki, A. (eds.) CSL 2004. LNCS, vol. 3210, pp. 190–204. Springer, Heidelberg (2004)Google Scholar
- 15.Matthes, R.: Coq development for Recursion on nested datatypes in dependent type theory (January 2008), http://www.irit.fr/~Ralph.Matthes/Coq/MendlerRecursion/
- 16.Matthes, R.: Coq development for An induction principle for nested datatypes in intensional type theory (January 2008), http://www.irit.fr/~Ralph.Matthes/Coq/InductionNested/
- 20.Uustalu, T., Vene, V.: A cube of proof systems for the intuitionistic predicate μ-, ν-logic. In: Haveraaen, M., Owe, O. (eds.) Selected Papers of the 8th Nordic Workshop on Programming Theory (NWPT 1996), May 1997. Research Reports, Department of Informatics, University of Oslo, vol. 248, pp. 237–246 (1997)Google Scholar
- 21.Matthes, R.: Naive reduktionsfreie Normalisierung (translated to English: naive reduction-free normalization). Slides of talk on December 19, 1996, given at the Bern Munich meeting on proof theory and computer science in Munich, available at the author’s homepage (December 1996)Google Scholar
- 22.Geuvers, H.: Inductive and coinductive types with iteration and recursion. In: Nordström, B., Pettersson, K., Plotkin, G. (eds.) Proceedings of the Workshop on Types for Proofs and Programs, Båstad, Sweden, pp. 193–217 (1992), http://www.cs.chalmers.se/Cs/Research/Logic/Types/proc92.ps
- 24.Abel, A.: A Polymorphic Lambda-Calculus with Sized Higher-Order Types. Doktorarbeit (PhD thesis), LMU München (2006)Google Scholar
- 25.Matthes, R.: Nested datatypes with generalized Mendler iteration: map fusion and the example of the representation of untyped lambda calculus with explicit flattening. In: Paulin-Mohring, C. (ed.) Mathematics of Program Construction, Proceedings. LNCS, Springer, Heidelberg (2008)Google Scholar