在我的演讲中,我们给出了一个下推自动机的例子,它接受以下语言 {(a^n)(b^n): n 大于或等于零}。
Q - set of states ={s,p,f}
L - alphabet = {a,b}
R - stack = {a}
F - accepting states ={s,f}
D -transition relation ={
(s,a,e),(p,a)
(p,a,e),(p,a)
(p,b,a),(f,e)}
我的问题是为什么状态 p 和 f 是必要的?你不能只使用 state s 吗?
另外我想知道在构建 PDA 时是否有一种方法可以知道您需要多少个状态以及堆栈字母表是什么?还是你只需要直观地解决它?