[Points 30]
Consider the following grammar for "boolean expressions":
BExp ::= true | false | not BExp | BExp and BExp | BExp -> BExp
- Show that this grammar is ambiguous
- Define a non-ambiguous grammar for the same language by enforcing the
following conventions:
- "not" has priority over "and", and "and" has priority over "->"
- "and" is left-associative, and "->" is right-associative.