What are some common ways to determine if a grammar is ambiguous or not? What are some common attributes that ambiguous grammars have?
For example, consider the following Grammar G:
$S \rightarrow S(E)|E$
$E \rightarrow (S)E|0|1|\epsilon$
My guess is that this grammar is not ambiguous, because of the parentheses I could not make an equivalent strings with distinct parse trees. I could have easily made a mistake since I am new to this. What are some common enumeration techniques for attempting to construct the same string with different parse trees?
- How can I know that I am right or wrong?
- What are common attributes of ambiguous grammars?
- How could I prove this to myself intuitively?
- How could I prove this with formal mathematics?