为什么 a^mb^n 其中 m,n > 0 是常规语言,但 a^nb^n 其中 n > 0 是非常规语言
a^mb^n (其中 m,n >= 0) 是常规语言,但为什么 a^nb^n (其中 n >= 0) 是非常规语言? 在这两种语言中,我们都采用无限数量的 a 和 b,但是为什么我们可以为第一种情况构建有限自动机,而不能为第二种情况构建有限自动机?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
让我们将上述语言视为A,B:
语言 X 是一种常规语言,但是语言 y 不是一种常规语言,因为我们无法为语言构建有限的自动机 y 。
如果语言不满足泵送引理,则语言不是常规语言,但是如果该语言满足泵送引理,则该语言不必是规律的。
如果语言 x A和B的数量不同,因此我们不必记住“ A”的发生数量,在接受所有A之后,我们可以接受B并转移到最终状态,而是语言 y A和B的数量相同。因此,语言中的所有字符串 都应包含相等数量的A和相等数量的B。因此,我们需要记住A的数量,以便可以评估B的数量,这是使用有限自动机无法进行的。
因此,为了评估TESE的语言,需要按下自动机。
类型的语言 y 称为上下文免费语言,可以使用俯卧撑自动机(PDA)对其进行评估。FiniteAutomata没有任何存储器来存储A和B的计数。作为下降自动机具有一定数量的内存,因此我们可以评估 y 类型的语言。
对于这种语言 y ,我们需要将所有A启动到堆栈中,每当我们遇到B时,我们都需要弹出A(请记住所有A必须在B的情况下)。 A不是在B之前,我们需要将系统移至死状态。
Let us consider the above languages as A,B:
Language X is a regular language but Language Y is not a regular language because we cannot construct a Finite automata for language Y.
A language is not a regular language if the language does not satisfy the pumping lemma , but if the language satisfies the pumping lemma then the language need not be regular.
In case of language X the number of a's and b's are different so we need not remember number of occurrences of 'a' after accepting all a's we can accept b's and move to final state ,but in case of language Y the number of a's and b's are same. So all the strings in the language Y should contain equal number of a's and equal number of b's. So we need to remember the number of a's so that b's can be evaluated, which is not possible using finite automata.
So to evaluate tese kind of languages push down automata is required.
The languages of the kind Y are called context free language and they can be evaluated using Pushdown Automata(PDA).Finite automata do not have any memory to store the count of a's and b's. where as pushdown automata has some amount of memory so we can evaluate languages of type Y.
For this language Y we need to push all the a's on to the stack and whenever we encounter b's then we need to pop a's(remembering the condition that all the a's must be before b's).If all the a's are not before b's then we need to move the system to dead state.
在第二语言中,A和B的数量必须相同。
有限的自动机需要计算A的数量来检查B的数量是否相同。这将需要无限的状态。
也许可以在Wikipedia上查看泵送引理: nofollow noreferrer“> a>
In the second language the number of a's and b's have to be the same.
The finite automata would need the ability to count the number of a's to check if the number of b's are the same. This would need an infinite amount of states.
Maybe check out the pumping lemma on wikipedia: https://en.wikipedia.org/wiki/Pumping_lemma_for_regular_languages