0

Is the following grammar ambiguous?

       S -> AS | ε

       A -> A1 | 0A1 | 01

It's seemed to me that they are ambiguious as

           A -> A1->0A11->00111

Again,

          A-> 0A1 ->0A11->00111

Am I right?

Light
  • 199
  • 1
  • 3
  • 9
  • Yes you are correct; see http://stackoverflow.com/questions/14091609/check-grammar-ambiguity – aaa Oct 28 '13 at 07:01

1 Answers1

0

Yes, you're right. It's ambiguous as there is more than one leftmost derivation for a given string.

kviiri
  • 3,282
  • 1
  • 21
  • 30