-------------------------------------------------------------------------- Object-oriented Systems Fall 1995 COM 3360/NTU SE737 --------------------------------------------------------------------------- Oct. 30, 1995 --------------------------------------------------------------------------- Midterm YOUR NAME: YOUR NAME: YOUR NAME: --------------------------------------------------------------------------- Open book and open notes. PLEASE GIVE YOUR ANSWERS ON THIS FORM Question 1: ================================================== UNKNOWN1 = StandardDirective | ExtendedDirective . UNKNOWN2 = < directive > Directive [ < implicitVertices > Directive ] [ < implicitEdges > Directive ] . UNKNOWN3 = Compound . UNKNOWN4 = Join | Merge | Intersection | Complement | ToStop . UNKNOWN5 = Intersection UNKNOWN6 = DirectiveName UNKNOWN7 = Simple | Compound . UNKNOWN8 = NOTHING UNKNOWN9 = NOTHING UNKNOWN10 = NOTHING UNKNOWN11 = NOTHING UNKNOWN12 = < arg > Directive . Question 2: ================================================== UNKNOWN1 = (. [A,B], [X,Y]) UNKNOWN2 = | UNKNOWN3 = [A, vertices A,B through, edges -> A,b,B bypassing Z] UNKNOWN4 = A UNKNOWN5 = A UNKNOWN6 = X UNKNOWN7 = A UNKNOWN8 = A UNKNOWN9 = [ A , vertices A , B bypassing , edges -> A , b , B through Z ] UNKNOWN10 = A UNKNOWN11 = A UNKNOWN12 = Y UNKNOWN13 = B UNKNOWN14 = Y UNKNOWN15 = B UNKNOWN16 = B UNKNOWN17 = Z UNKNOWN18 = Z UNKNOWN19 = 0 UNKNOWN20 = 1 UNKNOWN21 = 1 UNKNOWN22 = 1 UNKNOWN23 = 1 UNKNOWN24 = 1 UNKNOWN25 = 1 UNKNOWN26 = *operation* int check() *init* (@ 0 @) *wrapper* Merge (@ @) *wrapper* Intersection (@ @) *wrapper* Join (@ return_val = this -> check_join(); @) *operation* int check_join() // check whether target of ith directive // matches source of i+1 directive. *traverse* *from* Join // want top-level directives *to-stop* Directive_CommaList *wrapper* Directive_CommaList (@ Directive_list_iterator next_Directive(*this); Directive* each_Directive = next_Directive(); Vertex* target_previous = each_Directive -> target(); return_val = each_Directive -> well_formed(); while ( (each_Directive = next_Directive()) && return_val ) { if (((each_Directive->source()) ->g_equal(target_previous)) && each_Directive -> well_formed()) {target_previous = each_Directive -> target();} else {return_val = 0;} } @) Question 3: ================================================== UNKNOWN1 = Initialize vdefault differently ============================================================ < (@ static Vertex* vdefault = < new Vertex(new DemIdent("default")); --- > (@ static Vertex_List* vdefault = > new Vertex_List(new Vertex(new DemIdent("default"))); UNKNOWN2 = Change return type of source ============================================================ < *operation* Vertex* source() --- > *operation* Vertex_List* source() UNKNOWN3 = Change return type of target ============================================================ < *operation* Vertex* target() --- > *operation* Vertex_List* target() Question 4: ================================================== UNKNOWN1 = Through | Bypassing *common* GraphElements. GraphElements : Vertices | Edges. UNKNOWN2 = "(" CommaList(Vertex) ")" . UNKNOWN3 = "(" CommaList(Edge) ")". UNKNOWN4 = There is no change needed since the changes to the class dictionary do not influence the propagation graph in this case.