HOME

TheInfoList



OR:

In
mathematical logic Mathematical logic is the study of formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical properties of forma ...
and
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
, a general recursive function, partial recursive function, or μ-recursive function is a
partial function In mathematics, a partial function from a set to a set is a function from a subset of (possibly itself) to . The subset , that is, the domain of viewed as a function, is called the domain of definition of . If equals , that is, if is de ...
from
natural number In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called '' cardinal ...
s to natural numbers that is "computable" in an intuitive sense – as well as in a formal one. If the function is total, it is also called a total recursive function (sometimes shortened to recursive function). In
computability theory Computability theory, also known as recursion theory, is a branch of mathematical logic, computer science, and the theory of computation that originated in the 1930s with the study of computable functions and Turing degrees. The field has sinc ...
, it is shown that the μ-recursive functions are precisely the functions that can be computed by
Turing machine A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer alg ...
s (this is one of the theorems that supports the
Church–Turing thesis In computability theory, the Church–Turing thesis (also known as computability thesis, the Turing–Church thesis, the Church–Turing conjecture, Church's thesis, Church's conjecture, and Turing's thesis) is a thesis about the nature of co ...
). The μ-recursive functions are closely related to
primitive recursive function In computability theory, a primitive recursive function is roughly speaking a function that can be computed by a computer program whose loops are all "for" loops (that is, an upper bound of the number of iterations of every loop can be determined ...
s, 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 the
Ackermann function In computability theory, the Ackermann function, named after Wilhelm Ackermann, is one of the simplest and earliest-discovered examples of a total computable function that is not primitive recursive. All primitive recursive functions are total ...
. Other equivalent classes of functions are the functions of
lambda calculus Lambda calculus (also written as ''λ''-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation th ...
and the functions that can be computed by Markov algorithms. The subset of all ''total'' recursive functions with values in is known in
computational complexity theory In theoretical computer science and mathematics, computational complexity theory focuses on classifying computational problems according to their resource usage, and relating these classes to each other. A computational problem is a task solved ...
as the complexity class R.


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 In computability theory, the μ-operator, minimization operator, or unbounded search operator searches for the least natural number with a given property. Adding the μ-operator to the five primitive recursive operators makes it possible to define ...
. 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 In computability theory, a primitive recursive function is roughly speaking a function that can be computed by a computer program whose loops are all "for" loops (that is, an upper bound of the number of iterations of every loop can be determined ...
. 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 In computability theory, the Ackermann function, named after Wilhelm Ackermann, is one of the simplest and earliest-discovered examples of a total computable function that is not primitive recursive. All primitive recursive functions are total ...
can be proven to be total recursive, and to be non-primitive. Primitive or "basic" functions: #''Constant functions '': For each natural number and every #::C_n^k(x_1,\ldots,x_k) \ \stackrel\ n #:Alternative definitions use instead a ''zero 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. # ''Successor function S:'' #::S(x) \ \stackrel\ x + 1\, # ''Projection function'' P_i^k (also called the ''Identity function''): For all natural numbers i, k such that 1\le i\le k: #::P_i^k(x_1,\ldots,x_k) \ \stackrel\ x_i \, . Operators (the
domain of a function In mathematics, the domain of a function is the set of inputs accepted by the function. It is sometimes denoted by \operatorname(f) or \operatornamef, where is the function. More precisely, given a function f\colon X\to Y, the domain of is . ...
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): # ''Composition operator'' \circ\, (also called the ''substitution operator''): Given an m-ary function h(x_1,\ldots,x_m)\, and m k-ary functions g_1(x_1,\ldots,x_k),\ldots,g_m(x_1,\ldots, x_k): #::h \circ (g_1, \ldots, g_m) \ \stackrel\ f, \quad\text\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 that f(x_1,\ldots,x_k) is defined only if g_1(x_1,\ldots,x_k),\ldots, g_m(x_1,\ldots,x_k), and h(g_1(x_1,\ldots,x_k),\ldots,g_m(x_1,\ldots,x_k)) are all defined. # ''Primitive recursion operator'' : Given the ''k''-ary function g(x_1,\ldots,x_k)\, and ''k''+2 -ary function h(y,z,x_1,\ldots,x_k)\,: #::\begin \rho(g, h) &\ \stackrel\ f \quad\text f \text\\ 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 #:This means that f(y,x_1,\ldots,x_k) is defined only if g(x_1,\ldots,x_k) and h(z,f(z,x_1,\ldots,x_k),x_1,\ldots,x_k) are defined for all z #''Minimization operator'' : Given a (''k''+1)-ary function f(y, x_1, \ldots, x_k)\,, the ''k''-ary function \mu(f) is defined by: #::\begin \mu(f)(x_1, \ldots, x_k) = z \stackrel\ f(i, x_1, \ldots, x_k)&>0 \quad \text\quad i=0, \ldots, z-1 \quad\text\\ f(z, x_1, \ldots, x_k)&=0\quad \end 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 is not defined, then the search never terminates, and \mu(f) is not defined for the argument (x_1, \ldots, x_k). While some textbooks use the μ-operator as defined here,Enderton, H. B., A Mathematical Introduction to Logic, Academic Press, 1972Boolos, G. S., Burgess, J. P., Jeffrey, R. C., Computability and Logic, Cambridge University Press, 2007 others likeJones, N. D., Computability and Complexity: From a Programming Perspective, The MIT Press, Cambridge, Massachusetts, London, England, 1997 demand that the μ-operator is applied to ''total'' functions 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 (see
below Below may refer to: *Earth *Ground (disambiguation) *Soil *Floor *Bottom (disambiguation) *Less than *Temperatures below freezing *Hell or underworld People with the surname *Ernst von Below (1863–1955), German World War I general *Fred Below ( ...
). 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. The ''strong equality'' operator \simeq can be used to compare partial μ-recursive functions. This is defined for all partial functions ''f'' and ''g'' so that :f(x_1,\ldots,x_k) \simeq g(x_1,\ldots,x_l) 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. The following examples define general recursive functions that are not primitive recursive; hence they cannot avoid using the minimization operator.


Total recursive function

A general recursive function is called total recursive function if it is defined for every input, or, equivalently, if it can be computed by a
total Turing machine In computability theory, a decider is a Turing machine that halts for every input. A decider is also called a total Turing machineKozen, 1997 as it represents a total function. Because it always halts, such a machine is able to decide whether a ...
. There is no way to computably tell if a given general recursive function is total - see ''
Halting problem In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running, or continue to run forever. Alan Turing proved in 1936 that a ...
''.


Equivalence with other models of computability

In the equivalence of models of computability, a parallel is drawn between
Turing machine A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer alg ...
s 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

A normal form theorem due to Kleene says that for each ''k'' there are primitive recursive functions U(y)\! and T(y,e,x_1,\ldots,x_k)\! such that for any μ-recursive function f(x_1,\ldots,x_k)\! with ''k'' free variables there is an ''e'' such that :f(x_1,\ldots,x_k) \simeq U(\mu y\, T(y,e,x_1,\ldots,x_k)). The number ''e'' is called an ''index'' or ''Gödel number'' for the function ''f''. 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 Minsky (Belarusian: Мінскі; Russian: Минский) is a family name originating in Eastern Europe. People * Hyman Minsky (1919–1996), American economist * Marvin Minsky (1927–2016), American cognitive scientist in the field of ...
observes the U defined above is in essence the μ-recursive equivalent of the
universal Turing machine In computer science, a universal Turing machine (UTM) is a Turing machine that can simulate an arbitrary Turing machine on arbitrary input. The universal machine essentially achieves this by reading both the description of the machine to be simu ...
:


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 the string of parameters x1, ..., xn is abbreviated as x: * ''Constant function'': Kleene uses " C(x) = q " and Boolos-Burgess-Jeffrey (2002) (B-B-J) use the abbreviation " constn( x) = n ": :: e.g. C ( r, s, t, u, v, w, x ) = 13 :: e.g. const13 ( r, s, t, u, v, w, x ) = 13 * ''Successor function'': Kleene uses x' and S for "Successor". As "successor" is considered to be primitive, most texts use the apostrophe as follows: :: S(a) = a +1 =def a', where 1 =def 0', 2 =def 0 ' ', etc. * ''Identity function'': Kleene (1952) uses " U " to indicate the identity function over the variables xi; B-B-J use the identity function id over the variables x1 to xn: : U( x ) = id( x ) = xi : e.g. U = id ( r, s, t, u, v, w, x ) = t * ''Composition (Substitution) operator'': Kleene uses a bold-face S (not to be confused with his S for "successor" ! ). The superscript "m" refers to the mth of function "fm", whereas the subscript "n" refers to the nth variable "xn": :If we are given h( x )= g( f1(x), ... , fm(x) ) :: h(x) = S(g, f1, ... , fm ) :In a similar manner, but without the sub- and superscripts, B-B-J write: :: h(''x)= Cn , f1 ,..., fmx) * ''Primitive Recursion'': Kleene uses the symbol " Rn(base step, induction step) " where n indicates the number of variables, B-B-J use " Pr(base step, induction step)(x)". Given: :* base step: h( 0, x )= f( x ), and :* induction step: h( y+1, x ) = g( y, h(y, x),x ) : Example: primitive recursion definition of a + b: ::* base step: f( 0, a ) = a = U(a) ::* induction step: f( b' , a ) = ( f ( b, a ) )' = g( b, f( b, a), a ) = g( b, c, a ) = c' = S(U( b, c, a )) ::: R2 ::: Pr ''Example'': Kleene gives an example of how to perform the recursive derivation of f(b, a) = b + a (notice reversal of variables a and b). He starts with 3 initial functions :# S(a) = a' :# U(a) = a :# U( b, c, a ) = c :# g(b, c, a) = S(U( b, c, a )) = c' :# base step: h( 0, a ) = U(a) :: induction step: h( b', a ) = g( b, h( b, a ), a ) He arrives at: :: a+b = R2 U, S(S, U)


Examples

*
Fibonacci number In mathematics, the Fibonacci numbers, commonly denoted , form a sequence, the Fibonacci sequence, in which each number is the sum of the two preceding ones. The sequence commonly starts from 0 and 1, although some authors start the sequence from ...
*
McCarthy 91 function The McCarthy 91 function is a recursive function, defined by the computer scientist John McCarthy as a test case for formal verification within computer science. The McCarthy 91 function is defined as :M(n)=\begin n - 10, & \mboxn > 100\mbox ...


See also

*
Recursion theory Computability theory, also known as recursion theory, is a branch of mathematical logic, computer science, and the theory of computation that originated in the 1930s with the study of computable functions and Turing degrees. The field has sinc ...
*
Recursion Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematic ...
*
Recursion (computer science) In computer science, recursion is a method of solving a computational problem where the solution depends on solutions to smaller instances of the same problem. Recursion solves such recursive problems by using functions that call themselves ...


References

* * * :On pages 210-215 Minsky shows how to create the μ-operator using the
register machine In mathematical logic and theoretical computer science a register machine is a generic class of abstract machines used in a manner similar to a Turing machine. All the models are Turing equivalent. Overview The register machine gets its name fro ...
model, thus demonstrating its equivalence to the general recursive functions. *


External links


Stanford Encyclopedia of Philosophy entryA compiler for transforming a recursive function into an equivalent Turing machine
{{DEFAULTSORT:Mu-Recursive Function Computability theory Theory of computation ru:Рекурсивная функция (теория вычислимости)#Частично рекурсивная функция