Talk:Rice's theorem

message: (cur) (last) . . 21:59 8 Jun 2003 . . Rzach (The comments didn't make sense and the claims made (eg that it is decidable if an algorithm halts after 3 billion steps) were false)
:Isn't it decidable if an algorithm halts after 3 billion steps? Can't you test it by running it for 3 billion steps? كسيپ Cyp 22:05 8 Jun 2003 (UTC)
::It's decidable if the algorithm runs in less than 3 bn steps on a given input, but not if it runs in less than 3bn steps on all inputs.  Rice's Thm is about properties of partial functions not about algorithms, and even less about algorithms and inputs.  But I do see the problem with the statement of the theorem now: it's trivial propoerties of partial functions not of algorithms that are at issue Rzach 22:25 8 Jun 2003 (UTC)
:::If the set of possible inputs at each step is finite (and it is... you often input one bit at a time, i.e. two possibilities), then whether or not a program always halt after at most 3 billion steps is perfectly decidable from a computability point of view. Just run all 3 billion steps on all possible input strings (they are in finite number).
:::Of course, it's impossible in practice, but that's another problem. See model checking. David.Monniaux 16:48, 18 Nov 2004 (UTC)
thread_title:  comment by Cyp 

message: A recent addition to the page says:
:Another way of stating this problem that is more useful in computability theory is this: if there exists a Turing machine that has a certain property, and a Turing machine which does not have it, then the problem of taking a Turing machine and deciding whether it has that property is undecidable.
As stated, this is false.  Consider the property of having exactly 17 states.  Clearly Turing machines exist which do and which do not possess this property, and the property is obviously decidable.  This is why Rice's theorem is usually stated about the partial functions that the machines compute, or about the languages that they accept: it is only nontrivial behaviors that are undecidable.
I am about to remove this paragraph from the article until such time as the author chooses to repair it.  -- Dominus 13:50, 24 Sep 2004 (UTC)
replies: text: I'm sorry, I forgot the important condition the property be a property of the language recognized, rather than the machine (that is, any two machines recognizing the same language agree on the property.) Thanks for catching this. I wasn't watching this page, so that's why my response was unsuitably delayed. Derrick Coetzee 05:09, 31 Oct 2004 (UTC)
thread_title: Computability theory formulation

message: The page says:
:The algorithm is simple:  we construct a  new program t which (1) temporarily ignores its input while it tries to execute program a on input i, and then, if that halts, (2) returns the square of its input. Clearly,  t is a function for computing squares if and only if step (1) halts.
This is true for the squaring program, but say we were trying to decide if a given function never halts. Then, although t does compute the function if step (1) halts in this case, it still computes the function even if a doesn't!
I've been pondering how to fix it, but I'm not sure what way is best. One way is to separately prove it in the case where the function that never halts has the property, using the fact that we have a function available that doesn't have the property. I'm going to proceed with this approach. Derrick Coetzee 06:37, 31 Oct 2004 (UTC)
replies: text: Deciding whether "a given function never halts" is the same as deciding the halting problem, which is known to be undecidable, and thus does not constitute a hole in the proof. Even if it did, your addition seems to be original research and would require citation. -- Ben-Arba 05:56, 7 September 2007 (UTC)
thread_title:  Error in informal proof 

message: from which matematicians?
More significantly, isn't the Rice-Myhill-Shapiro theorem a different theorem, which states properties of computably enumerable functions, and hence provides a simple method to prove functions are not computably enumerable?  I think the reference to the R-M-S theorem should be omitted or completely rewritten.
:I did Google search for "rice-myhill-shapiro"; several of the top (non-Wikipedia) hits make clear that someone thinks that Rice's theorem is known by this name:
:*Notes from U Mass professor Arnold ROsenberg "The Rice-Myhill-Shapiro Theorem (One can say virtually nothing about the dynamic behavior of a program based only on its description..." 
:*NIST technical calendar "according to the Rice-Myhill-Shapiro Theorem, all non-trivial properties of functions are undecidable."
:But someone should probably come up with a reference that is known to predate Wikipedia.  -- Dominus 13:27, 18 November 2006 (UTC)
thread_title:  The Rice-Myhill-Shapiro theorem 

message: The article states:
:For example, asking whether a machine runs for more than 100 steps on some input, whether it has more than 5 states, or whether it ever moves its tape head to the left are all nontrivial but decidable properties.
However, the third example (whether the head ever moves to the left) is undecidable. If it were decidable, the halting problem would also be decidable. You can construct a Turing machine that emulates the behaviour of another machine exactly except that it only ever moves the head to the left of the initial starting square if the other machine halts. Then being able to decide if this machine ever moves to the left means you can decide if the emulated machine ever halts.
:I don't think your analysis is correct.  The question isn't whether a Turing machine moves its head to the left of the initial square---which I agree is undecidable---but whether it moves its head to the left at all.  Your proposed machine T that moves to the left of the initial square only of some other machine S halts can be constructed, but it can't be constructed in such a way that that left move is the only one it ever executes.    -- Dominus 13:40, 13 June 2006 (UTC)
replies: text: To see why, let M be a TM that simulates an arbitrary TM N by first reading the description of N and its input onto a work tape of M. Obviously this copying can be done moving the input tape head only to the right. If N halts, then M moves its input tape head once to the left and halts. Then this reduces the halting problem for N to the problem of asking whether M ever moves its input tape head to the left; i.e., this is undecidable. I have removed this claim from the main text. Perhaps you meant something like the question of whether any of the tape heads ever moves left, or whether the tape head on a one-tape TM ever moves left, which I believe are decidable. If this is what you meant and want to re-add it, I suggest stating precisely what you mean and adding justification for it. Pexatus 15:10, 26 October 2006 (UTC)
thread_title:  Undecidable Problems 

message: Neither this article, nor the article computable function adequately define the notion of what a "properpty of a computable function" is. In the informal discssion, this is somwhat vague, and a concrete example or two would help. (funny that counter-examples, of things that are not properites, are given). Next, in the formal definition section, it is implied that a "property of a computable function" is isomorphic to a "subset of all computable functions" -- but without a formal definition of a "property of a computable function", this is not quite clear. linas 00:06, 27 July 2006 (UTC)
thread_title:  property of a computable function 

message: The statement "It is important to note that Rice's theorem does not say anything about properties of machines, only of functions and languages." is literally wrong and I'm about to change it.
As an example that it is wrong, conside the following statement about Turing machines:  "No Turing machine can decide the general problem of whether another Turing machine will print the number '42' as its result."  This is both a true statement about machines and a consequence of Rice's Theorem.  Rice's Theorem in fact has lots of useful things to say about machines and programs, albeit indirectly.
The sentence as it stands uses a common standard rhetorical device, and in another context something like "I'm not talking about George, I'm talking about his cat." would not have to be restated as "I speak only of George insofar as he stands in his relationship of owner to his cat."
But in this context I think the sentence demands to be interpreted literally not rhetorically.  And its literal interpretation is wrong.
--Jeffreykegler (talk) 14:37, 14 May 2008 (UTC)
thread_title:  Rice's Theorem's Relevance to Machines and Programs 

message: Ok, I see.  You're using the constant functions as decision procedures.
But that's specifically excluded by the formulation of Rice's
Theorem.  Only "non-trivial" properties are subject to Rice's
Theorem.  "Trivial" in the Rice's context means always true or
always false -- in other words, having as their correct decision
procedure a constant function.
Perhaps the theorem is more clearly stated as a Game.  In Rice's
Game, Abelard is required to come up with a property of partial
functions (his choice) and a decision procedure.  Abelard's decision
procedure must accept an algorithm from his adversary, Eloise, as
input.  Abelard's decision procedure must return 0 or 1, according
to whether Eloise's algorithm computes a partial function with
Abelard's choice of property.  The rules forbid Abelard to submit
a constant function as his decision procedure.
Eloise wins if she can produce a specific example of an algorithm,
for which Abelard's decision procedure gives a wrong answer.  If
Eloise fails to do this, Abelard wins.
In Rice's game, Eloise always has a win.  She can take Abelard's
decision procedure and diagonalize it.  (I can give details of how
she does it, but the proofs in the article already do this.)
Yes, if Abelard were allowed his choice of property and either
constant function 0 or constant function 1 as his decision procedure,
Abelard could always win.  But Abelard is specifically forbidden
to do that.
The current article states: "for any non-trivial property of partial
functions, there exists at least one algorithm for which it is
undecidable whether the algorithm computes a partial function with
this property".  I believe that's correct and that the two proofs
in the article show that.  Eloise always has a win.
-Jeffreykegler (talk) 11:17, 27 October 2008 (UTC
:Changing to a game based description is a good idea. I completely understand Rice's theorem. My concern is with the literal wording of the sentence in the lede. The formal statement saying that Eloise has a guaranteed win is: "for any decision procedure that Abelard produces, Elosie can find some algorithm that causes it to give the incorrect answer."  In particular, Abelard plays first and Eloise plays second.
:The article incorrectly claims that Eloise can produce a single algorithm that will always let her win no matter what procedure Abelard comes up with. In other words, it claims that Eloise can win when playing first. Clearly, if Eloise plays first, then Abelard has the possibility of making Eloise lose, if he happens to guess the correct constant function as a decision procedure. Thus Eloise cannot guarantee a win if she is forced to play first.
:But the article currently says: "for any non-trivial property of partial functions, there exists at least one algorithm for which it is undecidable whether the algorithm computes a partial function with this property."  In other words, it says there is a single algorithm that Eloise can always play to win. It should say "for any non-trivial property of partial functions, there is no decision procedure that correctly tells whether arbitrary programs compute a function with that property." In other words, the sentence needs to actually mention Abelard's move, and make sure it is put in the correct order in the game. — Carl (CBM · talk) 13:09, 27 October 2008 (UTC)
replies: text: I like the phrase "any algorithm whatsoever", it removes the various possible interpretations of "in general".  Otherwise either form is ok with me (although the second is probably too personalized). Derek farn (talk) 18:38, 27 October 2008 (UTC)
replies: text: Re Jeff, the text I had put in the article before was "for any non-trivial property of partial functions, there is no effective method to decide whether a given algorithm computes a partial function with that property." You suggest "for every non-trivial property of partial functions, there is no procedure that can, in general, decide correctly whether an algorithm computes a function with that property." Either is fine with me. Re Derek: adding an extra word like "whatsoever" or "arbitrary" in front of "algorithm" is also fine with me. — Carl (CBM · talk) 19:17, 27 October 2008 (UTC)

text: OK, that sounds good. I copied that to the article. The first sentence seemed too long so I moved the bibliographic info to a later sentence. Also, I noticed the Rice-Shapiro theorem article claimed Stewart Shapiro instead of Norman Shapiro. Stewart was not born until 1951, and Rogers (1967) references "N. Shapiro", at which time Stewart would have been 16 years old... — Carl (CBM · talk) 21:05, 27 October 2008 (UTC)
thread_title:  Rice's Game 

message: I removed the following:
:On the other hand, the statement that "No modern general-purpose computer can solve the general problem of determining whether or not a program is virus free" is a consequence of Rice's Theorem because, while a statement about computers, it can be reduced to a statement about languages. 
:(Unfortunately, outside formal computer science, this consequence has been misunderstood as implying that no algorithm can reject all virus-containing programs: This property is vacuously true of an algorithm that rejects all programs, and is known to be true of algorithms that, for all computations of practical interest, will accept some programs that perform that computation.)
It lacked verification, but more importantly, Rice's theorem is not applicable to the question as stated.
A program for a pure Turing machine cannot be a virus, because all it does is take data as input and give data as output. It can only act as a virus if you then execute (some part of) its output. In other words, the concept of a virus is not applicable to a pure computation model such as a Turing machine model; it only makes sense in an interactive computation model that includes I/O [for example, reading and writing to a filesystem that is accessible to other programs].
Of course, Rice's Theorem applies to any pure computation done by some subprogram. This means, for instance, that if a program is running in an environment where whether it acts as a virus (for any definition of what a virus is) depends in some nontrivial way on its behaviour, then a checker working on its code cannot in general decide whether or not it will have that behaviour. Perhaps that is what the statement intended to say.
OTOH, that's a rather vacuous application of Rice's theorem that doesn't really shed any light on anything. In particular, it doesn't shed any light on the possibility of solving the problem of viruses in practice. To do that, you need to run programs in an environment where the program doesn't have the authority to do any harm. That can be enforced without having to decide any nontrivial properties of its computational behaviour. --David-Sarah Hopwood ⚥ (talk) 05:17, 18 December 2010 (UTC)
thread_title:  Applicability to virus checking 

message: Where did j in formal proof and the picture next to it came from? Pitel (talk) 09:58, 29 January 2012 (UTC)
replies: text: It is the input to algorithm T in the proof. This algorithm is generated dynamically by H during its execution. — Carl (CBM · talk) 12:51, 29 January 2012 (UTC)
thread_title:  Variable ''j'' 

message: I don't see how committing array bounds errors is a semantical property. While I don't know how to define such errors for a Turing machine, informally, it seems to me like for every program with an implementation that doesn't violate array bounds, there is always another implementation of the same program that does: Violate one in the beginning, then execute the original implementation. Of course, this assumes that the execution continues after a violation — but if it doesn't, the example is just a horribly misleading word game and restatement of the halting problem itself, rather than a noteworthy application of Rice's theorem.
109.44.0.4 (talk) 18:24, 14 October 2017 (UTC)
thread_title:  Array bound errors are a bad example of applications of Rice's theorem