In the theory of computation, a branch of theoretical computer science, a pushdown automaton (PDA) is a type of automaton that employs a stack.
Pushdown automata are used in theories about what can be computed by machines. They are more capable than finite-state machines but less capable than Turing machines. Deterministic pushdown automata can recognize all deterministic context-free languages while nondeterministic ones can recognize all context-free languages, with the former often used in parser design.
The term “pushdown” refers to the fact that the stack can be regarded as being “pushed down” like a tray dispenser at a cafeteria, since the operations never work on elements other than the top element. A stack automaton, by contrast, does allow access to and operations on deeper elements. Stack automata can recognize a strictly larger set of languages than pushdown automata. A nested stack automaton allows full access, and also allows stacked values to be entire sub-stacks rather than just single finite symbols.
A finite-state machine just looks at the input signal and the current state: it has no stack to work with. It chooses a new state, the result of following the transition. A pushdown automaton (PDA) differs from a finite state machine in two ways:
- It can use the top of the stack to decide which transition to take.
- It can manipulate the stack as part of performing a transition.
A pushdown automaton reads a given input string from left to right. In each step, it chooses a transition by indexing a table by input symbol, current state, and the symbol at the top of the stack. A pushdown automaton can also manipulate the stack, as part of performing a transition. The manipulation can be to push a particular symbol to the top of the stack, or to pop off the top of the stack. The automaton can alternatively ignore the stack, and leave it as it is.
Put together: Given an input symbol, current state, and stack symbol, the automaton can follow a transition to another state, and optionally manipulate (push or pop) the stack.
If, in every situation, at most one such transition action is possible, then the automaton is called a deterministic pushdown automaton (DPDA). In general, if several actions are possible, then the automaton is called a general, or nondeterministic, PDA. A given input string may drive a nondeterministic pushdown automaton to one of several configuration sequences; if one of them leads to an accepting configuration after reading the complete input string, the latter is said to belong to the language accepted by the automaton.
- ^ Jump up to:ab c John E. Hopcroft; Jeffrey D. Ullman (1967). “Nonerasing Stack Automata”. Journal of Computer and System Sciences. 1 (2): 166–186. doi:10.1016/s0022-0000(67)80013-8.
- ^ Jump up to:ab c d e f John E. Hopcroft and Jeffrey D. Ullman (1979). Introduction to Automata Theory, Languages, and Computation. Reading/MA: Addison-Wesley. ISBN 0-201-02988-X.
- ^John E. Hopcroft; Rajeev Motwani; Jeffrey D. Ullman (2003). Introduction to Automata Theory, Languages, and Computation. Addison Wesley. Here: Sect.6.4.3, p.249
- ^Seymour Ginsburg, Sheila A. Greibach and Michael A. Harrison (1967). “Stack Automata and Compiling”. J. ACM. 14 (1): 172–201. doi:10.1145/321371.321385.
- ^Seymour Ginsburg, Sheila A. Greibach and Michael A. Harrison (1967). “One-Way Stack Automata”. J. ACM. 14 (2): 389–418. doi:10.1145/321386.321403.
- ^Chandra, Ashok K.; Kozen, Dexter C.; Stockmeyer, Larry J. (1981). “Alternation”. Journal of the ACM. 28 (1): 114–133. doi:10.1145/322234.322243. ISSN 0004-5411.
- ^Ladner, Richard E.; Lipton, Richard J.; Stockmeyer, Larry J. (1984). “Alternating Pushdown and Stack Automata”. SIAM Journal on Computing. 13 (1): 135–155. doi:10.1137/0213010. ISSN 0097-5397.
- ^Aizikowitz, Tamar; Kaminski, Michael (2011). “LR(0) Conjunctive Grammars and Deterministic Synchronized Alternating Pushdown Automata”. Computer Science – Theory and Applications. Lecture Notes in Computer Science. 6651. pp. 345–358. doi:10.1007/978-3-642-20712-9_27. ISBN 978-3-642-20711-2. ISSN 0302-9743.
- Michael Sipser (1997). Introduction to the Theory of Computation. PWS Publishing. ISBN 0-534-94728-X.Section 2.2: Pushdown Automata, pp. 101–114.
- Jean-Michel Autebert, Jean Berstel, Luc Boasson, Context-Free Languages and Push-Down Automata, in: G. Rozenberg, A. Salomaa (eds.), Handbook of Formal Languages, Vol. 1, Springer-Verlag, 1997, 111-174.