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 ?

  • $\begingroup$ You ask multiple questions here, which is no good for the platform. Which is the one you want us to answer? $\endgroup$
    – Raphael
    Commented Sep 13, 2016 at 8:53
  • $\begingroup$ "Is this of any relevance for most programms not even remotely dealing with complex math ?" -- Many very simple functions are not computable. Many very simple programs (don't) have very simple properties that can not be decided. $\endgroup$
    – Raphael
    Commented Sep 13, 2016 at 8:54
  • $\begingroup$ Your modified version is simple. "Unknown" for every problem. $\endgroup$
    – gnasher729
    Commented Sep 13, 2016 at 11:51
  • $\begingroup$ Well, but in practice you can mark every known solved problem as one of the other ones and then decide for your programm if it will halt in general or not. $\endgroup$ Commented Sep 13, 2016 at 11:52
  • 1
    $\begingroup$ There's a tool competition for static analysis of termination of programs, which includes categories for C and Java Bytecode termination. The short answer is that (like every other static analysis) such tools can perform well on relatively small programs which do not use complex heap manipulation. $\endgroup$
    – cody
    Commented Sep 14, 2016 at 18:02

1 Answer 1


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.


Not the answer you're looking for? Browse other questions tagged or ask your own question.