Behavioral (semantic) property = a property of the languageL(M) — the set of strings the
machine accepts. Example: "does M accept the empty string?", "is L(M) infinite?", "is
L(M)=∅?".
Structural (syntactic) property = a property of the machine description itself, not of what
it computes. Example: "does M have 7 states?", "does M ever write a blank?". These are often
decidable and Rice says nothing about them.
Setup. Let P be non-trivial. We use the undecidable language
ATM={⟨M,w⟩:M accepts w}.
Step 1 — Pick a baseline. WLOG assume ∅∈/P (the empty language does not have
the property).
Why this step? If ∅∈P instead, just prove undecidability for the complement
property Pˉ; deciding P would decide Pˉ, so it's symmetric. So we lose nothing.
Step 2 — Grab a witness. Since P is non-trivial and ∅∈/P, there exists some
language L(MP)∈P with a machine MP recognizing it.
Why this step? Non-triviality guarantees at least one "yes" example. We need a target language
that does have the property to switch into.
Step 3 — The gadget. Given input ⟨M,w⟩, build a new machine GM,w that on
input x does:
Ignore x for now. First run M on w (simulate).
If M accepts w, then run MP on x and accept iff MP accepts x.
Why this step? This is the heart. Trace the two worlds:
If Macceptsw: step 1 finishes, so GM,w behaves exactly like MP, hence
L(GM,w)=L(MP)∈P.
If Mdoes not acceptw: step 1 never finishes, GM,w never reaches step 2, accepts
nothing, so L(GM,w)=∅∈/P.
So:
L(GM,w)∈P⟺M accepts w.
Step 4 — Contradiction. Suppose a decider R for LP exists. Feed it ⟨GM,w⟩:
R says "yes" ⟺L(GM,w)∈P⟺M accepts w. That decides ATM — impossible.
Therefore LP is undecidable. ■
Imagine you have a magic box that runs other little robot-programs. You want a checker-machine that
reads a robot's instruction sheet and tells you "this robot will eventually say the word cat."
Rice's theorem says: no such perfect checker can exist for any interesting "what will it
eventually do" question. The only questions you can always answer are the boring ones where the
answer is the same for every robot ("yes, always" or "no, never"). The reason: to check the
robot, your checker would secretly have to know whether the robot ever stops — and we already
proved nobody can know that in general.
Dekho, Rice's theorem ka core idea bahut simple hai: agar koi property language ke baare mein hai —
yaani "machine M kya kya strings accept karti hai" ke baare mein — aur woh property non-trivial hai
(matlab kuch languages mein woh hoti hai aur kuch mein nahi), toh us property ko decide karna
impossible hai. Sirf trivial questions ("har machine ke liye haan" ya "har machine ke liye naa")
decidable hote hain, baaki sab undecidable.
Yeh kyu important hai? Kyunki yeh Halting Problem ka bada bhai hai. Halting ek single behavioral
question tha; Rice bolta hai ki saare interesting behavioral questions utne hi mushkil hain. Toh
exam mein agar poochha jaye "kya L(M) regular hai?" ya "kya L(M) empty hai?" — aap turant bol sakte
ho undecidable, bas non-triviality check karke (ek YES example, ek NO example dikhao). Pura reduction
dobara likhne ki zaroorat nahi.
Proof ka jugaad samajh lo: hum ek naya gadget machine GM,w banate hain jo pehle M ko w par
chalata hai, aur tabhi aage badhta hai jab M accept kare. Agar M accept karta hai toh G ki
language witness wali language ban jaati hai (property hai); agar nahi toh G kuch accept hi nahi
karta, language khali ho jaati hai (property nahi). Isse property ka answer Halting ka answer ban
jaata hai — aur Halting decide nahi ho sakta, toh property bhi nahi.
Ek important warning: Rice sirf semantic (language wali) properties par lagta hai. "Machine mein
kitne states hain?" jaise syntactic sawaal decidable hote hain — wahan Rice mat lagao, warna galat
ho jaoge.