|
|
Tuesday, September 26
At the request of one of the students we went over the proof in the book that REGULARTM is undecidable. We took quite a bit of time to review the notation and to be sure that we understood what the proof said and why it was right. This is a tricky proof, because to show that we cannot decide in general whether an encoded TM recognizes a regular language or not, we need to show that a known undecidable problem can be reduced to REGULARTM. ATM is used for this purpose. So, we somehow need to reduce ATM to REGULARTM. The way this is done is, as usual, to first suppose that a solution exists to REGULARTM, a TM we call R. We then build new TM based on R that decides ATM. That is, a solution to REGULARTM would give us a solution to ATM. Since ATM is undecidable, though, that means that a solution to REGULARTM cannot exist. The solution TM S we build for ATM based on R must process input strings <M,w> and accept such strings if M would accept w and reject strings if M would not accept w. To show how R could be used to help decide ATM, we must build a new TM M' from the input M such that M' decides a nonregular language if M would not accept w, and M' decides a regular language if M would accept w. Notice that at the time M' is being built, M and w are constants. That is, we build M' based on M accepting the fixed input w, not M accepting an arbitrary w. So, we build M' to first look at whatever string x is on the tape given to it. If x has the form 0n1n, M' accepts this string. Otherwise, M' acts like M on w (the fixed input M on the fixed input w, not M on x). The accept state of M is modified to be the accept state of M'. That is, if M accepts w, M' accepts x. What if M would never halt w? No problem, because then M' only accepts strings of the form 0n1n, a non-regular language. What if M would accept w? Then M' accepts any x given to it, so it recognizes a regular language. This construction of M' is easily possible. Since M' is given in encoded form, the construction part of S just builds a new TM that checks a string to see whether it has the form 0n1n. This is easy, because this is just a constant part that S has to put into any new M' it builds for each M and w that comes in as input. S melds this part with the input M and w, so that M's accept state becomes the accept state in the constructed M'. Note that S is constructing M' on S's tape. At the end of the construction, S ensures that only the encoding of the new M' (<M'>) is on the tape. At that time, S calls the mythical R to run on the input tape, which now contains <M'>. R can tell us whether M' recognize a regular language or not. But M' was constructed to recognize a regular language iff the input M would accept the input w. Hence, S is a decider for ATM. Since the construction of M' is all possible given M and w, the only fallacy with S is that the R portion cannot exist. That is, there is no decider for REGULARTM. |