Rice's theorem

Rice's theorem

In computer science, Rice's theorem named after Henry Gordon Rice (also known as The Rice-Myhill-Shapiro theorem after Rice and John Myhill) states that, for any non-trivial property of partial functions, there exists at least one algorithm for which it is undecidable whether the algorithm computes a partial function with this property. Here, a property of partial functions is called "trivial" if it holds for all partial computable functions or for none.

Introduction

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 those properties of machines or programs which are not also properties of functions and languages. For example, whether a machine runs for more than 100 steps on some input is a decidable property, even when it is non-trivial. Implementing exactly the same language, two different machines might require a different number of steps to recognize the same input. Where a property is of the kind that two machines may or may not have it, while still implementing exactly the same language, the property is of the machines and not of the language, and Rice's Theorem does not apply.

Similarly, whether a machine has more than 5 states is a decidable property. On the other hand, the statement that "No modern general-purpose computer can solve the general problem of determining whether a program is virus free" is a consequence of Rice's Theorem because, while a statement about computers, it can be reduced to a statement about languages.

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 halting problem: Take the property a partial function F has if Fis defined for argument 1. It is obviously non-trivial, since there are partial functions that are defined for 1 and others that areundefined at 1. The "1-halting problem" is the problem of deciding of any algorithm whether it defines a function with this property,i.e., whether the algorithm halts on input 1. By Rice's theorem, the 1-halting problem is undecidable.

Formal statement

Let phicolon mathbb{N} o mathbf{P}^{(1)} be a Gödel numbering of the computable functions; a map from the natural numbers to the class of unary partial computable functions.

We identify each "property" that a computable function may have with the subset of mathbf{P}^{(1)} consisting of the functions with that property.Thus given a set F subseteq mathbf{P}^{(1)}, a computable function phi_e has property "F" if and only if phi_e in F. For each property F subseteq mathbf{P}^{(1)} there is an associated decision problem D_F of determining, given "e" , whether phi_e in F.

Rice's theorem states that the decision problem D_F is decidable if and only if F = emptyset or F = mathbf{P}^{(1)}.

Examples

According to Rice's theorem, if there is at least one computable function in a particular class "C" of computable functions and another computable function not in "C" then the problem of deciding whether a particular program computes a function in "C" is undecidable. For example, Rice's theorem shows that each of the following sets of computable functions is undecidable:
* The class of computable functions that return "0" for every input, and its complement.
* The class of computable functions that return "0" for at least one input, and its complement.
* The class of computable functions that are constant, and its complement.

Proof

Proof sketch

Suppose, for concreteness, that we have an algorithm for examining a program "p" and determining infallibly whether "p" is an implementation of the squaring function, which takes an integer "d" and returns "d"2. The proof works just as well if we have an algorithm for deciding any other nontrivial property of programs, and will be given in general below.

The claim is that we can convert our algorithm for identifying squaring programs into one which identifies functions that halt. We will describe an algorithm which takes inputs "a" and "i" and determines whether program "a" halts when given input "i".

The algorithm is simple: we construct a new program "t" which (1) temporarily ignores its input while it tries to execute program "a" on input "i", and then, if that halts, (2) returns the square of its input. Clearly, "t" is a function for computing squares if and only if step (1) halts. Since we've assumed that we can infallibly identify program for computing squares, we can determine whether "t" is such a program, and therefore whether program "a" halts on input "i". Note that we needn't actually execute "t"; we need only decide whether it is a squaring program, and, by hypothesis, we know how to do this.

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.

Formal proof

For the formal proof, algorithms are presumed to define partial functions over strings and are themselves represented by strings. The partial function computed by the algorithm represented by a string "a" is denoted F"a". This proof proceeds by reductio ad absurdum: we assume that there is a non-trivial property that is decided by an algorithm, and then show that it follows that we can decide the halting problem, which is not possible, and therefore a contradiction.

Let us now assume that "P"("a") is an algorithm that decides some non-trivial property of F"a". Without loss ofgenerality we may assume that "P"("no-halt") = "no", with "no-halt" being the representation of an algorithm that never halts. If this is not true, then this will hold for the negation of the property. Since "P" decides a non-trivial property, it follows that there is a string "b" that represents an algorithm and "P"("b") = "yes". We can then define an algorithm "H"("a", "i") as follows:

:1. construct a string "t" that represents an algorithm "T"("j") such that :* "T" first simulates the computation of F"a"("i") :* then "T" simulates the computation of F"b"("j") and returns its result. :2. return "P"("t")

We can now show that "H" decides the halting problem:

* Assume that the algorithm represented by "a" halts on input "i". In this case F"t" = F"b" and, because "P"("b") = "yes" and the output of "P"("x") depends only on F"x", it follows that "P"("t") = "yes" and, therefore "H"("a", "i") = "yes".

* Assume that the algorithm represented by "a" does not halt on input "i". In this case F"t" = F"no-halt", i.e., the partial function that is never defined. Since "P"("no-halt") = "no" and the output of "P"("x") depends only on F"x", it follows that "P"("t") = "no" and, therefore "H"("a", "i") = "no".

Since the halting problem is known to be undecidable, this is a 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.

Rice's theorem and index sets

Rice's theorem can be succinctly stated in terms of index sets:

:

Let mathcal{C} be a class of partial recursive functions with index set C. Then C is recursive if and only if C is empty, or C is all of omega.

where omega is the set of natural numbers, including zero.

ee also

*Rice-Shapiro theorem
*Recursion theory

References

*Rice, H. G. " [http://links.jstor.org/sici?sici=0002-9947%28195303%2974%3A2%3C358%3ACORESA%3E2.0.CO%3B2-N| Classes of Recursively Enumerable Sets and Their Decision Problems] ." Trans. Amer. Math. Soc. 74, 358-366, 1953.

External links

*MathWorld|urlname=RicesTheorem|title=Rice's theorem


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Rice-Shapiro theorem — In computability theory, the Rice Shapiro theorem is a generalization of Rice s theorem, and is named after Henry Gordon Rice and Stewart Shapiro cite book | title=Theory of Recursive Functions and Effective Computability | author=Rogers Jr.,… …   Wikipedia

  • Rice (surname) — Rice is a surname that originated in Wales as an Anglicised transliteration of Rhys. The surname is also common in North East Ireland as an Anglicised contraction of the Irish Ó Maolchraoibhe (pron. O Mulcreevy), though the two sets of Rices are… …   Wikipedia

  • Arrow's impossibility theorem — In social choice theory, Arrow’s impossibility theorem, the General Possibility Theorem, or Arrow’s paradox, states that, when voters have three or more distinct alternatives (options), no voting system can convert the ranked preferences of… …   Wikipedia

  • Henry Gordon Rice — was a logician and mathematician best known as the author of Rice s theorem, which he proved in his doctoral dissertation of 1951 at Syracuse University.cite journal | journal = Transactions of the American Mathematical Society | first = H. G. |… …   Wikipedia

  • Central limit theorem — This figure demonstrates the central limit theorem. The sample means are generated using a random number generator, which draws numbers between 1 and 100 from a uniform probability distribution. It illustrates that increasing sample sizes result… …   Wikipedia

  • Bayes' theorem — In probability theory, Bayes theorem (often called Bayes law after Thomas Bayes) relates the conditional and marginal probabilities of two random events. It is often used to compute posterior probabilities given observations. For example, a… …   Wikipedia

  • Hobby-Rice theorem — In mathematics, and in particular the study of necklace splitting problems, the Hobby Rice theorem is a result that is useful in establishing the existence of certain solutions. The theoremIf g 1,ldots,g k: [0,1] longrightarrowBbb{R} are given… …   Wikipedia

  • Bellsches Theorem — Die Bellsche Ungleichung ist eine Schranke an Mittelwerte von Messwerten, die 1964 von John Bell angegeben wurde. Die Ungleichung gilt in allen physikalischen Theorien, die real und lokal sind und in denen man unabhängig vom zu vermessenden… …   Deutsch Wikipedia

  • Central limit theorem for directional statistics — In probability theory, the central limit theorem states conditions under which the mean of a sufficiently large number of independent random variables, each with finite mean and variance, will be approximately normally distributed.[1] Directional …   Wikipedia

  • Jackson's theorem (queueing theory) — Jackson s theorem is the first significant development in the theory of networks of queues. It assumes an open queueing network of single server queues with the following characteristics:* M = # of queues in the system, not counting queue 0 which …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”