This is very much clear to me that an FSM has limited memory (sufficient to store present state). How do I prove that (intutively or otherwise) that a CFL has more memory than a DFA or NFA (thus making a CFL more powerful than FA) ?
1 Answers
There's a small mistake in your question.
The FSM (DFA or NFA) are machines that accept regular languages.
the CFL is also a language.
They are accepted by a machine called PDA (PushDown Automata) which you can think of as a generalization of the a DFA/NFA.
A PDA is like a NFA but in addition, it also has a stack. So it can accept (context free) languages like $L = \{0^p1^p | p \geq 0\}$
Its fairly easy to show that the PDA is more powerful than DFA.. (see it accepts $L$ that the DFA cannot)
We will show something stronger, i.e. formally define the construction of the PDA that will show that any language accepted by some DFA is also accepted by some PDA .
a PDA is 6 tuple $(Q, \Sigma, \Gamma, \delta, q_0, F )$, where,
- $Q$ is the set of states
- $\Sigma$ is the input alphabet,
- $\Gamma$ is the stack alphabet,
- $\delta$ is the transition func. $\delta:(Q \times \Sigma_\epsilon \times \Gamma_\epsilon) \rightarrow \mathcal{P}(Q\times \Gamma_\epsilon)$ ,
- $q_0 \in Q$,
- $F \subseteq Q$
now observe that a DFA/NFA is just the same thing where $\Gamma$ is always 'empty'.
- 1,696
- 10
- 19