The primitive recursive functions are the smallest collection containing zero functions, successor , and coordinate projections, and closed under composition and primitive recursion. The recursion scheme forms from already constructed functions byConstants follow by composing successor with zero. Define addition, multiplication and exponentiation successively byAt each stage the initial and step functions are compositions of primitive recursive functions already available. Induction on gives , , and , with the recursive convention . Composition with the second projection now gives
A recursive function is a total computable function: an algorithm halts on every input and returns the specified value. Equivalently it is an everywhere-defined member of the partial recursive functions, obtained from the initial zero, successor and projection functions by composition, primitive recursion and unbounded minimization. In minimization , the sequential search must find a zero after all earlier tests have been defined; otherwise the result is undefined. The Church–Turing thesis allows the algorithmic formulation here.
A recursively enumerable set is the domain of a partial computable function. Thus an algorithm halts and accepts exactly on members of , and may run forever on nonmembers. Equivalently an algorithm lists exactly its elements, allowing repetition and allowing an empty output for the empty set. To pass from a listing to a membership semidecision, wait for the input to appear. To pass back, use dovetailing on all inputs and list each whose recognizing computation halts. This differs from a recursive set, whose zero-one characteristic function is total recursive and decides both membership and nonmembership.
The halting problem asks whether program halts on input , given effective codes for both. Suppose a total decision algorithm returned one exactly when that computation halts. Construct a program which, on input , computes and then loops forever if the answer is one, but halts if it is zero. Let be the code of . If , the specification of makes it diverge, while if the same specification makes it halt. Both alternatives contradict correctness. Therefore the halting problem is . This is a diagonal argument, not merely the observation that individual simulations can run forever.
Let . Simulating the specified program semidecides membership, or dovetailing all simulations enumerates , so is a recursively enumerable set. The same diagonal program rules out a total decision algorithm for . Thus . Encoding a pair also gives an enumerable nonrecursive set of all halting program-input pairs.
Articles by others on the same topic
There are currently no matching articles.