PDA问题>需要帮助
我的任务是构造一个能识别语言 A= {a^mb^n | m> n} 与 Σ = {a, b}.. 我有点困惑如何做到这一点.. 你们能帮我解决这个问题吗?谢谢
i have a task to construct the PDA which recognizes the language A= {a^m b^n | m > n} with ∑ = {a, b}.. i'm a bit confused how to do it.. can you guys help me to solve this question? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 Wikipedia 页面上下推自动机的示例:它适用于语言 { 0n1n | n ≥ 0},即一定数量的零后跟相同数量的一。这与您的任务不完全相同,但相似。您能根据您的课程材料理解描述吗?您将如何修改它以识别您需要的语言?
Look at this example on the Wikipedia page for pushdown automata: it's for the language { 0n1n | n ≥ 0 }, that is, some number of zeroes followed by the same number of ones. This is not exactly the same as your task, but similar. Can you understand the description based on your course material? How would you modify it to recognize the language you need?
我们先不要直接跳到为该问题设计 PDA,而是先尝试理解该问题。
给定语言可以生成哪些可能的字符串。
那么可以有无限个这样的字符串,例如 -
这个想法是确保 a 的数量始终大于 b 的数量,或者我们可以说 a 中 b 的数量字符串不应超过 PDA 接受的字符串中 a 的数量。
现在我们有一个问题。
如何确保 a 的数量大于 b 的数量
对于一个字符串,如果我们开始取消字符串中每个 'b' 的 a
我们将得到以下结论
如果我们尝试在“问题”和上面的那些点之间建立关系,我们会观察到该字符串属于上述第3点的字符串是PDA可接受的字符串。
现在让我们将 PDA 定义如下
P = ({q0,q1,qf}, {a,b}, δ, {a,b,Z0}, q0, Z0, {qf})
函数 (δ):
解释:
Let's not jump directly on to designing a PDA for the problem, and try to understand the question first.
What are few possible string that can be generated from the given language.
Well there can be infinite such string, for instance -
The idea is to make sure that number of a's is always greater than number of b's, or we can say that number of b's in a string should never exceed number of a's in the string to be accepted by the PDA.
So now we have a question.
How to make sure that number of a's greater than number of b's
For a string if we start to cancel a's for every 'b' in the string
We will be left with the following conclusion
If we try to establish a relationship between 'Question' and those points above we observe that string which belong to Point No. 3 above are the strings acceptable by the PDA.
Now lets define our PDA as follows
P = ({q0,q1,qf}, {a,b}, δ, {a,b,Z0}, q0, Z0, {qf})
Transition function (δ):
Explanation: