1 / 8

Pushdown Automata

[Section 2.2]. Pushdown Automata. like NFA’s but also have a stack accept context-free languages (we’ll prove their equivalence to CFG’s) Example: { 0 n #1 n | n > 0 }. [Section 2.2]. Pushdown Automata. Def 2.13: A pushdown automaton (PDA) is a 6-tuple (Q, § , ¡ , ± ,q 0 ,F), where

andreapaul
Download Presentation

Pushdown Automata

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. [Section 2.2] Pushdown Automata • like NFA’s but also have a stack • accept context-free languages (we’ll prove their equivalence to CFG’s) • Example: { 0n#1n | n > 0 }

  2. [Section 2.2] Pushdown Automata • Def 2.13: • A pushdown automaton (PDA) is a 6-tuple (Q,§,¡,±,q0,F), where • Q is a finite set of states • § is a finite input alphabet • ¡ is a finite stack alphabet • ± : is the transition function • q02 Q is the start state • F µ Q is the set of accept states

  3. [Section 2.2] Pushdown Automata Def: Let M=(Q,§,¡,±,q0,F) be a PDA. It accepts w = w1w2…wm, where each wi2§[{ε}, if there exist states r0,r1,…,rm2 Q and strings s0,s1,…,sm2¡* such that

  4. [Section 2.2] Pushdown Automata • Examples: give PDAs for the following languages: • { aibjck | i,j,k ¸ 0 and i=j or i=k } • { wwR | w 2 {0,1}* } • { w | w contains the same number of 0’s and 1’s }

  5. [Section 2.2] Equivalence with CFGs Thm 2.20: A language is context-free iff there is a PDA that recognizes it.

  6. [Section 2.2] Equivalence with CFGs Lemma 2.21: For every context-free language there is a PDA that recognizes it.

  7. [Section 2.2] Equivalence with CFGs • Lemma 2.27: For every PDA there is an equivalent CFG. • Proof: assume PDA satisfies: • has a single accept state • empties stack before accepting • each transition is a “push” or “pop” but not both

  8. [Section 2.2] Equivalence with CFGs • Lemma 2.27: For every PDA there is an equivalent CFG. • Proof: Let P=(Q,§,¡,±,q0,{qaccept}) be a pda satisfying 1-3. Then CFG G=(V,§,P,S) is • V = { Ap,q | p,q 2 Q } - meaning “Ap,q generates all strings that move from p to q on an empty stack” • S =

More Related