[Math] Can turing machine solve halting problem on a pushdown automaton

pushdown-automataturing-machines

I meant, given a turing machine, judge whether a pushdown automaton will halt.

Pushdown automaton: a finite state machine with a stack

If so, is there any unsolvable problem weaker than halting problem?

Best Answer

Yes, the halting problem for PDAs is decideable. The current snapshot of a PDA is determined by: the unread symbols in the input, the state of the deterministic control, the symbol on top of the stack.

Here's a two-tape TM that decides whether a PDA $P$ will halt on input $x$:

  1. The input $x$ is written on the first tape.

  2. The machine simulates the PDA using the first tape for storage. In particular, the first tape will contain the input $x$ (the machine erases the input symbols as it reads them), the current state of the PDA's finite control, and also a list of all symbols on the simulated PDA's stack.

  3. After it simulates a step of the PDA, the TM appends the current snapshot of the PDA onto the second tape. It copies over the remaining input, the current state, and the symbol at the top of the stack.

    So the second tape contains a list of every snapshot that the PDA has ever been in.

  4. Every time the TM copies over a new snapshot, it should check to see whether that exact snapshot has occurred on the tape already. If it has, the PDA has entered into a loop and will never halt. The TM should reject.

  5. The PDA will either halt within finitely many steps, or will loop forever. There are $Q\times n \times \Gamma$ possible snapshots, where $Q$ is the current PDA state, $n$ is the number of symbols in the input, and $\Gamma$ is the number of symbols in the stack alphabet. For this reason, the machine will either halt within $Q\times n\times \Gamma$ steps, or (by the pigeonhole principle) loop forever. The problem is therefore decideable.

Related Question