Question: 2 Is it a Subtype? Task 2 . 1 ( 1 5 points ) . For each pair of types 1 ? ? 2 below,

2 Is it a Subtype?
Task 2.1(15 points).
For each pair of types 1??2 below, say whether it is safe for 1 type to be considered a subtype of 2.
Your answer should start with a clear "yes" or "no"(or "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
2 Is it a Subtype? Task 2 . 1 ( 1 5 points ) .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!