Research Library · Idea
Rice's theorem
Rice's theorem says that no algorithm can decide a non-trivial property of the function that a program computes. A program computes a partial function, which gives outputs on some inputs and is undefined on others. A property is semantic, or extensional, when it depends only on that function, so two programs computing the same function either both have it or both lack it. It is non-trivial when some program has it and some does not. Whether the function is defined on a given input, and whether two programs compute the same function, are examples.
H. G. Rice's 1953 paper states the result for classes of recursively enumerable (r.e.) sets of non-negative integers, where a partial recursive function enumerates a set as the range of its values.1 He calls a class completely recursive, which he says may be intuitively interpreted as decidability, and describes as his most interesting result "the fact that no nontrivial class is completely recursive".1 The trivial classes are the class of all r.e. sets and the empty class.1 His own reading is that if a property is possessed by some but not all r.e. sets, then "there exists no effective general method for deciding", given a partial recursive function enumerating a set, whether the set has the property. He adds that special methods will exist for particular functions.1
The usual modern proof is a reduction from the halting problem. Cook's Clay Institute description records the tool: if the halting set reduces to a language by a computable many-one reduction, the language is undecidable.2 For a non-trivial semantic property, one builds from a machine M and an input x a program that first runs M on x and then behaves like a program known to have the property. The new program has the property exactly when M halts on x, so a decider for the property would decide halting.
The theorem concerns properties of the computed function. A property of how a program runs, such as which memory it writes, is not covered directly, because two programs can compute the same function and differ in those respects. A property that can be read from the program text is decidable. The theorem does not rule out analysing a particular program, which is Rice's remark about special methods, or answering with a possible "unknown".
Source · Classes of Recursively Enumerable Sets and Their Decision Problems (opens in a new tab) · Transactions of the American Mathematical Society
References
- Classes of Recursively Enumerable Sets and Their Decision Problems (opens in a new tab) · Transactions of the American Mathematical Society (author: H. G. Rice) · H. G. Rice, 1953, Trans. Amer. Math. Soc. 74, pp. 358-366, DOI 10.1090/S0002-9947-1953-0053041-6; Internet Archive copy of the AMS PDF. ↩ ↩ ↩ ↩
- The P versus NP Problem (opens in a new tab) · Clay Mathematics Institute · Stephen Cook's official problem description; section on the Halting Problem and many-one reducibility. ↩
Research articles
- What computers cannot do, and what they cannot do quickly: computability and complexity from Turing to P versus NP · Computer science
See what connects to it on the map of ideas →

SecSIG