1

When the halting problem is discussed, often the counterproof consists of some unsolved mathematical problem or a self-reference.

Is the halting problem decidable for pure programs on an ideal computer?

Is this of any relevance for most programms not even remotely dealing with complex math ? I often hear that performing static analysis on any program is useless, because "Halting-problem". I find this argument weak, to make a statement from a few theoretical counter examples to say that static analysis on any programm is useless.

And what about a modified version of the halting problem?

What about outputting those 3 possibilities:

Halts. Does not halt. Unknown.

Doesn't this simplify the halting problem enough to make a statement about any program in finite time ?

1 Answers1

4

When you hear about "static analysis" in the context of programming languages, you will often have the three results "passes the test", "doesn't pass the test", "is rejected". In that context, the analysis is supposed to help the software developer. If the developer writes code that is too hard to analyse, that's the developer's problem because he isn't going to get the answer he wants.

As an example, the Java language insists that a variable must be assigned a value before it is accessed. Testing that in general would require solving the halting problem. However, the Java language defines a precise method how it would go about verifying this property, and if your program cannot be analysed by this method, then it is rejected. No attempt at solving the halting problem is made.

gnasher729
  • 32,238
  • 36
  • 56