# Recursive function theory

### From HaskellWiki

EndreyMark (Talk | contribs) m (Typographic corrections and clearer choice of words) |
EndreyMark (Talk | contribs) (Adding link to Dr Matt Fairtlough's lecture notes, as they contain theoretical texts, implementations written in Haskell, and further useful links. Using also his term ,,initial functions'') |
||

Line 1: | Line 1: | ||

== Introduction == |
== Introduction == |
||

− | [http://planetmath.org/encyclopedia/RecursiveFunction.html PlanetMath article] |
+ | * [http://planetmath.org/encyclopedia/RecursiveFunction.html PlanetMath article] |

+ | * Dr Matt Fairtlough's [http://www.dcs.shef.ac.uk/~matt/teaching/04/com2030/lectures/tomlect13.pdf Introduction to recursive function theory] among his [http://www.dcs.shef.ac.uk/~matt/teaching/04/com2030/ lecture notes] |
||

+ | == Designed languages == |
||

+ | * Dr Matt Fairtlough's [http://www.dcs.shef.ac.uk/~matt/teaching/04/com2030/lectures/tomlect16.pdf Minimal Programming Language (MIN)] is not exactly a recursive function theory language, but it is based on natural numbers, too and its equivalent power with partal recursive functions is shown in its description. |
||

+ | |||

+ | == Implementations == |
||

+ | [http://www.dcs.shef.ac.uk/~matt/teaching/04/com2030/lectures/Recursion.hs In Haskell], among other implementations (e.g. written in Java) in Dr Matt Fairtlough's [http://www.dcs.shef.ac.uk/~matt/teaching/04/com2030/index.html lecture notes] (see the bottom of the page). |
||

== Plans towards a programming language == |
== Plans towards a programming language == |
||

Line 14: | Line 19: | ||

:<math>\begin{matrix}\left\lfloor n + 1\right\rfloor = \underbrace{\mathbb N\times\dots\times\mathbb N}\to\mathbb N\\\;\;\;\;\;\;\;\;n+1\end{matrix}</math> |
:<math>\begin{matrix}\left\lfloor n + 1\right\rfloor = \underbrace{\mathbb N\times\dots\times\mathbb N}\to\mathbb N\\\;\;\;\;\;\;\;\;n+1\end{matrix}</math> |
||

− | === Base functions === |
+ | === Initial functions === |

==== Constant ==== |
==== Constant ==== |

## Revision as of 13:20, 30 April 2006

## Contents |

## 1 Introduction

- PlanetMath article
- Dr Matt Fairtlough's Introduction to recursive function theory among his lecture notes

## 2 Designed languages

- Dr Matt Fairtlough's Minimal Programming Language (MIN) is not exactly a recursive function theory language, but it is based on natural numbers, too and its equivalent power with partal recursive functions is shown in its description.

## 3 Implementations

In Haskell, among other implementations (e.g. written in Java) in Dr Matt Fairtlough's lecture notes (see the bottom of the page).

## 4 Plans towards a programming language

Well-known concepts are taken from [Mon:MatLog], but several new notations (only notations, not concepts) are introduced to reflect all concepts described in [Mon:MatLog], and some simplification are made (by allowing zero-arity generalizations). These are plans to achive formalizations that can allow us in the future to incarnate the main concepts of recursive function theory in a programming language.

## 5 Primitive recursive functions

### 5.1 Type system

### 5.2 Initial functions

#### 5.2.1 Constant

This allows us to deal with a concept of zero in recursive function theory. In the literature (in [Mon:MathLog], too) this aim is achieved in another way: a

is defined instead. Is this approach superfluously overcomplicated? Can we avoid it and use the more simple and indirect looking

approach?

Are these approaches equivalent? Is the latter (more simple looking) one as powerful as the former one? Could we define a using the

approach? Let us try:

(see the definition of somewhat below). This looks like working, but raises new questions: what about generalizing operations (here: composition) to deal with zero-arity cases in an appropriate way? E.g.

where
can be regarded as *n*-ary functions throwing all their *n* arguments away and returning *c*.

Does it take a generalization to allow such cases, or can they be inferred? A practical approach to solve such questions: let us write a Haskell program which implements (at least partially) recursive function theory. Then we can see clearly which things have to be defined and things which are consequences. I think the construct is a rather straighforward thing.

Why all this can be important: it may be exactly that saves us from defining the concept of zero in recursive function theory as

-- it may be superfluous: if we need functions that throw away (some or all) of their arguments and return a constant, then we can combine them from , and , if we allow concepts like .

#### 5.2.2 Successor function

#### 5.2.3 Projection functions

For all :

### 5.3 Operations

#### 5.3.1 Composition

This resembles to the combinator of Combinatory logic (as described in [HasFeyCr:CombLog1, 171]). If we prefer avoiding the notion of the nested tuple, and use a more homogenous style (somewhat resembling to currying):

Let underbrace not mislead us -- it does not mean any bracing.

remembering us to

#### 5.3.2 Primitive recursion

The last equation resembles to the combinator of Combinatory logic (as described in [HasFeyCr:CombLog1, 169]):

## 6 General recursive functions

Everything seen above, and the new concepts:

### 6.1 Type system

See the definition of being *special* [Mon:MathLog, 45]. This property ensures, that minimalization does not lead us out of the world of total functions. Its definition is the rather straightforward formalization of this expectation.

It resembles to the concept of inverse -- more exactly, to the existence part.

### 6.2 Operations

#### 6.2.1 Minimalization

Minimalization does not lead us out of the word of total functions, if we use it only for *special* functions -- the property of being *special* is defined exactly for this purpose [Mon:MatLog, 45].
As we can see, minimalization is a concept resembling somehow to the concept of *inverse*.

Existence of the required minimum value of the set -- a sufficient and satisfactory condition for this is that the set is never empty. And this is equivalent to the statement

## 7 Partial recursive functions

Everything seen above, but new constructs are provided, too.

### 7.1 Type system

Question: is there any sense to define in another way than simply ? Partial constant? Is

or

- ?

### 7.2 Operations

Their definitions are straightforward extension of the corresponding total function based definitions.

Remark: these operations take partial functions as arguments, but they are total operations themselves in the sense that they always yield a result -- at worst an empty function (as an ultimate partial function).

## 8 Bibliography

- [HasFeyCr:CombLog1]
- Curry, Haskell B; Feys, Robert; Craig, William: Combinatory Logic. Volume I. North-Holland Publishing Company, Amsterdam, 1958.
- [Mon:MathLog]
- Monk, J. Donald: Mathematical Logic. Springer-Verlag, New York * Heidelberg * Berlin, 1976.