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
T : bool
T : structure a: int;
T : structure a: pointer to T; b: int;
T : structure c: pointer to T; a: int;
T : structure a: function of T returns T; ;
T : structure b: function of T returns bool; ;
T : array of T
T : array of T
Q Which types are structurally equivalent? Show the step by step table
Q
VAR
x : T;
y : T;
u : T;
v : T;
z w : pointer to T;
p : pointer to T;
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 yc;
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
