Question: 2 Is it a Subtype? Task 2 . 1 ( 1 5 points ) . For each pair of types 1 ? ? 2 below,
Is it a Subtype?
Task points
For each pair of types below, say whether it is safe for type to be considered a subtype of
Your answer should start with a clear "yes" or noor "safe"unsafe or similar but also explain your answer briefly but clearly. Note that this is not asking you whether the subtyping relation is allowed by the rules we gave in class: if a particular pair below is correct from the rules we gave in class, this is definitely safe as we proved the rules sound; however, there are other safe subtyping relations we didn't talk about in class. Think about the various intuitive explanations we gave for what it means to be a subtype.
int nat
int real where real is the type of real numbers
int nat string int int
int string string int int
bool unit unit unit
unit bool
bool nat
int : unit
void : unit
int int nat int
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
