2
$\begingroup$

I'm aware that the halting problem is solvable for PDAs, but I have recently discovered that I am wrong about how to actually do it. I used to think that you could detect an infinite loop by meeting these four conditions:

  1. arrive at the same state as you were in previously
  2. with the same top symbol as you had last time
  3. without consuming anything on the stack, and
  4. without consuming any input.

...but this appears to actually be untrue for nondeterministic PDAs. Consider this machine:

enter image description here

It accepts the empty string, but it matches all of my infinite-loop detecting criteria in the first state before it can do so.

The following version even contains infinite paths to accepting the empty string:

enter image description here

I am coding a NPDA simulator in Scheme, and while I am happy to accept that the halting problem is solvable for a PDA, I am clearly wrong about how it is accomplished. How can it actually be done?

$\endgroup$
  • $\begingroup$ Infinitely many paths, but most (i.e., all but a finite number) of them are equivalent. $\endgroup$ – dkaeae May 9 at 7:18
  • $\begingroup$ @dkaeae True! But since my original 4 rules are insufficient, how would you actually detect an equivalence? That's the crux of the question. $\endgroup$ – Ben I. May 9 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.