// Check that part names of every vertex are unique *operation* int check_part_names() *init* (@ 1 @) *traverse* *from* Cd_graph *to* Labeled *carry* *in* Adjacency* adj = (@ this @) *along* *from* Adjacency *to* Labeled *carry* *inout* int index *along* *from* Adjacency *to* Labeled *wrapper* Cd_graph *prefix* (@ cout << endl << "Checking that the part names of every vertex are unique ..." << endl; @) *wrapper* Adjacency *prefix* (@ index = 0; @) *wrapper* Labeled *prefix* (@ index++; if (adj->check_part_names1(this, index) > 1) { return_val = 0; } @) *operation* int check_part_names1(Labeled* l, int index1) *init* (@ 0 @) *traverse* *from* Adjacency *to* Labeled *carry* *in* Adjacency* adj = (@ this @) *along* *from* Adjacency *to* Labeled *carry* *inout* int index2 *along* *from* Adjacency *to* Labeled *wrapper* Adjacency *prefix* (@ index2 = 0; @) *wrapper* Labeled *prefix* (@ index2++; if (this->get_label_name()->g_equal(l->get_label_name())) { return_val++; if ((return_val > 1) && (index2 > index1)) { cout << "sem-check: error: near line " << this->get_label_name()->get_line_number() << " find nonunique parts:" << endl << "of "; adj->g_print(); cout << endl << "\t"; l->g_print(); cout << " from "; adj->get_source()->g_print(); cout << endl << "\t"; this->g_print(); cout << " from "; adj->get_source()->g_print(); cout << endl; } } @)