2.2 Pushdown Automata What's a Pushdown Automaton? an NFA with a stack How is a Pushdown Automaton similar to a Finite Automaton? states, start state, accept states, transitions How is a Pushdown Automaton different from a Finite Automaton? transitions also pop and push stack symbols next state depends on both input and stack What operations is a Pushdown Automaton allowed to do on its stack? Is a Pushdown Automaton able to access symbols in the middle of the stack? How many symbols is a Pushdown Automaton able to push onto the stack? Give an informal description of a PDA that recognizes the language. { a^n b^n | n >= 0 } How are the transitions in a PDA state diagram different from the transitions in a state diagram for a finite automaton? FA transitions are labelled with a single symbol read from input PDA transtions are labelled with three symbols (input, pop -> push) next state depends on both input and stack Draw a state diagram for a PDA that recognizes the language. { a^n b^n | n >= 0 } { w | the number of 0s in w is equal to the number of 1s } Classwork (You may work with a partner.) Draw a state diagram for a PDA that recognizes the language. (w is a string of 0's and 1's) { w | the length of w is odd and the first symbol is the same as the middle symbol } How do Pushdown Automata compare to Context-Free Grammars? How do Pushdown Automata compare to DFAs, NFAs, and Regular Expressions? How do Nondeterministic PDAs compare to Deterministic PDAs? What's a Formal Definition of a PDA? 6-tuple (Q, S, G, d, q0, F) 1. Q is a finite set (states) 2. S is a finite set (input alphabet) 3. G is a finite set (stack alphabet) 4. d is transition function d: Q x S[epsilon] x G[epsilon] -> P(Q x G[epsilon]) 5. q0 is a member of Q (start state) 6. F is a subset of Q (accept states) How is the formal definition of a PDA different from an NFA? the stack has its own alphabet of symbols domain of transition function includes the symbol popped range of transition function includes the symbol pushed What's the domain of the PDA Transition Function? domain is current state, input symbol, stack symbol (pop) input can be epsilon (don't read) stack can be epsilon (don't pop) What's the range of the PDA Transition Function? range is next state, stack symbol (push) stack can be epsilon (don't push)