[Points 4]
Consider the mini language of expressions seen in class, defined by the grammar
Exp ::= Num | Ide | Exp Op Exp | let Ide = Num in Exp end
Op ::= + | * | - | /
where Num and Ide are defined as usual. For each of the following expressions, say
whether or not they are derivable from this grammar. (Note: you are not requested to say whether
an expression is "correct", but only whether it can be derived from the grammar.)
- let x = 1 in let y = x + 2 in y end Not derivable
- let x = 1 in y + x end Derivable
- let x = 1 in x end + let y = 2 in x end Derivable
- let x = 1 + let y = 2 in x + y end end Not derivable