I have the following excercise:
Demostrate this grammar is ambiguous:
S-> bA | aB
A-> a | aS | bAA
B-> b | bS | aBB
By the theory that I've read a grammar can be ambiguous if:
1) A string W ∈ L(G), generates two differents trees
2) Makes 2 or more left/right derivations
So, i couldnt determinate a string that confirms 1)
, so i've
tryed with 2)
.For what i understand just need 2 reflexive derivations to get my grammar as ambiguous??
for example:
w=bbaa S->bA->bbAA->bbaA->bbaa
^^--here i made two reflexive/recursive derivation
Is this correct as i described or need more detailled information ?
PD: is there any tip for get strings that generates two threes ??