Summary: Termination Checking Nested Inductive and Coinductive Types
Thorsten Altenkirch and Nils Anders Danielsson
University of Nottingham
In the dependently typed functional programming language Agda one can easily mix induction
and coinduction. The implementation of the termination/productivity checker is based on a simple
extension of a termination checker for a language with inductive types. However, this simplicity
comes at a price: only types of the form X.µY.F X Y can be handled directly, not types of the form
µY.X.F X Y. We explain the implementation of the termination checker and the ensuing problem.
This short and speculative note discusses how one can--apparently--extend a termination checker which
accepts structurally recursive programs so that it also accepts guarded corecursive programs (and proofs)
and even mixed recursive/corecursive definitions. However, we will also point out a problem with the
extended checker: the "obvious" way to represent a coinductive type nested within an inductive type
does not work.
Some familiarity with total, dependently typed languages, induction, coinduction, structural recur-
sion and guarded corecursion is assumed.
Originally the termination checker of the dependently typed functional programming language Agda
(Norell 2007; Agda Team 2010) only supported structural recursion. The checker was based on foetus