Hostname: page-component-7c8c6479df-27gpq Total loading time: 0 Render date: 2024-03-28T23:57:49.442Z Has data issue: false hasContentIssue false

An induction principle for nested datatypes in intensional type theory

Published online by Cambridge University Press:  01 July 2009

RALPH MATTHES*
Affiliation:
IRIT, CNRS and Université Paul Sabatier, 118 route de Narbonne, F-31062 Toulouse Cedex 9, France (e-mail: ralph.matthes@irit.fr)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Nested datatypes are families of datatypes that are indexed over all types such that the constructors may relate different family members (unlike the homogeneous lists). Moreover, the argument types of the constructors refer to indices given by expressions in which the family name may occur. Especially in this case of true nesting, termination of functions that traverse these data structures is far from being obvious. A joint paper with A. Abel and T. Uustalu (Theor. Comput. Sci., 333 (1–2), 2005, pp. 3–66) proposed iteration schemes that guarantee termination not by structural requirements but just by polymorphic typing. They are generic in the sense that no specific syntactic form of the underlying datatype “functor” is required. However, there was no induction principle for the verification of the programs thus obtained, although they are well known in the usual model of initial algebras on endofunctor categories. The new contribution is a representation of nested datatypes in intensional type theory (more specifically, in the calculus of inductive constructions) that is still generic and covers true nesting, guarantees termination of all expressible programs, and has an induction principle that allows to prove functoriality of monotonicity witnesses (maps for nested datatypes) and naturality properties of iteratively defined polymorphic functions.

Type
Articles
Copyright
Copyright © Cambridge University Press 2009

References

Abel, A. (2006) A Polymorphic Lambda-Calculus with Sized Higher-Order Types, Doktorarbeit (PhD thesis). Ludwig-Maximilians-Universität München.Google Scholar
Abel, A., Matthes, R. & Uustalu, T. (2005) Iteration and coiteration schemes for higher-order and nested datatypes, Theor. Comput. Sci., 333 (1–2): 366.CrossRefGoogle Scholar
Adams, R. (2006) Formalized metatheory with terms represented by an indexed family of types. In Revised Selected Papers from 1st International Workshop on Types for Proofs and Programs, TYPES 2004 (Jouy-en-Josas, December 2004), Filliâtre, J.-C., Paulin-Mohring, C. & Werner, B. (eds), Lecture Notes in Computer Science, vol. 3839. Springer, pp. 116.Google Scholar
Altenkirch, T. (1999) Extensional equality in intensional type theory. In Proceedings of the 14th Annual IEEE Symposium on Logic in Computer Science, LICS '99 (Trento, July 1999). IEEE CS Press, pp. 412420.Google Scholar
Altenkirch, T. & Reus, B. (1999) Monadic presentations of lambda terms using generalized inductive types. In Proceedings of the 13th International Workshop on Computer Science Logic, CSL '99 (Madrid, September 1999), Flum, J. & Rodríguez-Artalejo, M. (eds), Lecture Notes in Computer Science, vol. 1683. Springer, pp. 453468.Google Scholar
Bellegarde, F. & Hook, J. (1994) Substitution: A formal methods case study using monads and transformations, Sci. Comput. Program., 23 (2–3): 287311.Google Scholar
Bertot, Y. & Castéran, P. (2004) Interactive Theorem Proving and Program Development. Coq'Art: The Calculus of Inductive Constructions, Texts in Theoretical Computer Science: An EATCS Series. Springer.CrossRefGoogle Scholar
Bird, R. & de Moor, O. (1997) Algebra of Programming, International Series in Computer Science, vol. 100. Prentice Hall.Google Scholar
Bird, R. & Meertens, L. (1998) Nested datatypes. In Proceedings of the 4th International Conference on Mathematics of Program Construction, MPC '98 (Marstrand, June 1998), Jeuring, J. (ed), Lecture Notes in Computer Science, vol. 1422. Springer, pp. 5267.Google Scholar
Bird, R. & Paterson, R. (1999a) De Bruijn notation as a nested datatype, J. Funct. Program., 9 (1): 7791.Google Scholar
Bird, R. & Paterson, R. (1999b) Generalised folds for nested datatypes, Formal Aspects Comput., 11 (2): 200222.Google Scholar
Capretta, V. (2004) A polymorphic representation of induction-recursion. Unpublished note.Google Scholar
Coq Development Team. (2006) The Coq proof assistant reference manual, version 8.1 [online], Project LogiCal, INRIA. Available at: http://coq.inria.fr/. (Accessed 4 May 2009).Google Scholar
Coquand, T. & Paulin, C. (1990) Inductively defined types. In Proceedings of the International Conference on Computer Logic, COLOG-88 (Tallinn, December 1988), Martin-Löf, P. & Mints, G. (eds), Lecture Notes in Computer Science, vol. 417. Springer, pp. 5066.Google Scholar
Dybjer, P. (2000) A general formulation of simultaneous inductive-recursive definitions in type theory, J. Symb. Logic, 65 (2): 525549.Google Scholar
Dybjer, P. & Setzer, A. (2003) Induction–recursion and initial algebras, Ann. Pure Appl. Logic, 124 (1): 147.Google Scholar
Girard, J.-Y. (1972) Interprétation fonctionnelle et élimination des coupures de l'arithmétique d'ordre supérieur, Thèse de Doctorat d'État. Université de Paris VII.Google Scholar
Hinze, R. (2000) Efficient generalized folds. In Proceedings of the 2nd Workshop on Generic Programming, WGP 2000 (Ponte de Lima, July 2000), Jeuring, J. (ed). Department of Computer Science, Universiteit Utrecht, pp. 1732.Google Scholar
Hofmann, M. (1995) Extensional Concepts in Intensional Type Theory, PhD thesis. University of Edinburgh.Google Scholar
Martin, C., Gibbons, J. & Bayley, I. (2004) Disciplined, efficient, generalised folds for nested datatypes, Formal Aspects Comput., 16 (1): 1935.Google Scholar
Matthes, R. (1998) Extensions of System F by Iteration and Primitive Recursion on Monotone Inductive Types, Doktorarbeit (PhD thesis). Ludwig-Maximilians-Universität München. Available at: http://www.irit.fr/~Ralph.Matthes/. (Accessed 4 May 2009).Google Scholar
Matthes, R. (2001) Monotone inductive and coinductive constructors of rank 2. In Proceedings of the 15th International Workshop on Computer Science Logic, CSL 2001 (Paris, September 2001), Fribourg, L. (ed), Lecture Notes in Computer Science, vol. 2142. Springer, pp. 600614.Google Scholar
Matthes, R. (2006) Verification of programs on truly nested datatypes in intensional type theory. In Proceedings of the Workshop on Mathematically Structured Functional Programming (Kuressaare, July 2006), McBride, C. & Uustalu, T. (eds), Electronic Workshops in Computing. BCS, article 10.Google Scholar
Matthes, R. (2008) Coq Development for “An Induction Principle for Nested Datatypes in Intensional Type Theory.” Available at: http://www.irit.fr/~Ralph.Matthes/Coq/InductionNested/.Google Scholar
McBride, C. (1999) Dependently Typed Functional Programs and Their Proofs, PhD thesis. University of Edinburgh.Google Scholar
Mendler, N. P. (1987) Recursive types and type constraints in second-order lambda calculus. In Proceedings of the 2nd Annual IEEE Symposium on Logic in Computer Science, LICS '87 (Ithaca, NY, June 1987). IEEE CS Press, pp. 3036.Google Scholar
Oury, N. (2005) Extensionality in the calculus of constructions. In Proceedings of the 18th International Conference on Theorem Proving in Higher-Order Logics, TPHOLs 2005 (Oxford, August 2005), Hurd, J. & Melham, T. F. (eds), Lecture Notes in Computer Science, vol. 3603. Springer, pp. 278293.Google Scholar
Uustalu, T. (1998) Natural Deduction for Intuitionistic Least and Greatest Fixedpoint Logics, with an Application to Program Construction, PhD thesis. Royal Institute of Technology, Stockholm.Google Scholar
Uustalu, T. & Vene, V. (1997) A cube of proof systems for the intuitionistic predicate μ-, ν-logic. In Selected Papers from 8th Nordic Workshop on Programming Theory, NWPT '96 (Oslo, December 1996), Haveraaen, M. & Owe, O. (eds). Research report 248. Department of Informatics, University of Oslo, pp. 237246.Google Scholar
Uustalu, T. & Vene, V. (2002) Least and greatest fixed points in intuitionistic natural deduction, Theor. Comput. Sci., 272 (1–2): 315339.CrossRefGoogle Scholar
Werner, B. (2006) On the strength of proof-irrelevant type theories. In Proceedings of the 3rd International Joint Conference on Automated Reasoning, IJCAR 2006 (Seattle, WA, August 2006), Furbach, U. & Shankar, N. (eds), Lecture Notes in Artificial Intelligence, vol. 4130. Springer, pp. 604618.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.