Download attributed graph-based representations for software view generation

Transcript
129
If there exists a node of one set that does not have a similar correspondent
in the other set then, n1 and n2 are not similar.
Checking set similarity is the same as checking set equality. An operation
can check if for every element of a set, there is a similar node in the other
set. Recall that record elds are represented by o nodes whose similarity
can be checked as described before, in this section.
Other types
This subgroup includes types dened by referencing other entities. It includes
types dened to be the same as previously dened types, subrange types, enumerated types, set types, pointer types, and array types. For example, consider
the following Pascal type denitions:
index1 = 1 .. 10;
index2 = 'a' .. 'z';
list = array [index1, index2 ] of integer;
The subrange type index1 is dened by referencing the constants 1 and 10;
the subrange index2 is dened by referencing the constants 'a' and 'z'; and
the array type list is dened by referencing the types index1, index2, and
integer. Except for enumerated types, the order of references is important in
these denitions and must be taken into consideration when contrasting two
nodes representing entities of this subgroup.
Two nodes n1 and n2 are similar if
1. n1 and n2 have the same name and subclass attributes and
2. if < r1; r2; ; rn > is the sequence of nodes adjacent to n1 by r edges
and < r1; r2; ; rm > is the sequence of nodes adjacent to n2 by r edges
then, m = n and 8i; 1 i n, ri is similar to r0i .
0
0
0
In SCAN , a contrasting operation can check these conditions as follows: