Hostname: page-component-cd9895bd7-dk4vv Total loading time: 0 Render date: 2024-12-26T08:37:29.794Z Has data issue: false hasContentIssue false

Containers, monads and induction recursion

Published online by Cambridge University Press:  20 November 2014

NEIL GHANI
Affiliation:
Department of Computer and Information Sciences, University of Strathclyde, Glasgow G1 1XH, Scotland Email: ng@cis.strath.ac.uk, hancock@spamcop.net
PETER HANCOCK
Affiliation:
Department of Computer and Information Sciences, University of Strathclyde, Glasgow G1 1XH, Scotland Email: ng@cis.strath.ac.uk, hancock@spamcop.net

Abstract

Induction recursion offers the possibility of a clean, simple and yet powerful meta-language for the type system of a dependently typed programming language. At its crux, induction recursion allows us to define a universe, that is a set U of codes and a decoding function T : U → D which assigns to every code u : U, a value T, u of some type D, e.g. the large type Set of small types or sets. The name induction recursion refers to the build-up of codes in U using inductive clauses, simultaneously with the definition of the function T, by structural recursion on codes.

Our contribution is to (i) bring out explicitly algebraic structure which is less visible in the original type-theoretic presentation – in particular showing how containers and monads play a pivotal role within induction recursion; and (ii) use these structures to present a clean and high level definition of induction recursion suitable for use in functional programming.

Type
Paper
Copyright
Copyright © Cambridge University Press 2014 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Abbott, M., Altenkirch, T. and Ghani, N. (2005) Containers – constructing strictly positive types. Theoretical Computer Science 342 327. (Applied Semantics: Selected Topics.)Google Scholar
Altenkirch, T., Levy, P. and Staton, S. (2010) Higher order containers. Computability in Europe.Google Scholar
Bove, A., Dybjer, P. and Norell, U. (2009) A brief overview of agda – a functional language with dependent types. In: Theorem Proving in Higher Order Logics, 22nd International Conference, TPHOLs 2009. Springer Lecture Notes in Computer Science 5674 73782009.Google Scholar
Dybjer, P. (1994) Inductive families. Formal Aspects of Computing 6 440465.Google Scholar
Dybjer, P. (2000) A general formulation of simultaneous inductive-recursive definitions in type theory. The Journal of Symbolic Logic 65 (2) 525549.CrossRefGoogle Scholar
Dybjer, P. and Setzer, A. (1999) A finite axiomatization of inductive-recursive definitions. In: Girard, J.-Y. (eds.) Typed Lambda Calculi and Applications. Springer Lecture Notes in Computer Science 1581 129146.Google Scholar
Dybjer, P. and Setzer, A. (2001) Indexed induction-recursion. In: Kahle, R., Schroeder-Heister, P. and Stärk, R. (eds.) Proof Theory in Computer Science. Springer-Verlag Lecture Notes in Computer Science 2183 93113.Google Scholar
Dybjer, P. and Setzer, A. (2003) Induction-recursion and initial algebras. Annals of Pure and Applied Logic 124 (1–3) 147.Google Scholar
Dybjer, P. and Setzer, A. (2006) Indexed induction-recursion. Journal of Logic and Algebraic Programming 66 149.Google Scholar
Gambino, N. and Hyland, M. (2004) Well-founded trees and dependent polynomial functors. In: Types for Proofs and Programs. Springer-Verlag Lecture Notes in Computer Science 3085 210225.Google Scholar
Hasegawa, R. (2002) Two applications of analytic functors. Theoretical Computer Science 272 (1–2) 113175. ISSN CrossRefGoogle Scholar
Kahle, R. and Setzer, A. (2010) An extended predicative definition of the Mahlo universe. In: Ways of ProofTheory. Festschrift on the occasion of Wolfram Pohler's retirement, Ontos Verlag.CrossRefGoogle Scholar
Mac Lane, S. (1998) Categories for the Working Mathematician, 2nd edition, Graduate Texts in Mathematics, Springer. ISBN 0387984038.Google Scholar
Martin-Löf, P. (1973) An intuitionistic theory of types: Predicative part. In: Logic Colloquium '73, North-Holland, Amsterdam 73118.Google Scholar
Morris, P. and Altenkirch, T. (2009) Indexed containers. In: 24th IEEE Symposium in Logic in Computer Science (LICS 2009).Google Scholar
Smith, J. M. (1989) Propositional functions and families of types. Notre Dame Journal of Formal Logic 30 (3) 442458.Google Scholar