3 ms·
Yeah there are plenty of programs where you can tell whether they terminate or not. The proof that the halting problem is decidable has a self referential compo
by est31 6y ago
Yeah there are plenty of programs where you can tell whether they terminate or not. The proof that the halting problem is decidable has a self referential component and most programs aren't self referential like this, nor do they make any library calls to halting problem deciders :). I think it's OK to do this simlification in a simple post like this, but important to keep in mind that it's a simplification.
To make it more concrete, if you take a bunch of heuristics like scanning for while(true) {}, scanning whether there are any loops at all, discarding primitive foreach loops that have a linear relationship to the input data amount, etc, you have built a rudimentary halting problem decider that has 3 outputs: "will halt", "won't halt", "I don't know". You can make it better with lots of research, SAT3 solvers, etc, but ultimately you will have to accept that there will always be programs that the decider will output "I don't know" for.
- opnitro 6y agoIndeed. Languages like idris have the `total` keyword that runs a halting checker on functions. Of course, as you mentioned, there are functions that might halt that it can't figure out. But it's pretty darn good.
- 3pt14159 6y agoThe proof that Turing gave never really left me fully convinced. Surely if the Romans had "the answer that denies the former" then clearly some version of it is possible in software.
- arc0 6y agoWhat part of Turing's proof do you find unconvincing?
- andi999 6y agoBut you can have easy examples like does the decimal reprensentation of pi contain four zeros in a row. I think we dont know if it is true, so you wouldnt know if your algo stops if you dont run it (and it stops). No need for self referential programs.