Modelling general recursion in type theory

被引:38
作者
Bove, A [1 ]
Capretta, V
机构
[1] Chalmers Univ Technol, Dept Comp Sci, S-41296 Gothenburg, Sweden
[2] Univ Ottawa, Dept Math & Stat, Ottawa, ON K1N 6N5, Canada
关键词
D O I
10.1017/S0960129505004822
中图分类号
TP301 [理论、方法];
学科分类号
081202 [计算机软件与理论];
摘要
Constructive type theory is an expressive programming language in which both algorithms and proofs can be represented. A limitation of constructive type theory as a programming language is that only terminating programs can be defined in it. Hence, general recursive algorithms have no direct formalisation in type theory since they contain recursive calls that satisfy no syntactic condition guaranteeing termination. In this work, we present a method to formalise general recursive algorithms in type theory. Given a general recursive algorithm, our method is to define an inductive special-purpose accessibility predicate that characterises the inputs on which the algorithm terminates. The type-theoretic version of the algorithm is then defined by structural recursion on the proof that the input values satisfy this predicate. The method separates the computational and logical parts of the definitions and thus the resulting type-theoretic algorithms are clear, compact and easy to understand. They are as simple as their equivalents in a functional programming language, where there is no restriction on recursive calls. Here, we give a formal definition of the method and discuss its power and its limitations.
引用
收藏
页码:671 / 708
页数:38
相关论文
共 44 条
[1]
ACZEL P, 1977, HDB MATH LOGIC, P739
[2]
[Anonymous], 2003, Haskell 98 Language and LibrariesThe Revised Report
[3]
Balaa A, 2000, LECT NOTES COMPUT SC, V1869, P1
[4]
BALAA A, 2002, J FRANCOPHONES LANGA
[5]
BARENDREGT H, 2001, HDB AUTOMATED REASON, P1149
[6]
Barendregt Henk, 1993, Handbook of logic in computer science, V2, P117
[7]
Introduction to the special issue on dependent type theory meets practical programming [J].
Barthe, G ;
Dybjen, P ;
Thiemann, P .
JOURNAL OF FUNCTIONAL PROGRAMMING, 2004, 14 :1-2
[8]
BELL J. L., 1977, COURSE MATH LOGIC
[9]
BERTOT Y, 2002, SPRINGER VERLAG LECT, V2410, P83
[10]
Bove A, 2002, LECT NOTES COMPUT SC, V2646, P39