Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

General recursive function

From Wikipedia, the free encyclopedia
One of several equivalent definitions of a computable function

Inmathematical logic andcomputer science, ageneral recursive function,partial recursive function, orμ-recursive function is apartial function fromnatural numbers to natural numbers that is "computable" in an intuitive sense – as well as in aformal one. If the function istotal, it is also called atotal recursive function (sometimes shortened torecursive function).[1] Incomputability theory, it is shown that the μ-recursive functions are precisely the functions that can be computed byTuring machines[2][4] (this is one of the theorems that supports theChurch–Turing thesis). The μ-recursive functions are closely related toprimitive recursive functions, and their inductive definition (below) builds upon that of the primitive recursive functions. However, not every total recursive function is a primitive recursive function—the most famous example is theAckermann function.

Other equivalent classes of functions are the functions oflambda calculus and the functions that can be computed byMarkov algorithms.

The subset of alltotal recursive functions with values in{0,1} is known incomputational complexity theory as thecomplexity class R.

Definition

[edit]

Theμ-recursive functions (orgeneral 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 theminimization operatorμ.

The smallest class of functions including the initial functions and closed under composition and primitive recursion (i.e. without minimisation) is the class ofprimitive 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, theAckermann function can be proven to be total recursive, and to be non-primitive.

Primitive or "basic" functions:

  1. Constant functionsCk
    n
    : For each natural numbern and everyk
    Cnk(x1,,xk) =def n{\displaystyle C_{n}^{k}(x_{1},\ldots ,x_{k})\ {\stackrel {\mathrm {def} }{=}}\ n}
    Alternative definitions use instead azero function as a primitive function that always returns zero, and build the constant functions from the zero function, the successor function and the composition operator.
  2. Successor function S:
    S(x) =def x+1{\displaystyle S(x)\ {\stackrel {\mathrm {def} }{=}}\ x+1\,}
  3. Projection functionPik{\displaystyle P_{i}^{k}} (also called theIdentity function): For all natural numbersi,k{\displaystyle i,k} such that1ik{\displaystyle 1\leq i\leq k}:
    Pik(x1,,xk) =def xi.{\displaystyle P_{i}^{k}(x_{1},\ldots ,x_{k})\ {\stackrel {\mathrm {def} }{=}}\ x_{i}\,.}

Operators (thedomain of a function defined by an operator is the set of the values of the arguments such that everyfunction application that must be done during the computation provides a well-defined result):

  1. Composition operator{\displaystyle \circ \,} (also called thesubstitution operator): Given an m-ary functionh(x1,,xm){\displaystyle h(x_{1},\ldots ,x_{m})\,} and m k-ary functionsg1(x1,,xk),,gm(x1,,xk){\displaystyle g_{1}(x_{1},\ldots ,x_{k}),\ldots ,g_{m}(x_{1},\ldots ,x_{k})}:
    h(g1,,gm) =def f,wheref(x1,,xk)=h(g1(x1,,xk),,gm(x1,,xk)).{\displaystyle 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})).}
    This means thatf(x1,,xk){\displaystyle f(x_{1},\ldots ,x_{k})} is defined only ifg1(x1,,xk),,gm(x1,,xk),{\displaystyle g_{1}(x_{1},\ldots ,x_{k}),\ldots ,g_{m}(x_{1},\ldots ,x_{k}),} andh(g1(x1,,xk),,gm(x1,,xk)){\displaystyle h(g_{1}(x_{1},\ldots ,x_{k}),\ldots ,g_{m}(x_{1},\ldots ,x_{k}))} are all defined.
  2. Primitive recursion operatorρ: Given thek-ary functiong(x1,,xk){\displaystyle g(x_{1},\ldots ,x_{k})\,} andk+2 -ary functionh(y,z,x1,,xk){\displaystyle h(y,z,x_{1},\ldots ,x_{k})\,}:
    ρ(g,h) =def fwhere the k+1 -ary function f is defined byf(0,x1,,xk)=g(x1,,xk)f(S(y),x1,,xk)=h(y,f(y,x1,,xk),x1,,xk).{\displaystyle {\begin{aligned}\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{aligned}}}
    This means thatf(y,x1,,xk){\displaystyle f(y,x_{1},\ldots ,x_{k})} is defined only ifg(x1,,xk){\displaystyle g(x_{1},\ldots ,x_{k})} andh(z,f(z,x1,,xk),x1,,xk){\displaystyle h(z,f(z,x_{1},\ldots ,x_{k}),x_{1},\ldots ,x_{k})} are defined for allz<y.{\displaystyle z<y.}
  3. Minimization operatorμ: Given a (k+1)-ary functionf(y,x1,,xk){\displaystyle f(y,x_{1},\ldots ,x_{k})\,}, thek-ary functionμ(f){\displaystyle \mu (f)} is defined by:
    μ(f)(x1,,xk)=zdef f(i,x1,,xk)>0fori=0,,z1andf(z,x1,,xk)=0{\displaystyle {\begin{aligned}\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{aligned}}}

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 whichf is not defined, then the search never terminates, andμ(f){\displaystyle \mu (f)} is not defined for the argument(x1,,xk).{\displaystyle (x_{1},\ldots ,x_{k}).}

While some textbooks use the μ-operator as defined here,[5][6] others[7][8] demand that the μ-operator is applied tototal functionsf 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 Normal Form Theorem (seebelow).[5][6] The only difference is, that it becomes undecidable whether a specific function definition defines a μ-recursive function, as it is undecidable whether a computable (i.e. μ-recursive) function is total.[7]

Thestrong equality relation{\displaystyle \simeq } can be used to compare partial μ-recursive functions. This is defined for all partial functionsf andg so that

f(x1,,xk)g(x1,,xl){\displaystyle f(x_{1},\ldots ,x_{k})\simeq g(x_{1},\ldots ,x_{l})}

holdsif and only if for any choice of arguments either both functions are defined and their values are equal or both functions are undefined.

Examples

[edit]

Examples not involving the minimization operator can be found atPrimitive 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.

The following examples define general recursive functions that are not primitive recursive; hence they cannot avoid using the minimization operator.

Total recursive function

[edit]

A general recursive function is calledtotal recursive function if it is defined for every input, or, equivalently, if it can be computed by atotal Turing machine. There is no way to computably tell if a given general recursive function is total - seeHalting problem.

Equivalence with other models of computability

[edit]
[icon]
This sectionneeds expansion. You can help byadding to it.(February 2010)

In theequivalence of models of computability, a parallel is drawn betweenTuring machines that do not terminate for certain inputs and an undefined result for that input in the corresponding partial recursive function.The unbounded search operator is not definable by the rules of primitive recursion as those do not provide a mechanism for "infinite loops" (undefined values).

Normal form theorem

[edit]

Anormal form theorem due to Kleene says that for eachk there are primitive recursive functionsU(y){\displaystyle U(y)\!} andT(y,e,x1,,xk){\displaystyle T(y,e,x_{1},\ldots ,x_{k})\!} such that for any μ-recursive functionf(x1,,xk){\displaystyle f(x_{1},\ldots ,x_{k})\!} withk free variables there is ane such that

f(x1,,xk)U(μ(T)(e,x1,,xk)){\displaystyle f(x_{1},\ldots ,x_{k})\simeq U(\mu (T)(e,x_{1},\ldots ,x_{k}))}.

The numbere is called anindex orGödel number for the functionf.[10]: 52–53  A consequence of this result is that any μ-recursive function can be defined using a single instance of the μ operator applied to a (total) primitive recursive function.

Minsky observes theU{\displaystyle U} defined above is in essence the μ-recursive equivalent of theuniversal Turing machine:

To construct U is to write down the definition of a general-recursive function U(n, x) that correctly interprets the number n and computes the appropriate function of x. to construct U directly would involve essentially the same amount of effort,and essentially the same ideas, as we have invested in constructing the universal Turing machine[11]

Symbolism

[edit]

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 the string of parametersx1,x2,,xn{\displaystyle x_{1},x_{2},\ldots ,x_{n}} is abbreviated asx{\displaystyle x}:


e.g.C137(r,s,t,u,v,w,x)=13{\displaystyle C_{13}^{7}(r,s,t,u,v,w,x)=13}
e.g.const13(r,s,t,u,v,w,x)=13{\displaystyle \mathrm {const} ^{13}(r,s,t,u,v,w,x)=13}
  • Successor function: Kleene usesx{\displaystyle x'} andS{\displaystyle S} for "Successor". As "successor" is considered to be primitive, most texts use the apostrophe as follows:
S(a)=a+1;=def;a{\displaystyle S(a)=a+1;{\overset {\mathrm {def} }{=}};a'}, where
1=def0{\displaystyle 1{\overset {\mathrm {def} }{=}}0'},
2=def0{\displaystyle 2{\overset {\mathrm {def} }{=}}0''}, etc.
Uin(x)=idin(x)=xi{\displaystyle U_{i}^{n}(x)=\mathrm {id} _{i}^{n}(x)=x_{i}}
e.g.U37(r,s,t,u,v,w,x)=id37(r,s,t,u,v,w,x)=t{\displaystyle U_{3}^{7}(r,s,t,u,v,w,x)=\mathrm {id} _{3}^{7}(r,s,t,u,v,w,x)=t}
If we are given
h(x)=g(f1(x),,fm(x)){\displaystyle h(x)=g(f_{1}(x),\ldots ,f_{m}(x))}
then
h(x)=Smn(g,f1,,fm){\displaystyle h(x)=\mathbf {S} _{m}^{n}(g,f_{1},\ldots ,f_{m})}
In a similar manner, but without the sub- and superscripts, B-B-J write:
h(x)=Cg,f1,,fm{\displaystyle h(x')=Cg,f_{1},\ldots ,f_{m}}
Example: primitive recursion definition ofa+b{\displaystyle a+b}
R2(U11(a),;S(U23(b,c,a))){\displaystyle R^{2}\left(U_{1}^{1}(a),;S(U_{2}^{3}(b,c,a))\right)}
Pr(U11(a),;S(U23(b,c,a))){\displaystyle \Pr \left(U_{1}^{1}(a),;S(U_{2}^{3}(b,c,a))\right)}

Example: Kleene gives an example of how to perform the recursive derivation off(b,a)=b+a{\displaystyle f(b,a)=b+a} (notice reversal of variablesa{\displaystyle a} andb{\displaystyle b}). He starts with3{\displaystyle 3} initial functions

  1. S(a)=a{\displaystyle S(a)=a'}
  2. U11(a)=a{\displaystyle U_{1}^{1}(a)=a}
  3. U23(b,c,a)=c{\displaystyle U_{2}^{3}(b,c,a)=c}
  4. g(b,c,a)=S(U23(b,c,a))=c{\displaystyle g(b,c,a)=S(U_{2}^{3}(b,c,a))=c'}
  5. base step:h(0,a)=U11(a){\displaystyle h(0,a)=U_{1}^{1}(a)}
induction step:h(b,a)=g(b,h(b,a),a){\displaystyle h(b',a)=g(b,h(b,a),a)}

He arrives at:

a+b=R2(U11,;S13(S,U23)){\displaystyle a+b=R^{2}\left(U_{1}^{1},;S_{1}^{3}(S,U_{2}^{3})\right)}

Examples

[edit]

See also

[edit]

References

[edit]
  1. ^"Recursive Functions".The Stanford Encyclopedia of Philosophy. Metaphysics Research Lab, Stanford University. 2021.
  2. ^Stanford Encyclopedia of Philosophy, EntryRecursive 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."
  3. ^Kleene, Stephen C. (1936)."λ-definability and recursiveness".Duke Mathematical Journal.2 (2):340–352.doi:10.1215/s0012-7094-36-00227-2.
  4. ^Turing, Alan Mathison (Dec 1937). "Computability and λ-Definability".Journal of Symbolic Logic.2 (4):153–163.doi:10.2307/2268280.JSTOR 2268280.S2CID 2317046. Proof outline on p.153:λ-definable{\displaystyle \lambda {\mbox{-definable}}}triv{\displaystyle {\stackrel {triv}{\implies }}}λ-K-definable{\displaystyle \lambda {\mbox{-}}K{\mbox{-definable}}}160{\displaystyle {\stackrel {160}{\implies }}}Turing computable{\displaystyle {\mbox{Turing computable}}}161{\displaystyle {\stackrel {161}{\implies }}}μ-recursive{\displaystyle \mu {\mbox{-recursive}}}Kleene{\displaystyle {\stackrel {Kleene}{\implies }}}[3]λ-definable{\displaystyle \lambda {\mbox{-definable}}}
  5. ^abEnderton, H. B., A Mathematical Introduction to Logic, Academic Press, 1972
  6. ^abBoolos, G. S., Burgess, J. P., Jeffrey, R. C., Computability and Logic, Cambridge University Press, 2007
  7. ^abJones, N. D., Computability and Complexity: From a Programming Perspective, The MIT Press, Cambridge, Massachusetts, London, England, 1997
  8. ^Kfoury, A. J., R. N. Moll, and M. A. Arbib, A Programming Approach to Computability, 2nd ed., Springer-Verlag, Berlin, Heidelberg, New York, 1982
  9. ^defined inPrimitive recursive function#Junctors,Primitive recursive function#Equality predicate, andPrimitive recursive function#Multiplication
  10. ^Stephen Cole Kleene (Jan 1943)."Recursive predicates and quantifiers"(PDF).Transactions of the American Mathematical Society.53 (1):41–73.doi:10.1090/S0002-9947-1943-0007371-8.
  11. ^Minsky 1972, pp. 189.
On pages 210-215 Minsky shows how to create the μ-operator using theregister machine model, thus demonstrating its equivalence to the general recursive functions.

External links

[edit]
National
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=General_recursive_function&oldid=1322119151"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp