2

I am struggling with the following problem: I received a special type of pushdown automaton, called linear pushdown automaton. This PDA is special because once I used pop I can't use push anymore. The formal definition is: $$M=<\Sigma,\Gamma,Q,\Delta,s,A>$$ $$Q=Q_{push}\cup Q_{pop}$$ $$Q_{push}\cap Q_{pop}= \emptyset$$ $\text{if}\ (r,\beta)\in \Delta(q,x,\alpha)\space \text{then}:$ $$if\space q\in Q_{push}\space \text{then} \space \alpha=\epsilon$$ $$if\space q\in Q_{pop}\space \text{then} \space \beta=\epsilon$$ $$if\space q\in Q_{pop}\space \text{then}\space r\in Q_{pop}$$

Now I need to prove that given a CFL that satisfies the following condition:

any rule have at most one non-terminal symbol on the right hand side,

I can construct a linear push-down automaton.

Now to be completely honest I am totally clueless... My line of thought was: 1. I can declare k Nfas that each one receives the terminal phrases before the non terminals and after the non terminal at the end of each NFA we will push some symbol to the stack and continue from there... I feel that I have no idea how to procees from here,

appreciate your kind help.

Chain Markov
  • 16,012
misha312
  • 537

1 Answers1

1

Such a PDA is sometimes called a single turn PDA. Also CFG with at most one nonterminal at the RHS are called linear.

Now for a linear grammar its derivations are of the form $S \to a_1 N_1 b_1 \to a_1a_2 N_2 b_2b_1 \to \dots \to a_1a_2\dots a_k N_k b_k \dots b_2b_1 \to a_1a_2\dots a_k c b_k \dots b_2b_1 $ where the $a_i,b_i,c$ are some terminal strings (maybe empty).

The solution is to guess the computation while reading the first part $a_1a_2\dots a_k c$ of the input string, while pushing the second part $b_k \dots b_2b_1$ onto the stack (in reverse obviously). Then at some point switch to popping and verify that indeed the remaining input matches the stack.

Hendrik Jan
  • 1,970