<p>Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use.</p>

<p>In cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based around this challenge.</p>

<p>I also have seen microsoft's terminator project -  <a href="http://research.microsoft.com/Terminator/" rel="noreferrer">http://research.microsoft.com/Terminator/</a> </p>

<p>Which leads me to ask - is the halting problem overrated - do we need to worry about the general case?</p>

<p>Will types become turing complete over time - dependant types do seem like a good development?</p>

<p>Or, to look the other way, will we begin to use non turing complete languages to gain the benefits of static analysis ?</p>

[{'answer_id': 40765, 'author': 'pkaeding', 'author_id': 4257, 'author_profile': 'https://Stackoverflow.com/users/4257', 'pm_score': 0, 'selected': False, 'text': '<p>The Halting Problem is really only interesting if you look at it in the general case, since if the Halting problem were decidable, all other undecidable problems would also be decidable via reduction.</p>\n\n<p>So, my opinion on this question is, no, it is not easy in the cases that matter.  That said, in the real world, it may not be such a big deal.</p>\n\n<p>See also: <a href="http://en.wikipedia.org/wiki/Halting_problem#Importance_and_consequences" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Halting_problem#Importance_and_consequences</a></p>\n'}, {'answer_id': 40772, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>As a day-to-day programmer, I\'d say it\'s worthwhile to continue as far down the <em>path</em> to solving halting-style problems, even if you only approach that limit and never reach it. As you pointed out, virus scanning proves valuable. Google search doesn\'t pretend to be the absolute answer to "find me the best X for Y," but it\'s also notably useful. If I unleash a novel virus (muwahaha), does that create a bigger solution set, or just cast light on an existing problem area? Regardless of the technical difference, some will pragmatically develop and charge for follow-up "detection and removal" services.</p>\n\n<p>I look forward to real <em>scientific</em> answers for your other questions...</p>\n'}, {'answer_id': 40777, 'author': 'DrPizza', 'author_id': 2131, 'author_profile': 'https://Stackoverflow.com/users/2131', 'pm_score': 4, 'selected': False, 'text': '<blockquote>\n  <p>Is solving the halting problem easier than people think?</p>\n</blockquote>\n\n<p>I think it is exactly as difficult as people think.</p>\n\n<blockquote>\n  <p>Will types become turing complete over time?</p>\n</blockquote>\n\n<p><a href="http://en.wikipedia.org/wiki/C%2B%2B#Templates" rel="noreferrer">My dear, they already are!</a></p>\n\n<blockquote>\n  <p>dependant types do seem like a good development?</p>\n</blockquote>\n\n<p>Very much so.</p>\n\n<p>I think there could be a growth in non-Turing complete-but-provable languages.  For quite some time, SQL was in this category (it isn\'t any more), but this didn\'t really diminish its utility. There is certainly a place for such systems, I think.</p>\n'}, {'answer_id': 40795, 'author': 'DrPizza', 'author_id': 2131, 'author_profile': 'https://Stackoverflow.com/users/2131', 'pm_score': 0, 'selected': False, 'text': "<p>Incidentally, I think that the Turing completeness of templates shows that halting is overrated. Most languages guarantee that their compilers will halt; not so C++. Does this diminish C++ as a language?  I don't think so; it has many flaws, but compiles that don't always halt aren't one of them.</p>\n"}, {'answer_id': 40813, 'author': 'mweerden', 'author_id': 4285, 'author_profile': 'https://Stackoverflow.com/users/4285', 'pm_score': 0, 'selected': False, 'text': "<p>I don't know how hard people think it is, so I can't say if it is easier. However, you are right in your observation that undecidability of a problem (in general) does not mean that all instances of that problem are undecidable. For instance, I can easily tell you that a program like <code>while false do something</code> terminates (assuming the obvious semantics of the while and false).</p>\n\n<p>Projects like the Terminator project you mentioned obviously exist (and probably even work in some cases), so it is clear that not all is hopeless. There is also a contest (I believe every year) for tools that try to prove termination for rewrite systems, which are basically a model of computation. But it is the case that termination in many cases is very hard to prove.</p>\n\n<p>The easiest way to look at it is perhaps to see the undecidability as a maximum on the complexity of instantiations of a problem. Each instantiation is somewhere on the scale of trivial to this maximum and with a higher maximum you typically have that the instantiations are harder on average as well.</p>\n"}, {'answer_id': 518580, 'author': 'joeforker', 'author_id': 36330, 'author_profile': 'https://Stackoverflow.com/users/36330', 'pm_score': 2, 'selected': False, 'text': '<p>There are plenty of programs for which the halting problem can be solved and plenty of those programs are useful.</p>\n\n<p>If you had a compiler that would tell you "Halts", "Doesn\'t halt", or "Don\'t know" then it could tell you which part of the program caused the "Halt" or "Don\'t know" condition. If you really wanted a program that definitely halted or didn\'t halt then you\'d fix those "don\'t know" units in much the same way we get rid of compiler warnings. I think we would all be surprised at how often trying to solve this generally-impossible problem proved useful.</p>\n'}, {'answer_id': 928112, 'author': 'Michael Dorfman', 'author_id': 6741, 'author_profile': 'https://Stackoverflow.com/users/6741', 'pm_score': 4, 'selected': False, 'text': '<p>Wow, this is one confused question.</p>\n\n<p>First: The Halting Problem is not a "problem" in a practical sense, as in "a problem that needs to be solved."  It is rather a statement about the nature of mathematics, analogous to Gödel\'s Incompleteness Theorem.</p>\n\n<p>Second: The fact that building a perfect virus scanner is intractable (due to its being equivalent to the Halting Problem) is precisely the reason that there is "an entire industry built around this challenge."  If an algorithm for perfect virus scanning could be designed, it would simply be a matter of someone doing it once, and then there\'s no need for an industry any more.  Story over.</p>\n\n<p>Third: Working in a Turing Complete language does not eliminate "the benefits of static analysis"-- it merely means that there are limits to the static analysis.  That\'s ok-- there are limits to almost everything we do, anyway.</p>\n\n<p>Finally: If the Halting Problem could be "solved" in any way, it would definitely be "easier than people think", as Turing demonstrated that it is unsolvable.  The general case is the only relevant case, from a mathematical standpoint.  Specific cases are matters of engineering.</p>\n'}, {'answer_id': 42131946, 'author': 'Andrea Asperti', 'author_id': 7439915, 'author_profile': 'https://Stackoverflow.com/users/7439915', 'pm_score': 0, 'selected': False, 'text': '<p>The fact that a problem is undecidable does not mean that it is not interesting: on the contrary! So yes, the fact that we do not have an effective and uniform procedure to address termination for <em>all</em> programs (as well as many other problems about software) does not mean that it is not worth to look for partial solutions. In a sense, this is why we need software engineering: because we cannot just delegate the task to computers.</p>\n\n<p>The title of your question is, however, a bit misleading. I agree with DrPizza: the termination problem is exactly as difficult as people think. \nMoreover, the fact that we do not necessarily have to worry with the general case does not imply that the termination problem is overrated: it is worth to look for partial solutions <em>beacuse</em> we know that the general solution is hard.</p>\n\n<p>Finally, the issues about dependent types and subrecursive languages, although partially related, are really different questions, and I am not sure to see the point to mix them all together.</p>\n'}]
['https://Stackoverflow.com/questions/40716', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4319/']