The set of all possible inputs for a compiler is infinite, too. Does that mean that compilers are all harangued by the halting problem as well? Nope. Having an infinite number of possible inputs (infinite input set size) does not prevent you from showing that a program can actually halt. I think most compilers are written in a way that can be shown to halt, as well.The Halting Problem does apply in the general case, but if you carve up your programs and reason about them, you can still show that you can have a halter. The Halting Problem just states that there does not exist a method that will take an arbitrary program and show it to be a halter.
burgerbrain|15 years ago
No, because unlike this "try all possible inputs" plan for decompilers, compilers only operate on any particular single input.
"I think most compilers are written in a way that can be shown to halt, as well."
Not C++ compilers (Turing Complete macros) or Lisp dialects (same issue, but even moreso)
grav1tas|15 years ago
peti|15 years ago
The parent comment's suggestion was: (1) for each possible input program, (1.a) compile it, and (1.b) check if the result equals the given compiled code.
Agreed, steps (1.a) and (1.b) terminate deterministically (for a given compiler).
However, the search space for this search procedure is infinite.
Similarly, it would be impossible, in general, to exhaustively test every possible input of a compiler.
shasta|15 years ago