Partial Recursive Functions in Automata Theory



Partial recursive functions offer a machine-independent way to describe the collection of computable partial functions. The idea is to characterize these functions using basic operations, such as composition, primitive recursion, and minimization, rather than relying on specific computational models like Turing machines.

In this chapter, we will see the basics of partial recursive functions, with some examples, for a better understanding on the concepts.

Basics of Partial Recursive Functions

A partial recursive function is a type of function that can be defined using three basic operations −

  • Composition − This operation allows the creation of a new function by applying one function to the results of other functions.
  • Primitive Recursion − This builds new functions from simpler ones by applying a process that depends on the values of previously defined functions.
  • Minimization − This finds the smallest value for which a function produces a specific result, usually zero.

The idea of partial recursive was first introduced by Stephen Kleene in 1936, building on the work of Godel and Herbrand.

Machine-Independent Description

Partial recursive functions are considered machine-independent because their definition does not rely on any specific computational model. Instead, they are described in terms of operations that can be applied to basic functions to generate more complex functions.

This abstraction allows us to focus on the logical structure of computation rather than the physical implementation.

Examples of Partial Recursive Functions

Let us see some examples to better understand how partial recursive functions work.

Sum of Natural Numbers

Consider the function f1(x) that calculates the sum of the first x natural numbers −

$$\mathrm{f_{1}(0) \: \equiv \: 0}$$

$$\mathrm{f_{1}(x \:+\: 1) \:\equiv \:f_{1}(x) \:+\: (x \:+\: 1)}$$

This function is defined using primitive recursion. It starts with f1(0) = 0 and then adds the next natural number in the sequence to the sum computed so far.

Fibonacci Sequence

The Fibonacci sequence is another example of a function defined using primitive recursion −

$$\mathrm{f_{2}(0) \: \equiv \: 0}$$

$$\mathrm{f_{2}(1) \: \equiv \: 1}$$

$$\mathrm{f_{2}(x \: + \: 2) \: \equiv \: f_{2}(x) \: + \: f_{2}(x \: + \: 1)}$$

Here, the function f2(x) returns the x-th Fibonacci number. The base cases are f2(0) = 0 and f2(1) = 1. Each subsequent value is the sum of the two preceding values.

Undefined Function

We have not discussed the total function here, will discuss in the next article. But this is based on the total functions. Not all partial recursive functions are total (i.e., defined for all inputs). Consider the function f3(x) −

$$\mathrm{f_{3}(0) \: \equiv \: 0}$$

$$\mathrm{f_{3}(x + 1) \: \equiv \: f_{3}(x \:+\: 2) \:+\: 1}$$

In this case, f3(x) is undefined for any value of x other than 0. This highlights an important aspect of partial recursive functions: they can be undefined for certain inputs.

McCarthy's 91 Function

A more complex example is McCarthy's 91 function, f4(x) −

$$\mathrm{f_{4}(x) \: \equiv \: if \:\:x \: \gt \: 100\:\: then \:\:x\: - \:10\:\: else \:\:f_{4}(f_{4}(x \:+\: 11))}$$

This function returns 91 for all inputs x ≤ 100 and x - 10 for inputs greater than 100. It is a well-known example in recursion theory.

Primitive Recursion

Primitive recursion is one of the key operations used to define partial recursive functions. To understand it better, let us consider some classic examples −

Addition − The addition function add(x1, x2) can be defined using primitive recursion −

$$\mathrm{add(x_{1},\: 0) \:\equiv \: x_{1}}$$

$$\mathrm{add(x_{1},\: x_{1}\: +\: 1)\: \equiv \: add(x_{1},\: x_{1})\: +\: 1}$$

This function starts with adding zero to x1, and then successively adds 1 for each increment of x2.

Predecessor − The predecessor function pred(x), which returns the previous natural number, can also be defined via primitive recursion −

$$\mathrm{pred(0) \:\equiv \: 0}$$

$$\mathrm{pred(x \:+\: 1) \:\equiv \: x}$$

Here, the predecessor of zero is defined as zero, and for any other number, it simply subtracts 1.

Multiplication − Multiplication is another operation that can be defined through primitive recursion −

$$\mathrm{mult(x_{1},\: 0)\: \equiv \:0}$$

$$\mathrm{mult(x_{1},\: x_{2}\: + \: 1)\: \equiv \: mult(x_{1},\: x_{2}) \: + \: x_{1}}$$

Multiplication starts with multiplying x1 by zero, resulting in zero, and then repeatedly adds x1 for each increment in x2.

Minimization − The minimization operation is a bit more complex. It finds the smallest value for which a function produces a result of zero. Consider the following example −

Integer Division − The integer division function can be defined using minimization −

integer part of x1 / x2 ≡ least x3 such that x1 < x2 (x3 + 1)

This function finds the smallest x3 such that multiplying x2 by x3 + 1 is still greater than x1, effectively giving the integer part of the division.

Computability

A partial function f is defined as partial recursive if it can be built up from basic functions using the operations of composition, primitive recursion, and minimization. This set of functions, denoted as PR, includes all the functions that can be defined in this way.

One of the key properties of partial recursive functions is that they are computable. It means, there exists a mechanical procedure (such as a Turing machine) that can compute the function for all inputs where it is defined.

Conclusion

In this chapter, we explored the concept of partial recursive functions. We started with the basic operations used to define these functions: composition, primitive recursion, and minimization. We then focused on several examples, such as the sum of natural numbers, the Fibonacci sequence, and McCarthy's 91 function, to see how these functions can be constructed and used. Finally, we discussed the definition of partial recursive functions and their computability.

Advertisements