next up previous
Next: Simplification of CFG Up: CONTEXT-FREE LANGUAGES Previous: Derivation Trees

Regular Grammar

Let tex2html_wrap_inline336 be a CFG. G is called a regular grammmar if every production takes one of the three forms
tex2html_wrap_inline364
tex2html_wrap_inline366
tex2html_wrap_inline368
where tex2html_wrap_inline367 .

figure75

tex2html_wrap_inline372
tex2html_wrap_inline374 .

G: tex2html_wrap_inline378

figure86


a-a-a has two trees
G is AMBIGUOUS.

Def. A CFG G is ambiguous if there is at least one string in L(G) having two or more drivation trees.

Def. A CFL is inherently ambiguous for which every CFG is ambiguous.

e.g.

tex2html_wrap_inline390

tex2html_wrap_inline392

tex2html_wrap_inline394 is inherently ambiguous.

tex2html_wrap_inline396 has two trees.



Sushil Prasad
Tue Jul 14 11:59:47 EDT 1998