0

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) ?

Raphael
  • 72,336
  • 29
  • 179
  • 389
gpuguy
  • 1,799
  • 3
  • 22
  • 32

1 Answers1

1

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'.

Subhayan
  • 1,696
  • 10
  • 19
  • How much stack is available in PDA? – gpuguy Sep 09 '13 at 09:58
  • the size of the stack is unbounded – Subhayan Sep 09 '13 at 10:00
  • ok, got it. but asking just out of curiosity how is this practical when it has infinite memory? – gpuguy Sep 09 '13 at 10:02
  • 1
    i am not really sure, but the answer i generally give is "you are in the realms of theory ! practice confines you, theory can set you free :) " – Subhayan Sep 09 '13 at 10:06
  • footnote: $\Sigma \subseteq \Gamma$. – Subhayan Sep 09 '13 at 10:07
  • 2
    @gpuguy: It is not practical. In practice, if the universe contains only a finite amount of information storage capacity, then every machine we can build is finite-state. In the absence of theories of physics that allow for unbounded information, the main reason to use machine models beyond DFA/NFA is that they are more expressive. – András Salamon Sep 09 '13 at 10:30
  • Finite automata can easily simulate finitely bounded stacks. Using stacks may still yield to "nicer" (e.g. smaller) automata. – Raphael Sep 09 '13 at 12:45
  • This answer doesn't answer the question. What you need to show is that there exist CFLs for which in every recognizing PDA, the maximum required stack size during recognition grows beyond any fixed bound. Which is already the case for $a^nb^n$. – reinierpost Sep 11 '13 at 13:27