06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

“mcs” — 2017/3/3 — 11:21 — page 274 — #282<br />

274<br />

Chapter 8<br />

Infinite Sets<br />

Let’s begin by showing how we could use a recognizer <strong>for</strong> No-halt- to define a<br />

recognizer <strong>for</strong> No-halt. That is, we will “reduce” the weird problem of recognizing<br />

No-halt to the more understandable problem of recognizing No-halt-. Since there<br />

is no recognizer <strong>for</strong> No-halt, it follows that there can’t be one <strong>for</strong> No-halt- either.<br />

Here’s how this reduction would work: suppose we want to recognize when a<br />

given string s is in No-halt. Revise s to be the declaration of a slightly modified<br />

procedure P s 0 which behaves as follows:<br />

P s 0 applied to argument t 2 ASCII , ignores t, and simulates P s applied<br />

to s.<br />

So, if P s applied to s halts, then P s 0 halts on every string it is applied to, and if P s<br />

applied to s does not halt, then P s 0 does not halt on any string it is applied to. That<br />

is,<br />

s 2 No-halt IMPLIES lang.P s 0/ D ;<br />

IMPLIES … lang.P s 0/<br />

IMPLIES s 0 2 No-halt-;<br />

s … No-halt IMPLIES lang.P s 0/ D ASCII <br />

IMPLIES 2 lang.P s 0/<br />

IMPLIES s 0 … No-halt-:<br />

In short,<br />

s 2 No-halt IFF s 0 2 No-halt-:<br />

So to recognize when s 2 No-halt all you need to do is recognize when s 0 2<br />

No-halt-. As already noted above (but we know that remark got by several students,<br />

so we’re repeating the explanation), this means that if No-halt- was recognizable,<br />

then No-halt would be as well. Since we know that No-halt is unrecognizable, then<br />

No-halt- must also be unrecognizable, as claimed.<br />

(a) Conclude that Finite-halt is unrecognizable.<br />

Hint: Same s 0 .<br />

Next, let’s see how a reduction of No-halt to Always-halt would work. Suppose we<br />

want to recognize when a given string s is in No-halt. Revise s to be the declaration<br />

of a slightly modified procedure P s 00 which behaves as follows:<br />

When P s 00 is applied to argument t 2 ASCII , it simulates P s applied<br />

to s <strong>for</strong> up to jtj “steps” (executions of individual machine instructions).<br />

If P s applied to s has not halted in jtj steps, then the application<br />

of P s 00 to t halts. If P s applied to s has halted within jtj steps, then the<br />

application of P s 00 to t runs <strong>for</strong>ever.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!