Question: Consider the following type declarations: TYPE T 1 : bool T 2 : structure { a: int; } T 3 : structure { a: pointer

Consider the following type declarations:
TYPE
T1 : bool
T2 : structure {a: int;}
T3 : structure {a: pointer to T5; b: int;}
T4 : structure {c: pointer to T6; a: int;}
T5 : structure { a: function of T7 returns T1; };
T6 : structure { b: function of T8 returns bool; };
T7 : array [1][6] of T3
T8 : array [1][6] of T4
Q1. Which types are structurally equivalent? Show the step by step table
Q2.
VAR
x : T3;
y : T4;
u : T5;
v : T5;
z, w : pointer to T2;
p : pointer to T5;
Assume that assignments between variables are allowed
if the types of the variables are equivalent. For each of the following, list all type
equivalence schemes under which the expression is valid. Consider name equivalence, internal name equivalence, and structural equivalence for each case. Assume that if two variables are equivalent under name equivalence, they are also equivalent under internal name equivalence.
x = y;
u = v;
w = z;
p = y.c;

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 Programming Questions!