简体   繁体   English

下推自动机以显示语言

[英]Push down automata for a language

I want to design a pushdown automata for the language 我想为该语言设计下推自动机

L = { a^i b^j c^k | i = j or k <= j <= 2k}

The solution proposed by the instructor is as pictured in the following diagram. 讲师提出的解决方案如下图所示。 PDA图

But my concern here is, that it does not handle string of the form when |2c| > |b| 但是我在这里担心的是,当|2c| > |b|时,它不处理以下形式的字符串 |2c| > |b| . That is when in the q8 state, what if the all the B's are stacked out, but the input C is not finished yet. 那就是当处于q8状态时,如果所有B都堆叠在一起,但输入C尚未完成怎么办。 That transition is not captured here. 该过渡未在此处捕获。

Is my concern correct? 我的担心正确吗? Or the proposed solution is a correct PDA. 或建议的解决方案是正确的PDA。

Remember that j >= k, so that means |b| 请记住,j> = k,因此意味着| b |。 >= |c|. > = | c |。

If all the "b"s in input were read, then the number of B's stacked is greater than (or equal to) the number of "c"'s to be read in the input. 如果读取了输入中的所有“ b”,则堆叠的B的数量大于(或等于)要在输入中读取的“ c”的数量。

  • If j = k, then it will use the transiction from q8 to q8 until the input is finished. 如果j = k,则它将使用从q8到q8的转换,直到输入完成。
  • If j = 2k, it will read a "c" (q8 -> q9) and take two B's out of the stack (q9 -> q8), so only strings with |b| 如果j = 2k,它将读取一个“ c”(q8-> q9)并从堆栈中取出两个B(q9-> q8),因此仅| b |的字符串 = 2|c| = 2 | c | can be accepted. 可以接受。
  • If j < 2k, it will use q8 -> q9 and q9-> q8 until the number of B's stacked is equal to the number of "c"s to be read in the input. 如果j <2k,它将使用q8-> q9和q9-> q8,直到B的堆叠数量等于要在输入中读取的“ c”的数量。 Then it will use q 8-> q8 until the input is finished. 然后它将使用q 8-> q8直到输入完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM