## A Type of Partial Recursive Functions

### BibTeX

@MISC{Bove_atype,

author = {Ana Bove and Venanzio Capretta},

title = {A Type of Partial Recursive Functions},

year = {}

}

### OpenURL

### Abstract

Abstract. Our goal is to define a type of partial recursive functions in constructive type theory. In a series of previous articles, we studied two different formulations of partial functions and general recursion. In both cases, we could obtain a type only by extending the theory with either an impredicative universe or with coinductive definitions. Here we present a new type constructor that eludes such entities of dubious constructive credentials. We start by showing how to break down a recursive function definition into three components: the first component generates the arguments of the recursive calls, the second one evaluates them, and the last one computes the output from the results of the recursive calls. We use this dissection as the basis for the introduction rule of the new type constructor: a partial recursive function is created by giving the first and third of the above components. As in one of our previous methods, every partial recursive function is associated with an inductive domain predicate and the evaluation of the function requires a proof that the predicate holds on the input values. We give a constructive justification for the new construct by means of an interpretation from the extended type theory into the base one. This shows that the extended theory is consistent and constructive. 1

### Citations

489 |
The Calculus of Constructions
- Coquand, Huet
- 1988
(Show Context)
Citation Context ...edicate and an induction principle to reason about partial functions are introduced. Audebaud [1] uses Constable and Smith idea [14] to define a conservative extension of the Calculus of Construction =-=[15]-=- with fix point terms and a type of partial objects. Strong normalisation still holds for terms with no fix points. From the computational point of view, an equivalent of the Kleene theorem for partia... |

419 |
Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme, I.Monatshefte für Mathematik und Physik 38
- Gödel
- 1931
(Show Context)
Citation Context ...ate Gödel’s coding systems for trees into Cantor’s one.sKurt Gödel devised a system to encode expressions of a formal language into natural numbers by exploiting the uniqueness of prime factorisation =-=[16]-=-. His idea was that a complex expression can be encoded by giving the codes of its immediate n subexpressions as exponents to the first n prime numbers. As an instance of this process let us consider ... |

307 | Functional programming with bananas, lenses, envelopes, and barbed wire
- Meijer, Fokkinga, et al.
- 1991
(Show Context)
Citation Context ... the recursive calls to produce the output. This decomposition was described in [10] and is analogous to the separation of an hylomorphism into the composition of an anamorphism and a catamorphism in =-=[19]-=-.sWe formalised our approach in the proof assistant Coq [23]. The file containing the formalisation can be obtained from the following web page: www.cs.ru.nl/~venanzio/Coq/rec fun type/. The paper is ... |

148 |
Intuitionistic Type Theory. Bibliopolis
- Martin-Löf
- 1984
(Show Context)
Citation Context ...theory. The base theory must be expressive enough to provide the needed operators, specifically it must have Σ-types and inductive dependent families. Our reference system is Martin-Löf’s type theory =-=[18, 20]-=-, but most version of dependent type theory will work as well. Let TT be a consistent and normalising type system and let PTT be its extension with the type of partial functions presented in Sections ... |

99 | Programming in Martin-Löf’s type theory
- NORDSTROM, PETERSSON, et al.
- 1990
(Show Context)
Citation Context ...theory. The base theory must be expressive enough to provide the needed operators, specifically it must have Σ-types and inductive dependent families. Our reference system is Martin-Löf’s type theory =-=[18, 20]-=-, but most version of dependent type theory will work as well. Let TT be a consistent and normalising type system and let PTT be its extension with the type of partial functions presented in Sections ... |

68 |
Inductive Definition in Type Theory
- Mendler
- 1987
(Show Context)
Citation Context ...ial functions. Other approaches to the definition of a type of partial recursive functions can be found in the literature. Below we summarise those we believe are more relevant. Constable and Mendler =-=[13]-=- introduce a type of partial functions as a new type constructor in the Nuprl system [12]. Given a partial function, one can compute its domain predicate, which contains basically the same information... |

41 | General Recursion in Type Theory
- Bove
- 2003
(Show Context)
Citation Context ...the formalisation of partial functions and general recursion in constructive type theory. In a series of previous articles, we expound two different ways of achieving that goal. In our first approach =-=[3, 4, 2, 5]-=-, we define an inductive (domain) predicate that characterises the inputs on which a function terminates. The constructors of this predicate can be easily and automatically determined from the recursi... |

36 |
Partial objects in constructive type theory
- Constable, Smith
- 1987
(Show Context)
Citation Context ...of A into an element of B provided there is some proof p that a belongs to the domain of the function. In our case, the formalisation of the partial function would map both the a and the p into B. In =-=[14]-=-, Constable and Smith develop a partial type theory for the Nuprl type system in which, for each type of the underlying total theory, there exists another type which might contain diverging terms. Tog... |

30 | General recursion via coinductive types
- Capretta
- 2005
(Show Context)
Citation Context ...lised by giving it an extra type argument, a proof that the input values satisfy the domain predicate for the function, and it is defined by structural recursion on this proof. In our second approach =-=[9, 6]-=-, we associate to each data type a coinductive type of partial elements. Computations are directly modelled by (possible) infinite structures. Partial and general recursive functions are implemented b... |

25 | Nested general recursion and partiality in type theory
- Bove, Capretta
- 2001
(Show Context)
Citation Context ...the formalisation of partial functions and general recursion in constructive type theory. In a series of previous articles, we expound two different ways of achieving that goal. In our first approach =-=[3, 4, 2, 5]-=-, we define an inductive (domain) predicate that characterises the inputs on which a function terminates. The constructors of this predicate can be easily and automatically determined from the recursi... |

20 | Partial objects in the calculus of constructions
- Audebaud
- 1991
(Show Context)
Citation Context ...er type which might contain diverging terms. Together with this type of partial elements, a termination predicate and an induction principle to reason about partial functions are introduced. Audebaud =-=[1]-=- uses Constable and Smith idea [14] to define a conservative extension of the Calculus of Construction [15] with fix point terms and a type of partial objects. Strong normalisation still holds for ter... |

15 |
Constructive mathematics as a programming logic, I: Some principles of theory
- CONSTABLE
- 1985
(Show Context)
Citation Context ...s can be found in the literature. Below we summarise those we believe are more relevant. Constable and Mendler [13] introduce a type of partial functions as a new type constructor in the Nuprl system =-=[12]-=-. Given a partial function, one can compute its domain predicate, which contains basically the same information as our domain predicates. A difference is that when defining a partial function in the N... |

9 |
and Venanzio Capretta. Modelling general recursion in type theory
- Bove
(Show Context)
Citation Context ...the formalisation of partial functions and general recursion in constructive type theory. In a series of previous articles, we expound two different ways of achieving that goal. In our first approach =-=[3, 4, 2, 5]-=-, we define an inductive (domain) predicate that characterises the inputs on which a function terminates. The constructors of this predicate can be easily and automatically determined from the recursi... |

8 | Universal algebra in type theory
- Capretta
- 1999
(Show Context)
Citation Context ...oding of the larger class of strictly positive functors given in [8]. In other words, a functor can be given by a signature in the same way that algebraic structures are defined in Universal Algebras =-=[7]-=-. If the functor is of the form F X = X k0 + · · · + X kn , then the signature may consists in just the list of exponents [k0, . . . , kn]. However, some functions have a more general signature: they ... |

3 |
and Venanzio Capretta. Recursive functions with higher order domains
- Bove
(Show Context)
Citation Context |

2 | Computation by prophecy
- Bove, Capretta
- 2007
(Show Context)
Citation Context ...lised by giving it an extra type argument, a proof that the input values satisfy the domain predicate for the function, and it is defined by structural recursion on this proof. In our second approach =-=[9, 6]-=-, we associate to each data type a coinductive type of partial elements. Computations are directly modelled by (possible) infinite structures. Partial and general recursive functions are implemented b... |

2 |
Tarmo Uustalu, and Varmo Vene. Recursive coalgebras from comonads
- Capretta
- 2004
(Show Context)
Citation Context ...nes the arguments of the recursive calls, the second computes the recursive calls, and the third combines the results of the recursive calls to produce the output. This decomposition was described in =-=[10]-=- and is analogous to the separation of an hylomorphism into the composition of an anamorphism and a catamorphism in [19].sWe formalised our approach in the proof assistant Coq [23]. The file containin... |

2 | Partial recursive functions in Martin-Löf Type Theory
- Setzer
(Show Context)
Citation Context ...ints. From the computational point of view, an equivalent of the Kleene theorem for partial recursive functions is obtained but logical aspects need more examination. Based on our work in [3], Setzer =-=[21, 22]-=- defines a type (of codes) of partial functions. From the code of a partial function, one can extract the domain of the function and the function itself, and one can evaluate the function on a certain... |

2 | Version 8 - Manual |

1 | Recursive families of inductive types
- Capretta
- 2000
(Show Context)
Citation Context ...n limit ourselves to finitary functors. The class of these functors is small enough to be encoded by a small type, similarly to the encoding of the larger class of strictly positive functors given in =-=[8]-=-. In other words, a functor can be given by a signature in the same way that algebraic structures are defined in Universal Algebras [7]. If the functor is of the form F X = X k0 + · · · + X kn , then ... |

1 | A data type of partial recursive functions in Martin-Löf Type Theory. 35pp, submitted
- Setzer
- 2007
(Show Context)
Citation Context ...ints. From the computational point of view, an equivalent of the Kleene theorem for partial recursive functions is obtained but logical aspects need more examination. Based on our work in [3], Setzer =-=[21, 22]-=- defines a type (of codes) of partial functions. From the code of a partial function, one can extract the domain of the function and the function itself, and one can evaluate the function on a certain... |