Lecture5x

# Lecture5x - FORMAL LANGUAGES AUTOMATA AND COMPUTABILITY...

This preview shows pages 1–10. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 CONTEXT-FREE GRAMMARS AND PUSH-DOWN AUTOMATA Σ = {0, 1}, L = { 0 n 1 n | n ≥ 0 } Σ = {a, b, c, …, z}, L = { w | w = w R } Σ = { (, ) }, L = { balanced strings of parens } NONE OF THESE ARE REGULAR (), ()(), (()()) are in L, (, ()), ())(() are not in L PUSHDOWN AUTOMATA (PDA) FINITE STATE CONTROL STACK (Last in, first out) INPUT ε,ε → \$ 0,ε → 1, → ε 1, → ε ε, \$ → ε input pop push 0011 STACK \$ 0011 011 \$ 11 \$ 1 Non-deterministic ε,ε → \$ 0,ε → 1, → ε 1, → ε ε, \$ → ε input pop push 001 STACK \$ \$ \$ 1 01 001 PDA that recognizes L = { 0 n 1 n | n ≥ 0 } Definition: A ( non-deterministic ) PDA is a tuple P = (Q, Σ, Γ, δ , q , F), where: Q is a finite set of states Γ is the stack alphabet q ∈ Q is the start state F ⊆ Q is the set of accept states Σ is the input alphabet δ : Q × Σ ε × Γ ε → 2 Q × Γ ε 2 Q is the set of subsets of Q and Σ ε = Σ ∪ {ε} Let w ∈ Σ* and suppose w can be written as w 1 ... w n where w i ∈ Σ ε (recall Σ ε = Σ ∪ {ε} ) Then P accepts w if there are r , r 1 , ..., r n ∈ Q and s , s 1 , ..., s n ∈ Γ* (sequence of stacks) such that 1. r 0 = q 0 and s = ε ( P starts in q with empty stack) 2. For i = 0, ..., n-1: (r i+1 , b ) ∈ δ ( r i , w i+1 , a ), where s i = a t and s i+1 = b t for some a, b ∈ Γ ε and t ∈ Γ* ( P moves correctly according to state, stack and symbol read) 3. r n ∈ F ( P is in an accept state at the end of its input) ε,ε → \$ 0,ε → 0 1,0 → ε 1,0 → ε...
View Full Document

{[ snackBarMessage ]}

### Page1 / 34

Lecture5x - FORMAL LANGUAGES AUTOMATA AND COMPUTABILITY...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online