![]() |
![]() |
|
![]() |
![]() |
Encyclopedia :
R :
RI :
RIC :
Rice's theorem |
|
|
Rice's theoremRice's theorem (also known as The Rice-Myhill-Shapiro theorem) is an important result in the theory ofrecursive functions. A property of partial functions is trivial if it holds for all partial recursive functions or for none. Rice's theorem states that, for any non-trivial property of partial functions, the question of whether a given algorithm computes a partial function with this property is undecidable. Another way of stating this problem that is more useful in computability theory is this: suppose we have a set of languages S. Then the problem of deciding whether the language of a given Turing machine is in S is undecidable, provided that there exists a Turing machine that recognizes a language in S and a Turing machine that recognizes a language not in S. Effectively this means that there is no machine that can always correctly decide whether the language of a given Turing machine has a particular nontrivial property. Special cases include the undecidability of whether a Turing machine accepts a particular string, whether a Turing machine recognizes a particular recognizable language, and whether the language recognized by a Turing machine could be recognized by a nontrivial simpler machine, such as a finite automaton. It is important to note that Rice's Theorem does not say anything about properties of machines, only of functions and languages. For example, asking whether a machine runs for more than 100 steps on some input, whether it has more than 5 states, or whether it ever moves its tape head to the left are all nontrivial but decidable properties. They are not properties of the language because it is possible to find two machines recognizing exactly the same language, one which has the property and one which does not. Using Rogers' characterization of acceptable programming systems, this result may essentially be generalized to most computer programming languages: there exists no automatic method that decides with generality non-trivial questions on the black-box behavior of computer programs. This is one explanation of the difficulty of debugging. As an example, consider the following variant of the ProofProof sketch Suppose, for concreteness, that we have an algorithm for examining a The claim is that we can convert our algorithm for identifying The algorithm is simple: we construct a new program t which (1) temporarily ignores its input while it tries to t(n) { a(i) return n×n } This method doesn't depend specifically on being able to recognize functions that compute squares; as long as some program can do what we're trying to recognize, we can add a call to a to obtain our t. We could have had a method for recognizing programs for computing square roots, or programs for computing the monthly payroll, or programs that halt when given the input "Abraxas", or programs that commit array bounds errors; in each case, we would be able to solve the halting problem similarly. There is one problem with the above proof, however: say that the function that never halts has the property we wish to decide. For example, we may wish to decide if a function never halts. In this case, t will have the property whether or not a(i) halts. Luckily, by our assumptions, there is some function which does not have the property. Simply add a call to a(i) to the beginning of this function. The resulting function has the property if and only if a(i) does not halt. Formal proof For the formal proof, algorithms are presumed to define partial Let us now assume that P(a) is an algorithm that decides some
contradiction and the assumption that there is an algorithm P(a) that decides a non-trivial property for the function represented by a must be false. |
|
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License. |
|
| © 2008 Chamas Enterprises Inc. |