Presentation is loading. Please wait.

Presentation is loading. Please wait.

CFG => PDA Sipser 2 (pages 99-118). CS 311 Fall 2008 2 Formally… A pushdown automaton is a sextuple M = (Q, Σ, Γ, δ, q 0, F), where – Q is a finite set.

Similar presentations


Presentation on theme: "CFG => PDA Sipser 2 (pages 99-118). CS 311 Fall 2008 2 Formally… A pushdown automaton is a sextuple M = (Q, Σ, Γ, δ, q 0, F), where – Q is a finite set."— Presentation transcript:

1 CFG => PDA Sipser 2 (pages 99-118)

2 CS 311 Fall 2008 2 Formally… A pushdown automaton is a sextuple M = (Q, Σ, Γ, δ, q 0, F), where – Q is a finite set of states – Σ is a finite alphabet (the input symbols) – Γ is a finite alphabet (the stack symbols) – δ: (Q × Σ ε ×Γ ε ) → P(Q × Γ ε ) is the transition function – q 0 ∈ Q is the initial state, and – F ⊆ Q is the set of accept states

3 CS 311 Fall 2008 3 Balanced brackets Let M = (Q, Σ, Γ, δ, q 0, F), where – Q = {q 1, q 2, q 3 } – Σ = {[, ]} – Γ = {[, $} – q 0 = q 1 – F = {q 1, q 3 } – δ is given by the transition diagram:

4 CS 311 Fall 2008 4 Finite automata and Pushdown automata ? ? Pushdown languages Regular languages

5 CS 311 Fall 2008 5 Regular => Pushdown Proposition: Every finite automaton can be viewed as a pushdown automaton that never operates on its stack. Proof: Let M = (Q, Σ, δ, q 0, F) be a finite automaton. Define M' = (Q, Σ, Γ, δ', q 0, F), where…

6 CS 311 Fall 2008 6 Finite automata and Pushdown automata ? ? Pushdown languages Regular languages

7 CS 311 Fall 2008 7 Pushdown automata are nondeterministic Build a machine to recognize PAL = {ww R | w ∈ {0, 1}*} 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 0 0 Finite control $ $ stack or pushdown store reading head 1 1

8 CS 311 Fall 2008 8 Recognizing context-free languages Lemma 2.21: If a language is context-free, then some pushdown automaton recognizes it. Proof:

9 CS 311 Fall 2008 9 Shorthand for…

10 CS 311 Fall 2008 10 For example… Let’s use this construction on: G = (V, Σ, R, S), where V = {S} Σ = {[, ]} R = { S → G ε, S → G SS, S → G [S]}


Download ppt "CFG => PDA Sipser 2 (pages 99-118). CS 311 Fall 2008 2 Formally… A pushdown automaton is a sextuple M = (Q, Σ, Γ, δ, q 0, F), where – Q is a finite set."

Similar presentations


Ads by Google