Nondeterministic Pushdown Automata

Nondeterministic Pushdown Automata

Nondeterministic Pushdown Automata

  • 自動機 長相

    alt text
    alt text

    • 最初的stack
  • 下推自動機的定義

    alt text

  • 轉移函數的定義

    alt text

    • 邊上的定義

      alt text
      alt text

      • 也可以推string
    • Example

      alt text

    • Stack是空的 不允許任何轉移

      alt text

  • Non-determinism

    alt text

  • 什麼樣的string是被accept的

    alt text

    • 一個例子

      alt text

  • 如何描述狀態機

    alt text
    alt text

    • 轉移

      alt text

    • 完整過程
  • 正式定義

    alt text

  • Example

    • a的數量跟 b的一樣

      alt text

  • 什麼樣的string不被接受

    alt text
    alt text

Pushdown Automata and Context-Free Languages

  • 被NPDA接受的語言 相當於CFG

    alt text

  • step 1: 證明 CFG 屬於被NPDA接受的語言

    alt text

    • 方法

      alt text
      alt text
      alt text

    • 以例子簡單說明

      alt text
      alt text

    • 因此

      alt text

  • step 2: 證明 被NPDA接受的語言 屬於CFG

    alt text

    • grammar本質上是機器的狀態移動
    • 前置需求

      alt text
      alt text

      • 清空Stack

        alt text

      • 任何移動 要嘛減少或增加stack content
      • 作法

        alt text
        alt text
        alt text

    • 實際作法省略 …

Deterministic Pushdown Automata and Deterministic CFLs

  • 接受的轉移

    alt text
    alt text

  • 不接受的轉移

    alt text

  • PDA

    alt text
    alt text

    • Example

      alt text
      alt text

  • 定義 一個語言是deterministic context-free

    alt text

  • NPDA 比 DPA更加強大

    alt text
    alt text

  • 證明

    alt text

    • 例子

      alt text
      alt text
      alt text
      alt text

      • 假設存在DPDA接受它

        alt text
        alt text

      • 需要用到一些fact 先來講fact…
  • fact

    alt text
    alt text
    alt text

  • 繼續證明

    alt text
    alt text
    alt text

    • 產生矛盾

      alt text


Nondeterministic Pushdown Automata
https://z-hwa.github.io/webHome/[object Object]/Theory of Computation/Nondeterministic-Pushdown-Automata/
作者
crown tako
發布於
2025年1月6日
許可協議