I have a question to make the environment of if true then x else y
not closed, closed but not well typed, and closed and well typed. How can I do this in OCaml?
All I know is that not closed means that there is a variable that is not bound. So x and y will not be bound in this case. Additionally, well typed means that the expression satisfies the grammar.
Im not sure how to apply that here however and I only have very wrong answers. Maybe something like:
if (x:int, y:int) then (true) else (false)
if (x:int, y: int) then (x: bool) else (y: bool)
if (true) then (x: int) else (y: int)
for the 3 conditional respectively