GENERAL RECURSION VIA COINDUCTIVE TYPES

被引:89
作者
Capretta, Venanzio [1 ]
机构
[1] Univ Ottawa, Dept Math & Stat, 585 King Edward Ave,Room 204, Ottawa, ON K1N 4N5, Canada
关键词
type theory; general recursion; coinductive types; monad;
D O I
10.2168/LMCS-1(2:1)2005
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
A fertile field of research in theoretical computer science investigates the representation of general recursive functions in intensional type theories. Among the most successful approaches are: the use of wellfounded relations, implementation of operational semantics, formalization of domain theory, and inductive definition of domain predicates. Here, a different solution is proposed: exploiting coinductive types to model infinite computations. To every type A we associate a type of partial elements A(,)(nu) coinductively generated by two constructors: the first, [a] just returns an element a: A; the second, (sic)x, adds a computation step to a recursive element x: A(nu). We show how this simple device is sufficient to formalize all recursive functions between two given types. It allows the definition of fixed points of finitary, that is, continuous, operators. We will compare this approach to different ones from the literature. Finally, we mention that the formalization, with appropriate structural maps, defines a strong monad.
引用
收藏
页数:28
相关论文
共 61 条
[1]  
Aczel P, 2002, LECT NOTES COMPUT SC, V2297, P79
[2]  
Aczel P., 1988, CSLI Lecture Notes
[3]  
[Anonymous], 1994, LNCS
[4]  
[Anonymous], LECT CURRY HOWARD IS
[5]  
Balaa A, 2000, LECT NOTES COMPUT SC, V1869, P1
[6]  
Barendregt Henk, 2001, HDB AUTOMATED REASON, P1151
[7]  
Barendregt Henk, 1993, Handbook of logic in computer science, V2, P117
[8]  
Barthe G, 2005, LECT NOTES COMPUT SC, V3461, P71
[9]   Type-based termination of recursive definitions [J].
Barthe, G ;
Frade, MJ ;
Giménez, E ;
Pinto, L ;
Uustalu, T .
MATHEMATICAL STRUCTURES IN COMPUTER SCIENCE, 2004, 14 (01) :97-141
[10]   Setoids in type theory [J].
Barthe, G ;
Capretta, V ;
Pons, O .
JOURNAL OF FUNCTIONAL PROGRAMMING, 2003, 13 :261-293