Ch7 - Chapter 7 PDA and CFLs 7.1 PDA s s s Is an enhanced...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 7 PDA and CFLs
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 7.1 PDA Is an enhanced FSAs with an internal memory system, i.e., a ( pushdown ) stack . Overcomes the memory limitations and increases the processing power of FSAs. Defn. 7.1.1 A pushdown automaton (PDA) is a sextuple ( Q , , Γ , δ , q 0 , F ), where Q is a finite set of states is a finite set of input symbols, called input alphabet Γ is a finite set of stack symbols, called stack alphabet q 0 Q , is the start state F Q , is the set of final states δ : Q × ( { λ }) × ( Γ { λ }) Q × ( Γ { λ }), a ( partial ) transition function
Background image of page 2
3 7.1 PDA A convention: Stack symbols are capital letters Greek letters represent strings of stack symbols An empty stack is denoted λ A α represents a stack with A as the top element
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 7.1 PDA δ is of the form δ ( q i 0 , a , A 0 ) = { [ q i 1 , A 1 ], [ q i 2 , A 2 ], . .., [ q i n , A n ] } where the transition [ q i j , A j ] δ (q i 0 , a , A 0 ), 1 j n denotes that q i 0 is the current state a is the current input symbol A 0 is the current top of the stack symbol q i j (1 j n ) is the new state , and A j is the new top of the stack symbol and in a state (transition) diagram, it is denoted q i 0 q i j a A 0 / A j
Background image of page 4
5 7.1 Pushdown Automaton Input Tape state indicator s 0 s 3 s 4 s 1 Tape Head Head moves in this direction Control Mechanism Stack s 5 s 2
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 7.1 PDA Special cases: where q i and q j can be the same [ q j , A ] δ ( q i , a , λ ) [ q j , λ ] δ ( q i , λ , A ) [ q j , A ] δ ( q i , λ , λ ) [ q j , λ ] δ ( q i , a , λ ) The PDA notation [ q i , w , α ] [ q j , v , β ] indicates that [ q j , v , β ] can be obtained from [ q i , w , α ] as a result of a sequence of transitions (i.e., 0 or more). Example . The PDA M = ( Q , , Γ , δ , q 0 , F ), where δ is Accepts a n b n ( n 0) with an empty stack and in an accepting * m q 0 a λ /A b A/ λ q 1 b A/ λ {* Consume the input, push a stack symbol *} {* Consume no input, pop the TOS symbol *} {* Consume no input, push a stack symbol *} {* Consume input, no push/pop, an FSA transition *}
Background image of page 6
7 7.1 PDA Defn. 7.1.2. Let M = ( Q , , Γ , δ , q 0 , F ) be a PDA. A string w * is accepted by M if 5 [ q 0 , w , λ ] [ q i , λ , λ ], where q i F . The language of M , denoted L ( M ), is the set of strings accepted by M . Example (7.1.1). Give a PDA that accepts the language { wcw R | w { a , b }* }. Defn
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/02/2012 for the course C S 252 taught by Professor Dennisng during the Winter '12 term at BYU.

Page1 / 23

Ch7 - Chapter 7 PDA and CFLs 7.1 PDA s s s Is an enhanced...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online