1 / 14

Pushdown Automata

Pushdown Automata. PDA. Informally: A PDA is an ε-NFA with a stack. Transitions are modified to accommodate stack operations. A DFA can “remember” only a finite amount of information, whereas a PDA can “remember” an infinite amount of (certain types of) information. PDA. PDA.

chelsa
Télécharger la présentation

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. Pushdown Automata

  2. PDA • Informally: • A PDA is an ε-NFA with a stack. • Transitions are modified to accommodate stack operations. • A DFA can “remember” only a finite amount of information, whereas a PDA can “remember” an infinite amount of (certain types of) information.

  3. PDA

  4. PDA • In one transition, the PDA

  5. Q: A finite set of states. • S : A finite set of input symbols. • G: A finite stack alphabet. • d: The transition function with input: • qi is a state in Q. • a is a symbol in S or a = e (the empty string). • X is a stack symbol, X ÎG. • and the output is a finite set of pairs: • p the new state. • γis the string of stack symbols that replaces X at the top of the stack. • q0: The start state. • Z0: Initially, the PDA’s stack consists this symbol and nothing else. • F : The set of accepting states. • PDA is a seven-tuple: M = (Q, Σ, G, δ, q0, Z0, F)

  6. PDA Example: The language, Lwwr, is the even-length palindromes over alphabet {0,1}. Let’s design a PDA for this language.

  7. A Graphical Notation for PDA’s • The nodes correspond to the states of the PDA. • An arrow labeled Start indicates the unique start state. • Doubly circled states are accepting states. • Edges correspond to transitions in the PDA as follows: An edge labeled a, X/ αfrom state q to state p means that d(q, a, X)contains the pair (p, α), perhaps among other pairs. The only other thing that the diagram does not tell us is which stack symbol is the start symbol. Conventionally, it is Z0, unless we indicate otherwise.

  8. q0 q1 q2 PDA for wwr (0, 0)/00 (0, 1)/01 (1, 0)/10 (1, 1)/11 0,0/ε 1,1/ε 0, Z0/0Z0 1, Z0/1Z0 start ε, Z0/ Z0 ε, Z0/ Z0 ε, 0/ 0 ε, 1 / 1

  9. Configurations • A configuration fully describes the current “state” of the PDA. • The current state q. • The remaining input w. • The current stack contents γ. • Thus, a configuration is a triple (q, w, γ)  (Q, *, *). Such a triple is called an Instantaneous Description(ID) of the pushdown automata.

  10. Acceptance of 1111 by the PDA • q0,1111,Z0q0, 111, 1Z0 q0, 11, 11Z0 q0, 11, 11Z0 q1, 11, 11Z0 q1, 1, 1Z0 q1, ε, Z0 q2, ε, Z0 Accepted.

  11. Thank You

More Related