An induction principle for nested datatypes in intensional type theory

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.

[1]  Thierry Coquand,et al.  Inductively defined types , 1988, Conference on Computer Logic.

[2]  Yves Bertot,et al.  Interactive Theorem Proving and Program Development: Coq'Art The Calculus of Inductive Constructions , 2010 .

[3]  M. Hofmann Extensional concepts in intensional type theory , 1995 .

[4]  Conor McBride,et al.  Dependently typed functional programs and their proofs , 2000 .

[5]  Peter Dybjer,et al.  Induction-recursion and initial algebras , 2003, Ann. Pure Appl. Log..

[6]  Varmo Veney A Cube of Proof Systems for the Intuitionistic Predicate ,-logic , 1997 .

[7]  Thorsten Altenkirch,et al.  Monadic Presentations of Lambda Terms Using Generalized Inductive Types , 1999, CSL.

[8]  Richard S. Bird,et al.  Nested Datatypes , 1998, MPC.

[9]  Erik Poll,et al.  Algebra of Programming by Richard Bird and Oege de Moor, Prentice Hall, 1996 (dated 1997). , 1999 .

[10]  Nicolas Oury Extensionality in the Calculus of Constructions , 2005, TPHOLs.

[11]  Benjamin Werner On the Strength of Proof-irrelevant Type Theories , 2008, Log. Methods Comput. Sci..

[12]  Ralph Matthes,et al.  Iteration and coiteration schemes for higher-order and nested datatypes , 2005, Theor. Comput. Sci..

[13]  Thorsten Altenkirch Extensional equality in intensional type theory , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[14]  Venanzio Capretta,et al.  A polymorphic representation of induction-recursion , 2004 .

[15]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

[16]  James Hook,et al.  Substitution: A Formal Methods Case Study Using Monads and Transformations , 1994, Sci. Comput. Program..

[17]  Clare E. Martin,et al.  Disciplined, efficient, generalised folds for nested datatypes , 2004, Formal Aspects of Computing.

[18]  Tarmo Uustalu,et al.  Least and greatest fixed points in intuitionistic natural deduction , 2002, Theor. Comput. Sci..

[19]  Richard S. Bird,et al.  Generalised folds for nested datatypes , 1999, Formal Aspects of Computing.

[20]  Pierre Castéran,et al.  Interactive Theorem Proving and Program Development , 2004, Texts in Theoretical Computer Science An EATCS Series.

[21]  Ralph Matthes Verification of Programs on Truly Nested Datatypes in Intensional Type Theory , 2006, MSFP@MPC.

[22]  Peter Dybjer,et al.  A general formulation of simultaneous inductive-recursive definitions in type theory , 2000, Journal of Symbolic Logic.

[23]  N. P. Mendler,et al.  Recursive Types and Type Constraints in Second-Order Lambda Calculus , 1987, LICS.

[24]  Richard S. Bird,et al.  de Bruijn notation as a nested datatype , 1999, Journal of Functional Programming.

[25]  Robin Adams Formalized Metatheory with Terms Represented by an Indexed Family of Types , 2004, TYPES.

[26]  Ralph Matthes,et al.  Extensions of system F by iteration and primitive recursion on monotone inductive types , 1998 .

[27]  Tarmo Uustalu Natural deduction for intuitionistic least and greatest fixedpoint logics : with an application to program construction , 1998 .

[28]  Ralf Hinze,et al.  Efficient Generalized Folds , 1999 .

[29]  Ralph Matthes Monotone Inductive and Coinductive Constructors of Rank 2 , 2001, CSL.

[30]  Andreas Abel,et al.  Type-based termination: a polymorphic lambda-calculus with sized higher-order types , 2006 .