Equivalence Types:
There are two basic forms of equivalency, name equivalency and structural equivalency.
According to name equivalency, we can say that two types are equivalent if they are declared to be of the same built-in types or the same programmer-named type. This is a simple definition, created by the syntax and semantics of specific programming languages, but why are they defined this way? What are the underlying reasons for name equivalency? That's where structural equivalency comes into play.
Structural equivalency is where the definitions get much more complicated. When we got to this point in Dr. Bazzi's class, he projected a sheet of information onto the board that looked more to me like Math than Computer Science. I quickly copied down five definitions of structural equivalency.
The following are the limitations that Computer languages must follow when defining their variable's equivalency rules, called permissive structural equivalency.
We can say T1 and T2 are structurally equivalent if
1. T1 and T2 are the same basic type
2. T1 = pointer to t1
T2 = pointer to t2
3. T1 = struct {
a : t1;
a2 : t2
}
T2 = struct {
a : t1
a2 : t2
}
and ti is tructurally equivalent to t'i for i'=1 to k
4. T1 is array range1 of t1
T2 is array range2 of t2
AND
a) range1 and range2 have (1) the same number of dimensions and (2) the same number of entries in each dimension
b) t1 and t2 are structurally equivalent
5. T1 = fuction of (t1, t2, ... tk) returns t
T2 = function of (t'1, t'2, ... t'l) returns t'
AND
a) is structurally equivalent to t'i and
b) t is structurally equivalent to t'
It's amazing how much Computer Science is similar to Math. As Dr. Bazzi told me in our first meeting, "Math is very important. Computer Science is just another way to write Math."
I enjoyed getting a glimpse into the world of a Computer Science student at ASU, and I hope you enjoyed reading about it. Stay tuned!
-Jeff
That is very interesting to know the term of permissive structural equivalency.
ReplyDeleteMath might be very helpful in improving algorithm.