What languages are accepted in the PDA

时间:2017-04-08 22:40:33

标签: pushdown-automaton

I'm struggling to understand the notation of push down automata's when pushing and popping items on and off of stacks.

I understand that the stack must be empty for the string to be accepted.

Here is my PDA:

enter image description here

If I create a transition diagram for say input 0011 i would do it like this:

State          Input         Stack

q0             0011          ɛ

q0             011           0

q0             11            00

q0             1             100

q0             ɛ             1100

Since the input is empty and the stack is not empty, this is not accepted?

So if i put input like well thats the thing... I'm pretty sure this is wrong because if i put any string into the PDA it won't accept.

I guess to sum up my actual question, is the notation for the first non-terminal (0,ɛ/0)(1,ɛ\1) Does this mean to under input 0 add 0 to the stack (same for input 1, doing the opposite)?

For the second terminal does it mean under... Well this is what is confusing me (do i take strings out of the stack or the input?) I imagine i have to remove items from the stack?

So does this mean the language accepted by this PDA is the empty set? If not can you explain where i'm going wrong?

1 个答案:

答案 0 :(得分:0)

有不同的约定,但有一个共同的约定是你接受:

  1. 输入用尽;和
  2. 你是一个接受国家;和
  3. 堆栈是空的。
  4. 实际上,您可以使用这些规则的多个子集,并使用其他规则集,并获得也适用于无上下文语言的系统。机器在这些系统中会有不同的解释,但表达能力是相同的。

    正如Welbog指出的那样,假设上面的三点系统,这个PDA接受字母{0, 1}上的偶数长度的回文语言。让我们谈谈每个州的所作所为。

    1. q0读取01并分别将01推送到堆栈上,一遍又一遍如你所愿。如果您读取字符串x,则将字符串x推入堆栈。

    2. q1读取01,如果您在堆栈顶部有符号,则将其弹出,只要您想要一次又一次地获取。如果您阅读字符串x,则会从堆栈中弹出x^R

    3. 如果我们使q1成为接受状态,并且在输入用完时要求堆栈为空,则表示:

      1. 如果在状态x^R内读取了x,我们会弹出q1
      2. 如果我们在状态x^R中阅读x^R,则堆栈包含q0
      3. 我们阅读x^R然后x并接受,因此我们只接受x^R x等字符串,即偶数长度的回文
      4. 此外,任何偶数长度的回文都有一条通过这个PDA的路径导致它被接受,因为PDA可以保留q0 |x|/2个输入符号,过渡到q1并阅读剩下的|x|/2。由于PDA是不确定的,这足以说明字符串被接受了。