Difference between Decidable, Semi-decidable and Undecidable problems

The Halting problem (aka HALT) can be defined as follows:
You are given as input the code of some Turing machine T, and some input A for T to work with. You are asked to determine whether the execution of T on A will enter an endless loop.

For some combinations of T,A, the only thing you can do is essentially equivalent to simulating the execution of T on A, and waiting. If you happened to stop, then you know the answer is 'Yes'. If you haven't stopped yet, you cannot know whether you are going to stop at some future point or not.

The halting problem is semi-decidable, because if you keep simulating forever on every T,A combination, you are assured to always say 'Yes' eventually on input that halts, and always run forever on code that does not.

However, for the sake of this discussion, let's say I also had a magical Turing machine, M, that does the opposite. Using some form of physics-defying magic, when you run M on the input T, A, M is guaranteed to stop if the execution of T on A does not halt, and it enters into a loop otherwise. (Logically, the assumption that the complement of HALT is semi-decidable is equivalent to the existence of M. In reality, this M does not exist.).

What does this mean about the halting problem? If you give me some pair T, A, it is now possible to do the following:
Define a new Turing machine, S, that takes turns between using the simulation-based Turing machine for the halting problem, and M for its complement. Let's say that M gets simulated for a single step once for every two time-steps.

If T, A halts, then the simulator TM will always stop and say "Yes" after a finite amount of time. If T, A does not halt, then M will always stop and say "Yes" after a finite amount of time; we just turn that "Yes" into a "No".
We are now guaranteed to stop on all possible input, and to always be correct.
Therefore, if M exists, then HALT is decidable.

I hope this helps.

/r/AskComputerScience Thread