[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 5 end Derivable
- let x = 1 in y end Derivable
- let x = 1 in x end + x Derivable
- let x = 1 in let y = x in y end end Not derivable (declaration y = x not allowed)