This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 1 Pushdown Automata Definition Moves of the PDA Languages of the PDA Deterministic PDA’s 2 Pushdown Automata ◆ The PDA is an automaton equivalent to the CFG in languagedefining power. ◆ Only the nondeterministic PDA defines all the CFL’s. ◆ But the deterministic version models parsers. ◗ Most programming languages have deterministic PDA’s. 3 Intuition : PDA ◆ Think of an εNFA with the additional power that it can manipulate a stack. ◆ Its moves are determined by: 1. The current state (of its “NFA”), 2. The current input symbol (or ε ), and 3. The current symbol on top of its stack. 4 Intuition : PDA – (2) ◆ Being nondeterministic, the PDA can have a choice of next moves. ◆ In each choice, the PDA can: 1. Change state, and also 2. Replace the top symbol on the stack by a sequence of zero or more symbols. ◆ Zero symbols = “pop.” ◆ Many symbols = sequence of “pushes.” 5 PDA Formalism ◆ A PDA is described by: 1. A finite set of states (Q, typically). 2. An input alphabet ( Σ , typically). 3. A stack alphabet ( Γ , typically). 4. A transition function ( δ , typically). 5. A start state (q , in Q, typically). 6. A start symbol (Z , in Γ , typically). 7. A set of final states (F ⊆ Q, typically). 6 Conventions ◆ a, b, … are input symbols. ◗ But sometimes we allow ε as a possible value. ◆ …, X, Y, Z are stack symbols. ◆ …, w, x, y, z are strings of input symbols. ◆ α , β ,… are strings of stack symbols. 7 The Transition Function ◆ Takes three arguments: 1. A state, in Q. 2. An input, which is either a symbol in Σ or ε . 3. A stack symbol in Γ ....
View
Full
Document
This note was uploaded on 03/30/2012 for the course CS 154 taught by Professor Motwani,r during the Spring '08 term at Stanford.
 Spring '08
 Motwani,R

Click to edit the document details