NPDA with exactly 2 states that might need 3 transitions to final state

孤街醉人 提交于 2019-12-08 09:10:00

问题


Let's say we want to draw the transition graph with two states of a NPDA that accepts that language L. And let's also say that this NPDA will have exactly 2 states. My thinking on this would be to do everything in the first state then use the second state as the grand finale. Like so:

But I'm not sure that the lambda transitions will result in q1 or if there is a better way to do this, which there likely is a better way since I'm trying to teach this to myself. Perhaps someone can get me back on track here?


回答1:


You almost got it. You just missed the n>=1 requirement, since your current NPDA will also accept "acb". And you don't need (b,4)/5, since stack symbol 5 won't be used anyway.

So you need another stack symbol between 1 and 2 to denote whether we have seen "b" before "c".

q0-q0         q0-q1
(a,Z)/1Z     (b,3)/λ
(b,1)/2      (b,4)/λ
(b,2)/2      (b,5)/λ
(c,2)/3
(b,3)/4
(b,4)/5


来源:https://stackoverflow.com/questions/20258391/npda-with-exactly-2-states-that-might-need-3-transitions-to-final-state

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!