# Emptiness of PDA without constructing the corresponding CFG

The emptiness problem for Context free Grammars(CFG) is well studied. The same holds for the equivalence problem between Pushdown Automata (PDA) and CFGs.

Therefore, given a PDA, the straightforward way to decide whether the language it accepts is empty is to convert the PDA into a CFG and then use the known algorithm to decide emptiness of the corresponding CFG.

I am wondering whether there exists some algorithm to directly check emptiness of the language of the PDA without going through the conversion to a context free grammar.

Quick Answer: Yes, there is a really lovely algorithm that solves non-emptiness for pushdown automata that does not involve constructing the equivalent CFG.

Possible Drawback: Correct me if I am wrong, but it doesn't appear to be more efficient than the approach where you convert to a CFG.

Basic Idea: It can be viewed as a sort of dynamic programming algorithm where you solve reachability without ever constructing the possibly exponential length paths that you need to consider.

You start with a state diagram for a Pushdown Automata. Let's call a transition that doesn't manipulate the stack a resting transition. You proceed with a series of stages.

Start of Stage: You combine all compatible push and resting transitions. Next, you combine all compatible pop and resting transitions. Then, you combine all compatible pairs of resting transitions with each other. Finally, you combine all compatible push and pop transitions. Now, you throw in all of the new transitions into the state diagram. End of Stage.

You go through stage after stage repeating this process. There are only so many possible transitions. Eventually, you either get a transition that leads from the start state to a final state or you must run out of possible transitions to add. At this point, you know whether the automata's language is empty or not.

Question: Can you provide me with any books or papers that give a good exposition of this algorithm? Whenever I searched for it several years ago, it seemed that this algorithm is unpopular or not well known. I personally really like it.

Thanks for asking the question! I really appreciate it and I hope this helps a little bit. Have a nice day! :)

• This seems similar to Muller/Schupp 1985? – András Salamon Jul 23 '15 at 22:09
• @AndrásSalamon Cool! Thank you for the reference. :) – Michael Wehar Jul 24 '15 at 3:35
• Thanks! Regarding the drawback of not being more efficient, we do some operations between automata and want to check emptiness of the resulting PDA, thus going back to a CFG would require an extra engineering effort and thats why this algorithm comes very handy in our case. – user4242 Jul 24 '15 at 21:59
• @user4242 Cool! Could you possibly elaborate further with me via email? My thesis work is on non-emptiness and intersection non-emptiness problems. I'm especially interested in non-emptiness problems for automata with stacks. Hearing more about your project could really benefit me in understanding the ongoing practical applications and I could hopefully benefit you by sharing more relevant results. – Michael Wehar Jul 25 '15 at 4:15
• This might provide some relevant information: arxiv.org/pdf/1405.5593.pdf – Michael Wehar Aug 13 '15 at 15:34