Lec 15
Lec 15
Regular Grammar
All regular languages can be generated by CFGs.
Some nonregular languages can be generated by CFGs but not
all possible languages can be generated by CFG, e.g.
the CFG
S → aSb|ab generates the language {anbn:n=1,2,3, …},
which is nonregular.
Note: It is to be noted that for every FA, there exists a CFG that
generates the language accepted by this FA. Following is an
example in this regard
Example
Consider the language L expressed by
(a+b)*aa(a+b)*
the language of strings, defined over Σ ={a,b}, containing
aa.
aa
bb ʌ
S-- +
Example…
THEOREM 23