## Monadic Presentations of Lambda Terms Using Generalized Inductive Types (1999)

Venue: | In Computer Science Logic |

Citations: | 77 - 15 self |

### BibTeX

@INPROCEEDINGS{Altenkirch99monadicpresentations,

author = {Thorsten Altenkirch and Bernhard Reus},

title = {Monadic Presentations of Lambda Terms Using Generalized Inductive Types},

booktitle = {In Computer Science Logic},

year = {1999},

pages = {453--468},

publisher = {Springer-Verlag}

}

### Years of Citing Articles

### OpenURL

### Abstract

. We present a denition of untyped -terms using a heterogeneous datatype, i.e. an inductively dened operator. This operator can be extended to a Kleisli triple, which is a concise way to verify the substitution laws for -calculus. We also observe that repetitions in the denition of the monad as well as in the proofs can be avoided by using well-founded recursion and induction instead of structural induction. We extend the construction to the simply typed -calculus using dependent types, and show that this is an instance of a generalization of Kleisli triples. The proofs for the untyped case have been checked using the LEGO system. Keywords. Type Theory, inductive types, -calculus, category theory. 1 Introduction The metatheory of substitution for -calculi is interesting maybe because it seems intuitively obvious but becomes quite intricate if we take a closer look. [Hue92] states seven formal properties of substitution which are then used to prove a general substitution theor...

### Citations

945 |
Categories for the working mathematician
- Lane
- 1971
(Show Context)
Citation Context ...T Y;Z (f)sbind T X;Y (g) where f 2 C(Y; T (Z)); g 2 C(X;T (Y )). Kleisli triples were introduced in [Man76], where they are also shown to be equivalent to the conventional presentation of monads, see =-=[-=-ML71], pp.133. 2.2 Initial algebras Denition 2. For any endofunctor T : C ! C an initial T -algebra ( T ; c T ; It T ) is given by { an object T 2 jCj { a morphism c T 2 C(T ( T ); T ) { a family of... |

747 | Notions of computation and monads - Moggi - 1991 |

361 |
Proofs and Types
- Girard, Lafont, et al.
- 1990
(Show Context)
Citation Context ...te P 2 T ! Prop we have c T (P ) P Dat Ind 8x 2 T :P (x) where c T (P ) = fc T (x) j x 2 Pg. It is well known that all positive inductive types can be encoded impredicatively (i.e. in System F, [GLT89]): X:T (X) = X 2 Set:(T (X) ! X) ! X 2 Set It T = X 2 Set:f 2 T (X) ! X:x 2 X:T (X): xX f 2 X 2 Set:(T (X) ! X) ! T ! X c T = x 2 T (X:T (X)):X 2 Set:f 2 T (X) ! X:f(T (It T X f) x) 2 T (... |

347 |
Intuitionistic Type Theory
- Martin-Löf
- 1984
(Show Context)
Citation Context ...a 2 A:B(a). The only inhabitant of an equality type is res2 A2Seta 2 A:Eq(a; a). We assume that the equality type is extensional, i.e. a = b holds i Eq A (a; b) is inhabited. For details see e.g. [Mar84]. We dene a strictly positive operator on families as a function G 2 (I ! Set) ! I ! Set which is given by a denition G(F ) = i 2 I:(F; i) where F appears only strictly positive in (F; i). Every ... |

335 | Theorems for free - Wadler |

150 |
LEGO proof development system: User’s manual
- Luo, Pollack
- 1992
(Show Context)
Citation Context ... (var o f); fun subst t u = bind (fn new => u | old x => var x) t; fun weak t = lam old t; 4.5 Implementation in LEGO Using the Inductive-statement such a heterogeneous datatype can be dened in LEGO [=-=LP92]-=- as follows: Inductive [Lambda:Set->Type] ElimOver Type Constructors [var:{X|Set}X->Lambda X] [app : {X|Set} (Lambda X)->(Lambda X)->(Lambda X)] [abst: {X|Set} (Lambda (Lift X)) ->(Lambda X)]; In the ... |

145 |
Abstract syntax and variable binding
- Fiore, Plotkin, et al.
- 1999
(Show Context)
Citation Context ... the usual scheme of inductive denitions: heterogeneous (see 3.1) and dependent inductive denitions (see Section 5.2). Our work seems to be closely related to recent work by Fiore, Plotkin and Turi [F=-=PT99-=-] who pursue a more abstract algebraic treatment of signatures with binders but do not cover the simply typed case. Higher order syntax can also be used to represent -terms, i.e. in [Hof99]. 2 Prelimi... |

125 | A logic for parametric polymorphism - Plotkin, Abadi - 1993 |

81 | Nested datatypes
- Bird, Meertens
- 1998
(Show Context)
Citation Context ...esentation of Lam, see Section 3.2, is improved by using a heterogeneous datatype 1 , i.e. there are no meaningless terms in our representation. Heterogeneous datatypes have already been discussed in =-=[BM9-=-8], where they are called nested datatypes and modelled by initial algebras in functor categories, which seems unsatisfactory. Building on this approach, in [BP99] heterogeneous denitions of untyped -... |

70 | De Bruijn notation as a nested datatype
- Bird, Paterson
- 1999
(Show Context)
Citation Context ...tatypes have already been discussed in [BM98], where they are called nested datatypes and modelled by initial algebras in functor categories, which seems unsatisfactory. Building on this approach, in =-=[B-=-P99] heterogeneous denitions of untyped -terms are investigated. { Repetitions in the denition of the monad and in the verication can be avoided by using well founded recursion (along a primitive recu... |

68 | Inductive families
- Dybjer
- 1994
(Show Context)
Citation Context ...functor in general it cannot be a monad. 5.2 Dependent inductive types Next we model dependent inductive types, which are also called inductive families, by initial algebras in categories of families =-=[Dyb-=-94]. Given an index type I 2 Set, we dene the category of I-indexed families: objects are F 2 I ! Set and morphisms are I-indexed families of functions f 2 i2I F (i) ! G(i). An inductively dened depe... |

45 | Pure type systems formalized
- McKinna, Pollack
- 1993
(Show Context)
Citation Context ...ern type theoretical systems. It is future work to look for a generalization to terms of dependently typed -calculi, thus suggesting a new approach for the project of Type Theory in Type Theory (cf. [=-=MP93]-=-). A problem which needs to be tackled in this context is that the type of the substitution function in a dependently typed context may depend on its own graph. Once havingsnished the examination of t... |

40 | A formalization of the strong normalization proof for System F - Altenkirch - 1993 |

31 | Constructions, Inductive Types and Strong Normalization - Altenkirch - 1993 |

23 |
Algebraic Theories, Volume 26 of Graduate Texts in Mathematics
- Manes
- 1976
(Show Context)
Citation Context ... 1 T (X) 2. bind T X;Y (f)s T X = f where f 2 C(X;T (Y )). 3. bind T X;Z (bind T Y;Z (f)sg) = bind T Y;Z (f)sbind T X;Y (g) where f 2 C(Y; T (Z)); g 2 C(X;T (Y )). Kleisli triples were introduced in [=-=Man7-=-6], where they are also shown to be equivalent to the conventional presentation of monads, see [ML71], pp.133. 2.2 Initial algebras Denition 2. For any endofunctor T : C ! C an initial T -algebra ( T ... |

20 | Extensional equality in intensional type theory
- Altenkirch
- 1999
(Show Context)
Citation Context ... constant ext which makes the propositional equality extensional and thus destroys the computational adequacy of Type Theory. This problem could be overcome by moving to a Type Theory as described in =-=[Alt9-=-9]. The complete LEGO code (for both variants) can be found in [RA99]. 5 Extension to simple types 5.1 Kleisli structures To capture the case of typed algebras, specically the simply typed -calculus, ... |

19 | Logical relations and inductive/coinductive types
- Altenkirch
- 1999
(Show Context)
Citation Context ...used to dene new operators. We say that Set has all strictly positive 2 datatypes if all initial algebras dened by a strictly positive operator exist. This gives rise to a -calculus , e.g. see [Alt98]. Examples for inductive datatypes are natural numbers Nat = X:1 + X , ordinal notations Ord = X:1 + X + (Nat ! X) orsnitely branching trees Tree = X:Y:1 +X Y . Datatypes can be conveniently pre... |

19 | Substitution: A formal methods case study using monads and transformations
- Bellegarde, Hook
- 1994
(Show Context)
Citation Context ...ore general and elegant way to state and verify the substitution laws. Obviously, this is also related to the way lambda terms are presented. Wesnd a partial answer in the work of Bellegarde and Hook =-=[BH94-=-] who take the view that lambda terms should be represented by an operator Lam 2 Set ! Set, where Set denotes the universe of sets, such that Lam(X) is the set of -terms with variables in X . This cor... |

4 |
Extending the type checker of Standard ML by polymorphic recursion
- Emms, Leiß
- 1999
(Show Context)
Citation Context ...wn to be undecidable. The Haskell type system is moresexible because it does not try to infer the type of function if it is given anyway. There is also an implementation of an improved ML typechecker =-=[EL99-=-] which implements polymorphic recursion via a semialgorithm for semiunication. The corresponding ML-code reads as follows: datatype 'a Lift = new | old of 'a; datatype 'a Lam = var of 'a | app of ('a... |

4 | Semantics of Logics of Computation, chapter Syntax and Semantics of Dependent Types - Hofmann - 1997 |

2 |
Semantical analysis in higher order abstract syntax
- Hofmann
- 1999
(Show Context)
Citation Context ...n and Turi [FPT99] who pursue a more abstract algebraic treatment of signatures with binders but do not cover the simply typed case. Higher order syntax can also be used to represent -terms, i.e. in [=-=Hof99]-=-. 2 Preliminaries As a metatheory we use an informal version of extensional Type Theory, details can be found in [Mar84,Hof97]. Since we do not exploit the proposition-as-types principle we work in a ... |

2 |
Constructive Computation Theory, Part I. Notes de cours
- Huet
- 1992
(Show Context)
Citation Context ...-calculus, category theory. 1 Introduction The metatheory of substitution for -calculi is interesting maybe because it seems intuitively obvious but becomes quite intricate if we take a closer look. [=-=Hue92]-=- states seven formal properties of substitution which are then used to prove a general substitution theorem. When formalizing the proof of strong normalisation for System F [Alt93b,Alt93a] thesrst aut... |

1 |
The implementation of the -monad
- Reus, Altenkirch
- 1999
(Show Context)
Citation Context ... thus destroys the computational adequacy of Type Theory. This problem could be overcome by moving to a Type Theory as described in [Alt99]. The complete LEGO code (for both variants) can be found in =-=[RA9-=-9]. 5 Extension to simple types 5.1 Kleisli structures To capture the case of typed algebras, specically the simply typed -calculus, we introduce a generalization of the Kleisli-triples, which we call... |