patternMinor
What is the complexity for the universality problem for a NFA with all states accepting?
Viewed 0 times
problemthenfawhatallwithstatesacceptinguniversalityfor
Problem
It is well known that the universality problem for NFA (deciding whether $L(A)=\Sigma^*$) is $PSPACE$-complete. However, what if every state of the NFA is known to be accepting? It seems to me that the problem is at most in $co$-$NP$, as a counterexample (unlike in the case of a general NFA) is polynomial (even linear) in the size of the input (the number of states). What is the complexity of this problem?
Solution
You problem is PSPACE-complete. I prove that it's PSPACE-hard by reducing universality of NFAs to universality of NFAs with all states accepting.
Let $A$ be a NFA. Add a new final state $q_\$$ to it and for every accepting state $q$, add a transition $q\overset{\$}{\to}q_\$$ where $\$$ is a fresh letter. For every letter $a\in \Sigma\sqcup \{\$\}$, also add a transition $q_\$\overset{a}{\to}q_\$$. And then make all states accepting. The new automaton accepts $L(A)\$ (\Sigma\sqcup \{\$\})^ \sqcup L'$ for some $L'\subseteq \Sigma^$.
Now, add some automaton (with all states final) that recognizes the language $\Sigma ^$ (i.e. the language of words that don't contain $\$$) in parallel. The new automaton will recognize $L(A)\$ (\Sigma\sqcup \{\$\})^ \sqcup (L' \cup \Sigma ^)=L(A)\$ (\Sigma\sqcup \{\$\})^ \sqcup \Sigma ^*$.
Now, notice that we have $L(A)=\Sigma^$ iff $L(A)\$ (\Sigma\sqcup \{\$\})^ \sqcup \Sigma ^=(\Sigma\sqcup\{\$\})^$. I.e. the process I described is a reduction from universality of a NFA to universality of a NFA with all states accepting. Since the reduction is polynomial, your problem is PSPACE-hard.
Let $A$ be a NFA. Add a new final state $q_\$$ to it and for every accepting state $q$, add a transition $q\overset{\$}{\to}q_\$$ where $\$$ is a fresh letter. For every letter $a\in \Sigma\sqcup \{\$\}$, also add a transition $q_\$\overset{a}{\to}q_\$$. And then make all states accepting. The new automaton accepts $L(A)\$ (\Sigma\sqcup \{\$\})^ \sqcup L'$ for some $L'\subseteq \Sigma^$.
Now, add some automaton (with all states final) that recognizes the language $\Sigma ^$ (i.e. the language of words that don't contain $\$$) in parallel. The new automaton will recognize $L(A)\$ (\Sigma\sqcup \{\$\})^ \sqcup (L' \cup \Sigma ^)=L(A)\$ (\Sigma\sqcup \{\$\})^ \sqcup \Sigma ^*$.
Now, notice that we have $L(A)=\Sigma^$ iff $L(A)\$ (\Sigma\sqcup \{\$\})^ \sqcup \Sigma ^=(\Sigma\sqcup\{\$\})^$. I.e. the process I described is a reduction from universality of a NFA to universality of a NFA with all states accepting. Since the reduction is polynomial, your problem is PSPACE-hard.
Context
StackExchange Computer Science Q#70129, answer score: 5
Revisions (0)
No revisions yet.