PPT 2
(From p92)
CFG
PDA conversions
先弄清转化目的,右边方框是Content free language,要将他转化为一个pushdown automata 的图表
下面两副图看起来复杂,其实转化为图很简单一共就2个部分:
1. 只有三个state 最后一个为accepting state,第一个state到第二个state的箭头上是ε, ε / S$,第二个state到final state 箭头上是ε, $ / ε
2. 第二个箭头有一个自循环,左边是CFG的转化输入,方框里是啥就是啥,目的是让stack里最后全是字符(数字或者#这种符号);右边就是直接将字符pop,有啥就pop啥
需要注意的是:第二个图表达的意思是stack必须按照input的顺序一个一个的pop,而不能先全部push成字符,再将字符一个一个pop出去
PDA
CFG conversions (不强求)
>> Firstly,it should simplified the PDA
A simplified PDA 需要满足:
1. 只有一个accpeting state
2. Empties its stack before accepting
3. Each transition is either a push, or a pop, but not both
下面的图就是一个简化的结果:
这是三种转换,然后在更复杂的PDA图中,找这些结构,例如下图:一二列是第二个结构,第三列是第三个结构,第四列是第一个结构
Properties of Context-Free languages
>> UNION
>> Concatenation
>> Star Operation
Negative Properties of Context-Free Languages
>> Intersection
>> Complement
(End with p148)