Content deleted Content added
→top: "often" is too strong, as AFIK, this is generally "general recursive function" that is commonly shortened as "recursive function" |
Aliu Salau (talk | contribs) Link suggestions feature: 3 links added. Tags: Visual edit Mobile edit Mobile web edit Newcomer task Suggested: add links |
||
(42 intermediate revisions by 22 users not shown) | |||
Line 1:
{{
In [[mathematical logic]] and [[computer science]], a '''general recursive function''', '''partial recursive function''', or '''μ-recursive function''' is a [[partial function]] from [[natural number]]s to natural numbers that is "computable" in an intuitive sense – as well as in a [[computable function|formal one]]. If the function is [[Total function|total]], it is also called a '''total recursive function''' (sometimes shortened to '''recursive function''').<ref>{{Cite book|chapter-url=https://plato.stanford.edu/entries/recursive-functions/#PartRecuFuncPartRecuFuncREC|title = The Stanford Encyclopedia of Philosophy|chapter = Recursive Functions|year = 2021|publisher = Metaphysics Research Lab, Stanford University}}</ref> In [[Computability theory (computation)|computability theory]], it is shown that the μ-recursive functions are precisely the functions that can be computed by [[Turing machine]]s<ref>[[Stanford Encyclopedia of Philosophy]], Entry [http://plato.stanford.edu/entries/recursive-functions Recursive Functions], Sect.1.7: "[The class of μ-recursive functions] ''turns out to coincide with the class of the Turing-computable functions introduced by Alan Turing as well as with the class of the λ-definable functions introduced by Alonzo Church.''"</ref>{{#tag:ref|{{cite journal | jstor=2268280 |first=Alan Mathison |last=Turing | author-link=Alan
Other equivalent classes of functions are the functions of [[lambda calculus]] and the functions that can be computed by [[Markov algorithm]]s.
Line 8:
==Definition==
The '''μ-recursive functions''' (or '''general recursive functions''') are partial functions that take finite tuples of natural numbers and return a single natural number. They are the smallest class of partial functions that includes the initial functions and is closed under composition, primitive recursion, and the [[μ operator|minimization operator {{mvar|μ}}]].
The smallest class of functions including the initial functions and closed under composition and primitive recursion (i.e. without minimisation) is the class of [[primitive recursive functions]]. While all primitive recursive functions are total, this is not true of partial recursive functions; for example, the minimisation of the successor function is undefined. The primitive recursive functions are a subset of the total recursive functions, which are a subset of the partial recursive functions. For example, the [[Ackermann function]] can be proven to be total recursive, and to be non-primitive.
Primitive or "basic" functions:
#
#::<math>C_n^k(x_1,\ldots,x_k) \ \stackrel{\mathrm{def}}{=}\ n</math> #:Alternative definitions use instead a #
#::<math>S(x) \ \stackrel{\mathrm{def}}{=}\ x + 1\,</math> #
#::<math>P_i^k(x_1,\ldots,x_k) \ \stackrel{\mathrm{def}}{=}\ x_i \, .</math> Operators (the [[___domain of a function]] defined by an operator is the set of the values of the arguments such that every [[function application]] that must be done during the computation provides a well-defined result):
#
#::<math>h \circ (g_1, \ldots, g_m) \ \stackrel{\mathrm{def}}{=}\ f, \quad\text{where}\quad f(x_1,\ldots,x_k) = h(g_1(x_1,\ldots,x_k),\ldots,g_m(x_1,\ldots,x_k)).</math> #:This means that <math>f(x_1,\ldots,x_k)</math> is defined only if <math>g_1(x_1,\ldots,x_k),\ldots, g_m(x_1,\ldots,x_k),</math> and <math>h(g_1(x_1,\ldots,x_k),\ldots,g_m(x_1,\ldots,x_k))</math> are all defined. #
#::<math>\begin{align} \rho(g, h) &\ \stackrel{\mathrm{def}}{=}\ f \quad\text{where the k+1 -ary function } f \text{ is defined by}\\
f(0,x_1,\ldots,x_k) &= g(x_1,\ldots,x_k) \\
f(S(y),x_1,\ldots,x_k) &= h(y,f(y,x_1,\ldots,x_k),x_1,\ldots,x_k)\,.\end{align}</math>
#:This means that <math>f(y,x_1,\ldots,x_k)</math> is defined only if <math>g(x_1,\ldots,x_k)</math> and <math>h(z,f(z,x_1,\ldots,x_k),x_1,\ldots,x_k)</math> are defined for all <math>z<y.</math> #
#::<math>\begin{align} \mu(f)(x_1, \ldots, x_k) = z \stackrel{\mathrm{def}}{\iff}\ f(i, x_1, \ldots, x_k)&>0 \quad \text{for}\quad i=0, \ldots, z-1 \quad\text{and}\\
f(z, x_1, \ldots, x_k)&=0\quad
\end{align}</math>
\end{align}</math><br />Intuitively, minimisation seeks—beginning the search from 0 and proceeding upwards—the smallest argument that causes the function to return zero; if there is no such argument, or if one encounters an argument for which {{mvar|f}} is not defined, then the search never terminates, and <math> \mu(f)</math> is not defined for the argument <math>(x_1, \ldots, x_k).</math> <br> (''Note'': While some textbooks use the μ-operator as defined here,<ref name="Enderton.1972">Enderton, H. B., A Mathematical Introduction to Logic, Academic Press, 1972</ref><ref name="Boolos.Burgess.Jeffrey.2007">Boolos, G. S., Burgess, J. P., Jeffrey, R. C., Computability and Logic, Cambridge University Press, 2007</ref> others like<ref name="Jones.1997">Jones, N. D., Computability and Complexity: From a Programming Perspective, The MIT Press, Cambridge, Massachusetts, London, England, 1997</ref><ref>Kfoury, A. J., R. N. Moll, and M. A. Arbib, A Programming Approach to Computability, 2nd ed., Springer-Verlag, Berlin, Heidelberg, New York, 1982</ref> demand that the μ-operator is applied to ''total'' functions <math>f</math> only. Although this restricts the μ-operator as compared to the definition given here, the class of μ-recursive functions remains the same, which follows from Kleene's Normalform Theorem.<ref name="Enderton.1972"/><ref name="Boolos.Burgess.Jeffrey.2007"/> The only difference is, that it becomes undecidable whether some text satisfies the requirements given for the base functions and operators as it is not semi-decidable (hence undecidable) whether a computable (i.e. μ-recursive) function is total.<ref name="Jones.1997"/>)▼
Intuitively, minimisation seeks—beginning the search from 0 and proceeding upwards—the smallest argument that causes the function to return zero; if there is no such argument, or if one encounters an argument for which {{mvar|f}} is not defined, then the search never terminates, and <math> \mu(f)</math> is not defined for the argument <math>(x_1, \ldots, x_k).</math>
▲
The '''strong equality''' operator <math>\simeq</math> can be used to compare partial μ-recursive functions. This is defined for all partial functions ''f'' and ''g'' so that▼
▲The ''
:<math>f(x_1,\ldots,x_k) \simeq g(x_1,\ldots,x_l)</math>
holds [[if and only if]] for any choice of arguments either both functions are defined and their values are equal or both functions are undefined.
==Examples==
Examples not involving the minimization operator can be found at [[Primitive recursive function#Examples]].
The following examples are intended just to demonstrate the use of the minimization operator; they could also be defined without it, albeit in a more complicated way, since they are all primitive recursive.
{{unordered list
|The [[integer square root]] of {{mvar|x}} can be defined as the least {{mvar|z}} such that <math>(z+1)^2 > x</math>. Using the minimization operator, a general recursive definition is <math>\operatorname{Isqrt} = \mu(\operatorname{Not} \circ \operatorname{Gt} \circ (\operatorname{Mul} \circ (S \circ P_1^2,S \circ P_1^2), P_2^2))</math>, where {{math|Not}}, {{math|Gt}}, and {{math|Mul}} are [[logical negation]], greater-than, and multiplication,<ref>defined in [[Primitive recursive function#Junctors]], [[Primitive recursive function#Equality predicate]], and [[Primitive recursive function#Multiplication]]</ref> respectively. In fact, <math>(\operatorname{Not} \circ \operatorname{Gt} \circ (\operatorname{Mul} \circ (S \circ P_1^2,S \circ P_1^2), P_2^2)) \; (z,x) = (\lnot S(z)*S(z) > x)</math> is {{val|0}} if, and only if, <math>S(z)*S(z) > x</math> holds. Hence <math>\operatorname{Isqrt}(x)</math> is the least {{mvar|z}} such that <math>S(z)*S(z) > x</math> holds. The negation [[junctor]] {{math|Not}} is needed since {{math|Gt}} encodes truth by {{val|1}}, while {{mvar|μ}} seeks for {{val|0}}.
}}
The following examples define general recursive functions that are not primitive recursive; hence they cannot avoid using the minimization operator.
{{unordered list
|{{example needed|date=November 2021}}
}}
== Total recursive function ==
A general recursive function is called '''total recursive function''' if it is defined for every input, or,
== Equivalence with other models of computability ==
Line 46 ⟶ 69:
A [[Kleene's T predicate#Normal form theorem|normal form theorem]] due to Kleene says that for each ''k'' there are primitive recursive functions <math>U(y)\!</math> and <math>T(y,e,x_1,\ldots,x_k)\!</math> such that for any μ-recursive function <math>f(x_1,\ldots,x_k)\!</math> with ''k'' free variables there is an ''e'' such that
:<math>f(x_1,\ldots,x_k) \simeq U(\mu
The number ''e'' is called an
[[Marvin Minsky
== Symbolism ==
A number of different symbolisms are used in the literature. An advantage to using the symbolism is a derivation of a function by "nesting" of the operators one inside the other is easier to write in a compact form. In the following
*
:: e.g. C{{su|b=13|p=7}} ( r, s, t, u, v, w, x ) = 13
:: e.g. const<sub>13</sub> ( r, s, t, u, v, w, x ) = 13
*
:: S(a) = a +1 =<sub>def</sub> a', where 1 =<sub>def</sub> 0', 2 =<sub>def</sub> 0 ' ', etc.
*
: U{{su|b=i|p=n}}( '''x''' ) = id{{su|b=i|p=n}}( '''x''' ) = x<sub>i</sub>
: e.g. U{{su|b=3|p=7}} = id{{su|b=3|p=7}} ( r, s, t, u, v, w, x ) = t
*
:If we are given h( '''x''' )= g( f<sub>1</sub>('''x'''), ... , f<sub>m</sub>('''x''') )
:: h('''x''') = '''S'''{{su|b=m|p=n}}(g, f<sub>1</sub>, ... , f<sub>m</sub> )
Line 72 ⟶ 95:
:: h(''x''')= Cn[g, f<sub>1</sub> ,..., f<sub>m</sub>]('''x''')
*
:* base step: h( 0, '''x''' )= f( '''x''' ), and
:* induction step: h( y+1, '''x''' ) = g( y, h(y, '''x'''),'''x''' )
Line 82 ⟶ 105:
::: Pr{ U{{su|b=1|p=1}}(a), S[ (U{{su|b=2|p=3}}( b, c, a ) ] }
:# S(a) = a'
:# U{{su|b=1|p=1}}(a) = a
Line 103 ⟶ 126:
== References ==
{{
{{
*{{cite book |author-link=Stephen Kleene |first=Stephen |last=Kleene |title=Introduction to Metamathematics |publisher=Walters-Noordhoff & North-Holland |orig-year=1952 |year=1991 |isbn=0-7204-2103-9 }}
*{{cite book |first=R. |last=Soare |title=Recursively enumerable sets and degrees: A Study of Computable Functions and Computably Generated Sets |publisher=Springer-Verlag |orig-year=1987 |year=1999 |isbn=9783540152996 |url=https://books.google.com/books?id=9I7Pl00LU5gC&pg=PP1}}
*{{cite book|author-link=Marvin L. Minsky |first=Marvin L. |last=Minsky |title=Computation: Finite and Infinite Machines |publisher=Prentice-Hall |orig-year=1967 |year=1972 |pages=210–5 |isbn=9780131654495}}
:On pages 210-215 Minsky shows how to create the μ-operator using the [[register machine]] model, thus demonstrating its equivalence to the general recursive functions.
*{{cite book |author-link=George Boolos |
{{
==External links==
*[http://plato.stanford.edu/entries/recursive-functions/ Stanford Encyclopedia of Philosophy entry]
*[http://people.irisa.fr/Francois.Schwarzentruber/recursive_functions_to_turing_machines/ A compiler for transforming a recursive function into an equivalent Turing machine]
{{Authority control}}
{{DEFAULTSORT:Mu-Recursive Function}}
|