(→‎Implementations: link to archive.org-archived version as the website is no longer available)

(5 intermediate revisions by one user not shown)

Line 8:

Line 8:

== Implementations ==

== 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).

+

[http://web.archive.org/web/20060713051445/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://web.archive.org/web/20060713073121/http://www.dcs.shef.ac.uk/~matt/teaching/04/com2030/ lecture notes] (see the bottom of the page).

== Motivations ==

== Motivations ==

−

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 ''toy'' programming language, to play with it so that some interesting concepts can be taught in a funny way.

+

Well-known concepts are taken from [Mon:MathLog], but several new notations (only notations, not concepts) are introduced to reflect all concepts described in [Mon:MathLog], and some simplifications are made (by allowing zero-arity generalizations). These are plans to achieve formalizations that can allow us in the future to incarnate the main concepts of recursive function theory in a ''toy'' programming language, to play with it so that some interesting concepts can be taught in a funny way.

−

The relatedness of this page to Haskell (and to funtional programming) is very few. It seems to me that (programming in) recursive functional theory may be another world (e.g. currying is missing, too) -- although the lack of variables (even lack of formal parameters) can yield a feeling resembling to [[pointfree]] style programming, or even to [[combinatory logic]].

+

The relatedness of this page to Haskell (and to functional programming) is very few. It seems to me that (programming in) recursive functional theory may be rather another world (e.g. currying is missing, too) -- although the lack of variables (even lack of formal parameters) can yield a feeling resembling to [[pointfree]] style programming, or even to [[combinatory logic]].

But despite of its weak (direct) relatedness to functional programming, maybe this page can be useful for someone in the future

But despite of its weak (direct) relatedness to functional programming, maybe this page can be useful for someone in the future

because type-safe implementations of <math>\underline\mathbf\dot K^m_n</math> and <math>\underline\mathbf K^m_n</math> does not look straightforward for me.

because type-safe implementations of <math>\underline\mathbf\dot K^m_n</math> and <math>\underline\mathbf K^m_n</math> does not look straightforward for me.

+

+

== Notations ==

+

+

;<math>\mathbb N</math>

+

:the set of natural numbers, incuding 0

+

;''Type system''

+

:I do not use this term in a precise way here: see the following items for explanation. Headlines ''Type system'' may suggest that the type system of the planned recursive function theory programming language implementation can prevent the user from applying a partial function to an out-of-domain value -- but I think that type safety in this sense cannot be achieved.

+

;<math>f:A\to B</math>

+

:<math>f</math> is a total function from <math>A</math> to <math>B</math>. In an implemented recursion function theory language, it means a function that surely terminates.

+

;<math>f:A\supset\!\to B</math>

+

:<math>f</math> is a partial function from <math>A</math> to <math>B</math> (it may be either a total function or a proper partial function). In an implemented recursion theory language, maybe this information (being partial) cannot be grasped by the type system. It may mean that proper partial functions simply fail to terminate, without reflecting this possibility in the type system in any way.

+

;<math>A\times B</math>

+

:Descartes-product of sets is used here for stressing the fact that recursive function theory does not know the concept of ''currying'' (much more other concepts will be needed to achieve something similar to currying, see [http://en.wikipedia.org/wiki/S-m-n_theorem Kleene's <math>s^m_n</math> theorem]). So using <math>f:A\times B\to C</math> (instead of <math>f:A\to B\to C</math>) is intended to stress the lack of currying (at this level).

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.

Well-known concepts are taken from [Mon:MathLog], but several new notations (only notations, not concepts) are introduced to reflect all concepts described in [Mon:MathLog], and some simplifications are made (by allowing zero-arity generalizations). These are plans to achieve formalizations that can allow us in the future to incarnate the main concepts of recursive function theory in a toy programming language, to play with it so that some interesting concepts can be taught in a funny way.

The relatedness of this page to Haskell (and to functional programming) is very few. It seems to me that (programming in) recursive functional theory may be rather another world (e.g. currying is missing, too) -- although the lack of variables (even lack of formal parameters) can yield a feeling resembling to pointfree style programming, or even to combinatory logic.

But despite of its weak (direct) relatedness to functional programming, maybe this page can be useful for someone in the future

I do not use this term in a precise way here: see the following items for explanation. Headlines Type system may suggest that the type system of the planned recursive function theory programming language implementation can prevent the user from applying a partial function to an out-of-domain value -- but I think that type safety in this sense cannot be achieved.

f is a total function from A to B. In an implemented recursion function theory language, it means a function that surely terminates.

f is a partial function from A to B (it may be either a total function or a proper partial function). In an implemented recursion theory language, maybe this information (being partial) cannot be grasped by the type system. It may mean that proper partial functions simply fail to terminate, without reflecting this possibility in the type system in any way.

Descartes-product of sets is used here for stressing the fact that recursive function theory does not know the concept of currying (much more other concepts will be needed to achieve something similar to currying, see Kleene's theorem). So using (instead of ) is intended to stress the lack of currying (at this level).

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 .

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):

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.

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

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).