Is it possible for an ambiguous CFG convert into CNF and becomes unambiguous?

1.2k views Asked by At

Is it possible for an ambiguous context-free grammar(CFG) to convert into Chomsky Normal Form(CNF) and becomes unambiguous?

1

There are 1 answers

2
Patrick87 On BEST ANSWER

Sure. All you really need is a single example to show this is possible. Consider the ambiguous grammar

S :- A | B
A :- a
B :- a

This grammar is equivalent to the following grammar in CNF

S :- a

This grammar is not ambiguous.