fbpx
Wikipedia

General recursive function

In mathematical logic and computer science, a general recursive function, partial recursive function, or μ-recursive function is a partial function from natural numbers 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).[1] In computability theory, it is shown that the μ-recursive functions are precisely the functions that can be computed by Turing machines[2][4] (this is one of the theorems that supports the Church–Turing thesis). The μ-recursive functions are closely related to primitive 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 the Ackermann function.

Other equivalent classes of functions are the functions of lambda calculus and the functions that can be computed by Markov algorithms.

The subset of all total recursive functions with values in {0,1} is known in computational complexity theory 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.

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:

  1. Constant functions Ck
    n
    : For each natural number n and every k
     
    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.
  2. Successor function S:
     
  3. Projection function   (also called the Identity function): For all natural numbers   such that  :
     

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

  1. Composition operator   (also called the substitution operator): Given an m-ary function   and m k-ary functions  :
     
    This means that   is defined only if   and   are all defined.
  2. Primitive recursion operator ρ: Given the k-ary function   and k+2 -ary function  :
     
    This means that   is defined only if   and   are defined for all  
  3. Minimization operator μ: Given a (k+1)-ary function  , the k-ary function   is defined by:
     

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 f is not defined, then the search never terminates, and   is not defined for the argument  

While some textbooks use the μ-operator as defined here,[5][6] others like[7][8] demand that the μ-operator is applied to total functions f 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).[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]

The strong equality operator   can be used to compare partial μ-recursive functions. This is defined for all partial functions f and g so that

 

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 integer square root of x can be defined as the least z such that  . Using the minimization operator, a general recursive definition is  , where Not, Gt, and Mul are logical negation, greater-than, and multiplication,[9] respectively. In fact,   is 0 if, and only if,   holds. Hence   is the least z such that   holds. The negation junctor Not is needed since Gt encodes truth by 1, while μ seeks for 0.

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. There is no way to computably tell if a given general recursive function is total - see Halting problem.

Equivalence with other models of computability

In the equivalence of models of computability, a parallel is drawn between Turing 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

A normal form theorem due to Kleene says that for each k there are primitive recursive functions   and   such that for any μ-recursive function   with k free variables there is an e such that

 .

The number e is called an index or Gödel number for the function f.[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 the   defined above is in essence the μ-recursive equivalent of the universal 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

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 " Cn
    q
    (x) = q " and Boolos-Burgess-Jeffrey (2002) (B-B-J) use the abbreviation " constn( x) = n ":
e.g. C7
13
( 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 " Un
    i
    " to indicate the identity function over the variables xi; B-B-J use the identity function idn
    i
    over the variables x1 to xn:
Un
i
( x ) = idn
i
( x ) = xi
e.g. U7
3
= id7
3
( r, s, t, u, v, w, x ) = t
  • Composition (Substitution) operator: Kleene uses a bold-face Sm
    n
    (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) = Sn
m
(g, f1, ... , fm )
In a similar manner, but without the sub- and superscripts, B-B-J write:
h(x')= Cn[g, f1 ,..., fm](x)
  • 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 = U1
    1
    (a)
  • induction step: f( b' , a ) = ( f ( b, a ) )' = g( b, f( b, a), a ) = g( b, c, a ) = c' = S(U3
    2
    ( b, c, a ))
R2 { U1
1
(a), S [ (U3
2
( b, c, a ) ] }
Pr{ U1
1
(a), S[ (U3
2
( b, c, a ) ] }

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

  1. S(a) = a'
  2. U1
    1
    (a) = a
  3. U3
    2
    ( b, c, a ) = c
  4. g(b, c, a) = S(U3
    2
    ( b, c, a )) = c'
  5. base step: h( 0, a ) = U1
    1
    (a)
induction step: h( b', a ) = g( b, h( b, a ), a )

He arrives at:

a+b = R2[ U1
1
, S3
1
(S, U3
2
) ]

Examples

See also

References

  1. ^ "Recursive Functions". The Stanford Encyclopedia of Philosophy. Metaphysics Research Lab, Stanford University. 2021.
  2. ^ Stanford Encyclopedia of Philosophy, Entry 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."
  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:                [3]  
  5. ^ a b Enderton, H. B., A Mathematical Introduction to Logic, Academic Press, 1972
  6. ^ a b Boolos, G. S., Burgess, J. P., Jeffrey, R. C., Computability and Logic, Cambridge University Press, 2007
  7. ^ a b Jones, 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 in Primitive recursive function#Junctors, Primitive recursive function#Equality predicate, and Primitive 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 the register machine model, thus demonstrating its equivalence to the general recursive functions.

External links

  • Stanford Encyclopedia of Philosophy entry
  • A compiler for transforming a recursive function into an equivalent Turing machine

general, recursive, function, mathematical, logic, computer, science, general, recursive, function, partial, recursive, function, recursive, function, partial, function, from, natural, numbers, natural, numbers, that, computable, intuitive, sense, well, formal. In mathematical logic and computer science a general recursive function partial recursive function or m recursive function is a partial function from natural numbers 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 1 In computability theory it is shown that the m recursive functions are precisely the functions that can be computed by Turing machines 2 4 this is one of the theorems that supports the Church Turing thesis The m recursive functions are closely related to primitive 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 the Ackermann function Other equivalent classes of functions are the functions of lambda calculus and the functions that can be computed by Markov algorithms The subset of all total recursive functions with values in 0 1 is known in computational complexity theory as the complexity class R Contents 1 Definition 2 Examples 3 Total recursive function 4 Equivalence with other models of computability 5 Normal form theorem 6 Symbolism 7 Examples 8 See also 9 References 10 External linksDefinition EditThe m 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 m operator 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 Constant functions Ckn For each natural number n and every k C n k x 1 x k d e f n displaystyle C n k x 1 ldots x k stackrel mathrm def n dd 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 d e f x 1 displaystyle S x stackrel mathrm def x 1 dd Projection function P i k displaystyle P i k also called the Identity function For all natural numbers i k displaystyle i k such that 1 i k displaystyle 1 leq i leq k P i k x 1 x k d e f x i displaystyle P i k x 1 ldots x k stackrel mathrm def x i dd 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 Composition operator displaystyle circ also called the substitution operator Given an m ary function h x 1 x m displaystyle h x 1 ldots x m and m k ary functions g 1 x 1 x k g m x 1 x k displaystyle g 1 x 1 ldots x k ldots g m x 1 ldots x k h g 1 g m d e f f where f x 1 x k h g 1 x 1 x k g m x 1 x k 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 dd This means that f x 1 x k displaystyle f x 1 ldots x k is defined only if g 1 x 1 x k g m x 1 x k displaystyle g 1 x 1 ldots x k ldots g m x 1 ldots x k and h g 1 x 1 x k g m x 1 x k displaystyle h g 1 x 1 ldots x k ldots g m x 1 ldots x k are all defined Primitive recursion operator r Given the k ary function g x 1 x k displaystyle g x 1 ldots x k and k 2 ary function h y z x 1 x k displaystyle h y z x 1 ldots x k r g h d e f f where the k 1 ary function f is defined by f 0 x 1 x k g x 1 x k f S y x 1 x k h y f y x 1 x k x 1 x k displaystyle begin aligned rho g h amp stackrel mathrm def f quad text where the k 1 ary function f text is defined by f 0 x 1 ldots x k amp g x 1 ldots x k f S y x 1 ldots x k amp h y f y x 1 ldots x k x 1 ldots x k end aligned dd This means that f y x 1 x k displaystyle f y x 1 ldots x k is defined only if g x 1 x k displaystyle g x 1 ldots x k and h z f z x 1 x k x 1 x k displaystyle h z f z x 1 ldots x k x 1 ldots x k are defined for all z lt y displaystyle z lt y Minimization operator m Given a k 1 ary function f y x 1 x k displaystyle f y x 1 ldots x k the k ary function m f displaystyle mu f is defined by m f x 1 x k z d e f f i x 1 x k gt 0 for i 0 z 1 and f z x 1 x k 0 displaystyle begin aligned mu f x 1 ldots x k z stackrel mathrm def iff f i x 1 ldots x k amp gt 0 quad text for quad i 0 ldots z 1 quad text and f z x 1 ldots x k amp 0 quad end aligned dd 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 f is not defined then the search never terminates and m f displaystyle mu f is not defined for the argument x 1 x k displaystyle x 1 ldots x k While some textbooks use the m operator as defined here 5 6 others like 7 8 demand that the m operator is applied to total functions f only Although this restricts the m operator as compared to the definition given here the class of m recursive functions remains the same which follows from Kleene s Normal Form Theorem see below 5 6 The only difference is that it becomes undecidable whether a specific function definition defines a m recursive function as it is undecidable whether a computable i e m recursive function is total 7 The strong equality operator displaystyle simeq can be used to compare partial m recursive functions This is defined for all partial functions f and g so that f x 1 x k g x 1 x l displaystyle 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 EditExamples 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 integer square root of x can be defined as the least z such that z 1 2 gt x displaystyle z 1 2 gt x Using the minimization operator a general recursive definition is Isqrt m Not Gt Mul S P 1 2 S P 1 2 P 2 2 displaystyle 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 where Not Gt and Mul are logical negation greater than and multiplication 9 respectively In fact Not Gt Mul S P 1 2 S P 1 2 P 2 2 z x S z S z gt x displaystyle 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 gt x is 0 if and only if S z S z gt x displaystyle S z S z gt x holds Hence Isqrt x displaystyle operatorname Isqrt x is the least z such that S z S z gt x displaystyle S z S z gt x holds The negation junctor Not is needed since Gt encodes truth by 1 while m seeks for 0 The following examples define general recursive functions that are not primitive recursive hence they cannot avoid using the minimization operator example needed Total recursive function EditA 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 There is no way to computably tell if a given general recursive function is total see Halting problem Equivalence with other models of computability EditThis section needs expansion You can help by adding to it February 2010 In the equivalence of models of computability a parallel is drawn between Turing 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 EditA normal form theorem due to Kleene says that for each k there are primitive recursive functions U y displaystyle U y and T y e x 1 x k displaystyle T y e x 1 ldots x k such that for any m recursive function f x 1 x k displaystyle f x 1 ldots x k with k free variables there is an e such that f x 1 x k U m y T y e x 1 x k displaystyle 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 Godel number for the function f 10 52 53 A consequence of this result is that any m recursive function can be defined using a single instance of the m operator applied to a total primitive recursive function Minsky observes the U displaystyle U defined above is in essence the m recursive equivalent of the universal 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 EditA 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 Cnq x q and Boolos Burgess Jeffrey 2002 B B J use the abbreviation constn x n e g C713 r s t u v w x 13 e g const13 r s t u v w x 13 dd 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 dd Identity function Kleene 1952 uses Uni to indicate the identity function over the variables xi B B J use the identity function idni over the variables x1 to xn Uni x idni x xi e g U73 id73 r s t u v w x tComposition Substitution operator Kleene uses a bold face Smn 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 Snm g f1 fm dd In a similar manner but without the sub and superscripts B B J write h x Cn g f1 fm x dd 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 U11 a induction step f b a f b a g b f b a a g b c a c S U32 b c a R2 U11 a S U32 b c a Pr U11 a S U32 b c a dd dd 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 U11 a a U32 b c a c g b c a S U32 b c a c base step h 0 a U11 a induction step h b a g b h b a a dd He arrives at a b R2 U11 S31 S U32 dd Examples EditFibonacci number McCarthy 91 functionSee also EditRecursion theory Recursion Recursion computer science References Edit Recursive Functions The Stanford Encyclopedia of Philosophy Metaphysics Research Lab Stanford University 2021 Stanford Encyclopedia of Philosophy Entry Recursive Functions Sect 1 7 The class of m 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 l definable functions introduced by Alonzo Church Kleene Stephen C 1936 l definability and recursiveness Duke Mathematical Journal 2 2 340 352 doi 10 1215 s0012 7094 36 00227 2 Turing Alan Mathison Dec 1937 Computability and l Definability Journal of Symbolic Logic 2 4 153 163 doi 10 2307 2268280 JSTOR 2268280 S2CID 2317046 Proof outline on p 153 l definable displaystyle lambda mbox definable t r i v displaystyle stackrel triv implies l K definable displaystyle lambda mbox K mbox definable 160 displaystyle stackrel 160 implies Turing computable displaystyle mbox Turing computable 161 displaystyle stackrel 161 implies m recursive displaystyle mu mbox recursive K l e e n e displaystyle stackrel Kleene implies 3 l definable displaystyle lambda mbox definable a b Enderton H B A Mathematical Introduction to Logic Academic Press 1972 a b Boolos G S Burgess J P Jeffrey R C Computability and Logic Cambridge University Press 2007 a b Jones N D Computability and Complexity From a Programming Perspective The MIT Press Cambridge Massachusetts London England 1997 Kfoury A J R N Moll and M A Arbib A Programming Approach to Computability 2nd ed Springer Verlag Berlin Heidelberg New York 1982 defined in Primitive recursive function Junctors Primitive recursive function Equality predicate and Primitive recursive function Multiplication 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 Minsky 1972 pp 189 Kleene Stephen 1991 1952 Introduction to Metamathematics Walters Noordhoff amp North Holland ISBN 0 7204 2103 9 Soare R 1999 1987 Recursively enumerable sets and degrees A Study of Computable Functions and Computably Generated Sets Springer Verlag ISBN 9783540152996 Minsky Marvin L 1972 1967 Computation Finite and Infinite Machines Prentice Hall pp 210 5 ISBN 9780131654495 On pages 210 215 Minsky shows how to create the m operator using the register machine model thus demonstrating its equivalence to the general recursive functions Boolos George Burgess John Jeffrey Richard 2002 6 2 Minimization Computability and Logic 4th ed Cambridge University Press pp 70 71 ISBN 9780521007580 External links EditStanford Encyclopedia of Philosophy entry A compiler for transforming a recursive function into an equivalent Turing machine Retrieved from https en wikipedia org w index php title General recursive function amp oldid 1123730765, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.