TheoremComplete

Rice's Theorem

Rice's theorem is a sweeping generalization of the undecidability of the halting problem: any nontrivial semantic property of Turing machines is undecidable. This result has profound implications for program verification.


Statement

Theorem5.2Rice's Theorem

Let PP be a property of computably enumerable sets (i.e., PβŠ†{We:e∈N}P \subseteq \{W_e : e \in \mathbb{N}\}). If PP is nontrivial (neither empty nor the set of all c.e. sets), then the index set {e:We∈P}\{e : W_e \in P\} is undecidable.

Proof

Without loss of generality, assume βˆ…βˆ‰P\emptyset \notin P (otherwise consider PΛ‰\bar{P}). Let Wa∈PW_a \in P for some aa. We reduce the halting problem KK to {e:We∈P}\{e : W_e \in P\}.

Given ee, construct a Turing machine MeM_e that on input xx: first simulates machine ee on input ee; if it halts, then simulates machine aa on input xx.

If e∈Ke \in K (machine ee halts on ee), then WMe=Wa∈PW_{M_e} = W_a \in P. If eβˆ‰Ke \notin K, then WMe=βˆ…βˆ‰PW_{M_e} = \emptyset \notin P. Thus e∈Kβ€…β€ŠβŸΊβ€…β€ŠMe∈{e:We∈P}e \in K \iff M_e \in \{e : W_e \in P\}, so K≀m{e:We∈P}K \leq_m \{e : W_e \in P\}. Since KK is undecidable, so is {e:We∈P}\{e : W_e \in P\}. β–‘\square

β– 

Applications

ExampleConcrete Undecidable Properties

The following are undecidable by Rice's theorem:

  • "Does Turing machine MM accept the empty string?"
  • "Is the language of MM regular? Context-free? Finite? Infinite?"
  • "Does MM compute the identity function?"
  • "Is We=NW_e = \mathbb{N}?"

Each is a nontrivial property of the c.e. set WeW_e, hence undecidable.

RemarkLimitations of Rice's Theorem

Rice's theorem applies only to extensional (semantic) properties of programs β€” properties that depend only on the function computed, not on the program's syntax. Intensional (syntactic) properties, such as "does the program have fewer than 100 instructions" or "does the program contain a specific subroutine," may or may not be decidable and are not covered by Rice's theorem.