Sub topic 3
Rice's theorem and non-trivial properties
This chapter assumes you know regular languages, context-free grammars (CFGs), the halting problem, and many-one reductions. Rice's theorem gives a fast way to show that a property of a Turing machine's language is undecidable.
Rice's theorem
A property of recursively enumerable (RE) languages is a set of languages. The property is trivial if every RE language has it, or if none does. Rice's theorem states that every non-trivial semantic property is undecidable. A semantic property concerns the language L(M), not the machine's text.
Proof idea
Pick a language in the property and one outside it. Reduce the halting problem to the property question by building a machine that accepts the chosen language only when the input machine halts on its own description.
Rice's theorem does not cover syntactic questions. "Does M have 5 states?" is decidable because you can read the description.
The Post Correspondence Problem
The Post Correspondence Problem (PCP) gives a list of tiles, each with a top and bottom string. The question asks whether some nonempty sequence of tiles makes the top and bottom strings equal. PCP is undecidable, and reductions from it prove that questions such as CFG ambiguity and emptiness of the intersection of two CFLs are undecidable.
| Tile | Top | Bottom |
|---|---|---|
| 1 | a | ab |
| 2 | b | ca |
| 3 | ca | a |
| 4 | abc | c |
The sequence 1, 2, 3, 1, 4 is a match: both strings read abcaaabc.
Chomsky hierarchy and the machine for each level
| Type | Language class | Machine | Membership |
|---|---|---|---|
| 3 | Regular | Finite automaton | Decidable |
| 2 | Context-free | Pushdown automaton | Decidable |
| 1 | Context-sensitive | Linear bounded automaton | Decidable |
| 0 | Recursively enumerable | Turing machine | Semi-decidable |
Decidable and undecidable problems across language classes
- Regular: emptiness, membership, equivalence and universality are decidable.
- Context-free: membership, emptiness and finiteness are decidable. Equivalence, universality, ambiguity and intersection emptiness are undecidable.
- Recursively enumerable: emptiness, equivalence and finiteness are undecidable.
GATE patterns: a checklist for decidability questions
- Does the property concern the language L(M)? If it is non-trivial, Rice's theorem makes it undecidable.
- Does it concern only the machine's description or size? It is usually decidable.
- Is the question about a fixed string? Membership for a recursive language is decidable.
- Recall closure: RE languages are closed under union and intersection, but not complement.
- Match the language class against the table above.
Exercise
Is the question "Is L(M) finite?" decidable for a Turing machine M?
Show answer
No. Finiteness is a non-trivial property of the language L(M), so Rice's theorem makes it undecidable.