@mercio: LeakyNun is right that my post does not address his version, so I'll present a short proof of the general undecidability theorem now.
We say that P is a behavioural property iff ( for every programs x,y that have the same output behaviour (same output or both do not halt) we have P(x) ⇔ P(y) ).
For example, halting on empty input is a behavioural property.
Take any behavioural property P such that there are programs t,f satisfying P(t) and ¬P(f). Then the undecidability theorem states that there is no program that can decide P.
The proof is quite easy actually. Given any program D that decides P, we can construct the program S = ( x ↦ D( y ↦ x(x)(y) ) ? f : t ).
Where the ( q ? u : v ) is standard C/Java meaning ( if q then u otherwise v ).
@mercio @LeakyNun: Do you get what I have defined S to be?
S takes input x, runs D on the program ( y ↦ x(x)(y) ) which is symbolically constructed, and then returns either f or t based on D's answer.
@LeakyNun All programs take input. This undecidability theorem applies to any behavioural property that may depend on what the program does on various inputs.
( y ↦ x(x)(y) ) is a program that takes input y and runs x on x and then the result on y. Such a program can be constructed programmatically from the code of x.
Take any behavioural property P such that there are programs t,f satisfying P(t) and ¬P(f). Then the undecidability theorem states that there is no program that can decide P.