简体   繁体   中英

the stack size in a PDA M can grow to hold at most k symbols. What kind of language is L(M)?

the stack size in a PDA M can grow to hold at most k symbols. What kind of language is L(M)? Prove your claim.

I think the answer for this is this: The language L(M) is a regular language if it can hold at most k symbols. Since it can hold at most k symbols, the stack size is therefore finite. Furthermore, we can create a DFA that will accept L(M), and therefore we can conclude that this language L(M) is regular.

But I am having a debate with my friends whether this is correct or not

You are correct, such automata accept the regular languages.

One way to argue this is by showing how to construct an NFA for any of these limited-stack PDAs. The construction is easy, as you have suggested and has been suggested in the comments:

  1. take your limited-stack PDA
  2. for every state q and every possible stack configuration S (there can be no more than (|E| + 1)^k of them for sure) in the limited-stack PDA, define state qS in the NFA
  3. for every transition (q, S, s, q', S') where q is the initial state, S is the initial stack configuration, s is the transition symbol, q' is the transition state and S' is the stack configuration after the transition, add a transition from qS to q'S' in the NFA on symbol s. Note: do this for empty/epsilon/lambda transitions as well
  4. make the initial state of the NFA the state q0S0 the one where q0 is the initial state of the limited-stack PDA and S0 is the empty stack
  5. make the accepting states of the PDA those states qaSa where qa is accepting in the limited-stack PDA (and/or if you are accepting by empty stack, Sa is the empty stack).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM