Pushdown Automata
Main Source:
- Book chapter 3.1, 3.2
- Neso Academy playlist 85-89
- Neso Academy playlist 91-93
PDA
A finite automaton has a very limited memory to keep track its computation. If we were to design an automaton that determine the length of string, a finite automaton wouldn't work. Pushdown Automata (PDA) is the extension of finite automaton that has more memory, specifically a stack memory with the LIFO principle. A PDA recognizes context-free languages governed by context-free grammar. Similar to finite automaton, it can either accept or reject the language.
Component of PDA:
- Input file/tape: Contains the input symbols that the PDA reads from left to right.
- Finite state control: The control unit of the PDA that determines its state.
- Pushdown store: It's the stack that is used to store symbols from the input tape. It has infinite size, and it allows for two stack operations: push (adding a symbol to the stack) and pop (removing the top symbol from the stack).
Source: Book page 160
Formal Definition
Formally, a PDA is defined as 7 tuples:
- is the finite set of states.
- is the finite set of input alphabet/symbols.
- (uppercase gamma) is the finite stack alphabet.
- is the transition function, where represent a power set. The power set contains all the possible combination of the pair of states and stack contents.
- is the initial or start state.
- is the initial or start stack symbol.
- is the set of accepting or final states.
The thing worth to note is the transition function, it takes the current state , input symbols , including the empty string , and the current topmost symbol of the stack