0

For the following context free grammar:

S --> (S) | SS | A

A --> a | A,A | E        (E is the empty string)

The formal definition is:

G=(V,T,P,S)

V={A,S}

T={E;a; ( ; ) ; , }

S=S

P:
S --> (S)
S --> SS
S --> A
A -->a

A -->A,A

A --> E    (E is the empty string)

How do i know if this grammar is ambiguous or not? Thank you.

Anderson Green
  • 30,230
  • 67
  • 195
  • 328
user2880113
  • 345
  • 1
  • 5
  • 13

1 Answers1

0

If it were ambiguous, it would suffice that you find a word that parses in multiple different ways. To prove that it is not ambigous, you might be able to use a more general proof and prove that this is a special case, of you could build a proof by induction based on some property of set of generated words.

See for an (albeit complicated) example here.

Community
  • 1
  • 1
ljgw
  • 2,751
  • 1
  • 20
  • 39