#include "pp.h" void computeTransitiveClosure(int n,int n2,char *matrix0) { char *matrix1 = new char[n2]; int i,j,k,t; t = 0; for (k = 0; k < n; k++) { for (i = 0; i < n; i++) for (j = 0; j < n; j++) { if (t) { if (matrix1[i*n+j] || (matrix1[i*n+k] && matrix1[k*n+j])) matrix0[i*n+j] = 1; else matrix0[i*n+j] = 0; } else { if (matrix0[i*n+j] || (matrix0[i*n+k] && matrix0[k*n+j])) matrix1[i*n+j] = 1; else matrix1[i*n+j] = 0; } } if (t) t = 0; else t = 1; } if (!t) { for (i = 0; i < n2; i++) matrix0[i] = matrix1[i]; } delete matrix1; } void Cd_graph::checkCustomizerRestrictions( Cd_graph* schema,Propagation_schema* ps,int flag ) { DEM_TRACE("Cd_graph","void Cd_graph::checkCustomizerRestrictions(Cd_graph* schema,Propagation_schema* ps,int flag)"); // prefix class wrappers // the current object is a propagation graph // schema is the class graph // the subclass invariance //cout << toolname << ": checking the Subclass Invariance Restriction ..." << endl; this->checkSubclassInvarianceRestriction(schema,ps,flag); // If there is an outgoing construction edge edge from an alternation vertex // the vertex must have at least one outgoing alternation edge unless it is // a target vertex this->checkInheritanceRestriction(ps); // suffix class wrappers } void Cd_graph::checkSubclassInvarianceRestriction( Cd_graph* schema,Propagation_schema* ps,int flag ) { DEM_TRACE("Cd_graph","void Cd_graph::checkSubclassInvarianceRestriction(Cd_graph* schema,Propagation_schema* ps,int flag)"); // prefix class wrappers int n = this->get_adjacencies()->list_length(); int n2 = n*n; int i,j,k; char *smatrix = new char[n2]; // subclass rel. on class graph char *pmatrix = new char[n2]; // subclass rel. on propagation graph. char *adjmatrix = new char[n2]; // adjacent char **snames = new char*[n]; // class graph char **pnames = new char*[n]; // propagation graph char *sourcenames = new char[n]; for (i = 0; i < n2; i++) { smatrix[i] = 0; pmatrix[i] = 0; adjmatrix[i] = 0; } for (i = 0; i < n; i++) { snames[i] = 0; sourcenames[i] = 0; } this->createNamelist(n,snames); for (i = 0; i < n; i++) pnames[i] = snames[i]; ps->get_paths()->createNamelist(n,pnames); this->markSubclassEdges(n,snames,smatrix); ps->markSubclassEdges(n,snames,pmatrix); computeTransitiveClosure(n,n2,smatrix); computeTransitiveClosure(n,n2,pmatrix); ps->get_source_port()->createSourcelist(n,snames,sourcenames); ps->markComposEdges(adjmatrix,n,snames,1); for (i = 0; i < n; i++) for (j = 0; j < n; j++) { if (smatrix[i*n+j] && !pmatrix[i*n+j]) { if (pnames[i] && pnames[j]) { for (k = 0; k < n; k++) if (adjmatrix[k,i]) break; if (k == n && !sourcenames[i]) continue; if (flag) derror('e',1, form(" the Subclass Invariance Restriction violated. From class '%s' to class '%s' there is an alternation path in the traversal graph but not in the transportation graph.",pnames[i],pnames[j])); else derror('e',1, form(" the Subclass Invariance Restriction violated. From class '%s' to class '%s' there is an alternation path in the class graph but not in the traversal graph.",pnames[i],pnames[j])); exit(-1); } } } delete smatrix; delete adjmatrix; delete pmatrix; for (j = 0; j < n; j++) { delete snames[j]; delete pnames[j]; } delete snames; delete sourcenames; delete pnames; // suffix class wrappers } void Propagation_schema::markSubclassEdges( int n,char* * names,char* matrix ) { DEM_TRACE("Propagation_schema","void Propagation_schema::markSubclassEdges(int n,char* * names,char* matrix)"); // prefix class wrappers paths->markSubclassEdges(n,names,matrix); // suffix class wrappers } void Cd_graph::markSubclassEdges( int n,char* * names,char* matrix ) { DEM_TRACE("Cd_graph","void Cd_graph::markSubclassEdges(int n,char* * names,char* matrix)"); // prefix class wrappers adjacencies->markSubclassEdges(n,names,matrix); // suffix class wrappers } void Adjacency_Nlist::markSubclassEdges( int n,char* * names,char* matrix ) { DEM_TRACE("Adjacency_Nlist","void Adjacency_Nlist::markSubclassEdges(int n,char* * names,char* matrix)"); // prefix class wrappers Adjacency_list_iterator next(*this); Adjacency* each; while (each = next()) { each->markSubclassEdges(n,names,matrix); } // suffix class wrappers } void Adjacency::markSubclassEdges( int n,char* * names,char* matrix ) { DEM_TRACE("Adjacency","void Adjacency::markSubclassEdges(int n,char* * names,char* matrix)"); // prefix class wrappers int r; for (int i = 0; i < n; i++) if (strcmp(names[i],source->get_vertex_name()->get_val())==0) { r = i; break; } ns->markSubclassEdges(n,names,matrix,r); // suffix class wrappers } void Neighbors::markSubclassEdges( int n,char* * names,char* matrix,int r ) { DEM_TRACE("Neighbors","void Neighbors::markSubclassEdges(int n,char* * names,char* matrix,int r)"); // prefix class wrappers // suffix class wrappers } void Neighbors_wc::markSubclassEdges( int n,char* * names,char* matrix,int r ) { DEM_TRACE("Neighbors_wc","void Neighbors_wc::markSubclassEdges(int n,char* * names,char* matrix,int r)"); // prefix class wrappers // suffix class wrappers } void Alternat_ns::markSubclassEdges( int n,char* * names,char* matrix,int r ) { DEM_TRACE("Alternat_ns","void Alternat_ns::markSubclassEdges(int n,char* * names,char* matrix,int r)"); // prefix class wrappers if (alternat_ns) alternat_ns->markSubclassEdges(n,names,matrix,r); // suffix class wrappers } void Term_Barlist::markSubclassEdges( int n,char* * names,char* matrix,int r ) { DEM_TRACE("Term_Barlist","void Term_Barlist::markSubclassEdges(int n,char* * names,char* matrix,int r)"); // prefix class wrappers Term_list_iterator next(*this); Term* each; while (each = next()) each->markSubclassEdges(n,names,matrix,r); // suffix class wrappers } void Term::markSubclassEdges( int n,char* * names,char* matrix,int r ) { DEM_TRACE("Term","void Term::markSubclassEdges(int n,char* * names,char* matrix,int r)"); // prefix class wrappers int c; for (int i = 0; i < n; i++) if (strcmp(names[i],vertex->get_vertex_name()->get_val())==0) { c = i; break; } matrix[ r*n + c ] = 1; // suffix class wrappers } void Vertex_selector::createSourcelist( int n,char* * names,char* snames ) { DEM_TRACE("Vertex_selector","void Vertex_selector::createSourcelist(int n,char* * names,char* snames)"); // prefix class wrappers // suffix class wrappers } void Vertex_set::createSourcelist( int n,char* * names,char* snames ) { DEM_TRACE("Vertex_set","void Vertex_set::createSourcelist(int n,char* * names,char* snames)"); // prefix class wrappers // suffix class wrappers } void Vertex_set_sim::createSourcelist( int n,char* * names,char* snames ) { DEM_TRACE("Vertex_set_sim","void Vertex_set_sim::createSourcelist(int n,char* * names,char* snames)"); // prefix class wrappers terms->createSourcelist(n, names,snames); // suffix class wrappers } void Fixed_term_Commalist::createSourcelist( int n,char* * names,char* snames ) { DEM_TRACE("Fixed_term_Commalist","void Fixed_term_Commalist::createSourcelist(int n,char* * names,char* snames)"); // prefix class wrappers Fixed_term_list_iterator next(*this); Fixed_term* each; while (each = next()) each->createSourcelist(n, names,snames); // suffix class wrappers } void Fixed_term::createSourcelist( int n,char* * names,char* snames ) { DEM_TRACE("Fixed_term","void Fixed_term::createSourcelist(int n,char* * names,char* snames)"); // prefix class wrappers vertex->createSourcelist(n, names,snames); // suffix class wrappers } void Term::createSourcelist( int n,char* * names,char* snames ) { DEM_TRACE("Term","void Term::createSourcelist(int n,char* * names,char* snames)"); // prefix class wrappers int i; for (i = 0; i < n; i++) if (strcmp(names[i],vertex->get_vertex_name()->get_val())== 0) break; snames[i] = 1; // suffix class wrappers } void Cd_graph::createNamelist( int n,char* * names ) { DEM_TRACE("Cd_graph","void Cd_graph::createNamelist(int n,char* * names)"); // prefix class wrappers adjacencies->createNamelist(n,names); // suffix class wrappers } void Adjacency_Nlist::createNamelist( int n,char* * names ) { DEM_TRACE("Adjacency_Nlist","void Adjacency_Nlist::createNamelist(int n,char* * names)"); // prefix class wrappers int c = 0; Adjacency_list_iterator next(*this); Adjacency* each; while (each = next()) { while (names[c]) if (strcmp(names[c],each->get_source()->get_vertex_name()->get_val())==0) break; else { names[c] = 0; c++; } each->createNamelist(n,names,c); c++; } for (int i = c; i < n; i++) names[i] = 0; // suffix class wrappers } void Adjacency::createNamelist( int n,char* * names,int c ) { DEM_TRACE("Adjacency","void Adjacency::createNamelist(int n,char* * names,int c)"); // prefix class wrappers source->createNamelist(n, names, c); // suffix class wrappers } void Vertex::createNamelist( int n,char* * names,int c ) { DEM_TRACE("Vertex","void Vertex::createNamelist(int n,char* * names,int c)"); // prefix class wrappers char *vname = vertex_name->get_val(); int vlen = strlen(vname); names[c] = new char[vlen+1]; sprintf(names[c],"%s",vname); // suffix class wrappers } void Cd_graph::checkTransportationRestrictions( Cd_graph* schema,Propagation_schema* ps,Vertex_selector* travSources,Vertex_selector* tranSources ) { DEM_TRACE("Cd_graph","void Cd_graph::checkTransportationRestrictions(Cd_graph* schema,Propagation_schema* ps,Vertex_selector* travSources,Vertex_selector* tranSources)"); // prefix class wrappers this->checkCustomizerRestrictions(schema,ps,1); // design rules checking // * sources of tranversal and transportation should not have // incoming transported edges // * no-sources not having traversal only edges adjacencies->checkTransportationRestrictions(schema,ps,travSources,tranSources); // suffix class wrappers } void Adjacency_Nlist::checkTransportationRestrictions( Cd_graph* schema,Propagation_schema* ps,Vertex_selector* travSources,Vertex_selector* tranSources ) { DEM_TRACE("Adjacency_Nlist","void Adjacency_Nlist::checkTransportationRestrictions(Cd_graph* schema,Propagation_schema* ps,Vertex_selector* travSources,Vertex_selector* tranSources)"); // prefix class wrappers Adjacency_list_iterator next(*this); Adjacency* each; while (each = next()) each->checkTransportationRestrictions(schema,ps,travSources,tranSources); // suffix class wrappers } void Adjacency::checkTransportationRestrictions( Cd_graph* schema,Propagation_schema* ps,Vertex_selector* travSources,Vertex_selector* tranSources ) { DEM_TRACE("Adjacency","void Adjacency::checkTransportationRestrictions(Cd_graph* schema,Propagation_schema* ps,Vertex_selector* travSources,Vertex_selector* tranSources)"); // prefix class wrappers static DemString * markc = new DemString("call"); int r = 0; if (superclasses) { Vertex_list_iterator next(*superclasses); Vertex* each; while (each = next()) { if (!markc->g_equal(each->get_call())) { Adjacency_list_iterator nexta(*schema->get_adjacencies()); Adjacency* eacha; while (eacha = nexta()) if (eacha->get_source()->equal(each)) break; assert(eacha); if (!eacha->noInhConsCallEdges()) { derror('e',1, form(" the Inheritance Restriction is violated. Inheritance edge ':> %s,%s' which is in the traversal graph but not in the transportation graph is not allowed, since '%s' has outgoing transporation edges which are inheritance/construction edges.", source->get_vertex_name()->get_val(), each->get_vertex_name()->get_val(), each->get_vertex_name()->get_val())); exit(-1); } } } } ns->checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Neighbors::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Neighbors","void Neighbors::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers // suffix class wrappers } void Neighbors_wc::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Neighbors_wc","void Neighbors_wc::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers // suffix class wrappers } void Construct_ns::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Construct_ns","void Construct_ns::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers this->get_construct_ns()-> checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Alternat_ns::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Alternat_ns","void Alternat_ns::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers this->get_construct_ns()-> checkTransportationRestrictions(schema,travSources,tranSources,source); if (alternat_ns) alternat_ns-> checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Repetit_n::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Repetit_n","void Repetit_n::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers if (sandwiched) sandwiched-> checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Any_vertex_List::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Any_vertex_List","void Any_vertex_List::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers Any_vertex_list_iterator next(*this); Any_vertex* each; while (each = next()) each->checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Any_vertex::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Any_vertex","void Any_vertex::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers // suffix class wrappers } void Optional_term::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Optional_term","void Optional_term::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers opt->checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Opt_labeled_term_Sandwich::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Opt_labeled_term_Sandwich","void Opt_labeled_term_Sandwich::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers inner->checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Opt_labeled_term::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Opt_labeled_term","void Opt_labeled_term::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers // suffix class wrappers } void Labeled::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Labeled","void Labeled::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers static DemString * markc = new DemString("call"); static DemString * marka = new DemString("propagate"); int r = 0; if (markc->g_equal(this->get_call())) { r = 0; travSources->contains(this->get_vertex()->get_vertex(),r); if (r) { derror('e',1, form(" the Traversal Source Restriction is violated. The transportation construction edge '-> %s,%s,%s' is not allowed, since '%s' is a traversal source.", source->get_vertex_name()->get_val(), this->get_label_name()->get_val(), this->get_vertex()->get_vertex()->get_vertex_name()->get_val(), this->get_vertex()->get_vertex()->get_vertex_name()->get_val())); exit(-1); } r = 0; tranSources->contains(this->get_vertex()->get_vertex(),r); if (r) { derror('e',1, form(" the Traversal Source Restriction is violated. The transportation construction edge '-> %s,%s,%s' is not allowed, since '%s' is a transportation source.", source->get_vertex_name()->get_val(), this->get_label_name()->get_val(), this->get_vertex()->get_vertex()->get_vertex_name()->get_val(), this->get_vertex()->get_vertex()->get_vertex_name()->get_val())); exit(-1); } } else { Adjacency_list_iterator nexta(*schema->get_adjacencies()); Adjacency* eacha; while (eacha = nexta()) if (eacha->get_source()->equal(this->get_vertex()->get_vertex())) break; assert(eacha); if (marka->g_equal(eacha->get_propagate())) { r = 0; tranSources->contains(eacha->get_source(),r); if (!r) { derror('e',1, form(" the Transportation Source Restriction is violated. The construction edge '-> %s,%s,%s' which is in the traversal graph but not in the transportation graph is not allowed, since '%s' is in the transporation graph but not a transportation source.", source->get_vertex_name()->get_val(), this->get_label_name()->get_val(), this->get_vertex()->get_vertex()->get_vertex_name()->get_val(), this->get_vertex()->get_vertex()->get_vertex_name()->get_val())); exit(-1); } } } // suffix class wrappers } void Regular::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Regular","void Regular::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers derror('i',1," unexpected visit at Regular::checkTransportationRestrictions\n"); exit(-1); // suffix class wrappers } void Term_Barlist::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Term_Barlist","void Term_Barlist::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers static DemString * markc = new DemString("call"); static DemString * marka = new DemString("propagate"); Term_list_iterator next(*this); Term* each; int r = 0; while (each = next()) { if (markc->g_equal(each->get_call())) { r = 0; travSources->contains(each->get_vertex(),r); if (r) { derror('e',1, form(" the Traversal Source Restriction is violated. The transportation alternation edge '=> %s,%s' is not allowed, since '%s' is a traversal source.", source->get_vertex_name()->get_val(), each->get_vertex()->get_vertex_name()->get_val(), each->get_vertex()->get_vertex_name()->get_val())); exit(-1); } r = 0; tranSources->contains(each->get_vertex(),r); if (r) { derror('e',1, form(" the Transportation Source Restriction is violated. The transportation alternation edge '=> %s,%s' is not allowed, since '%s' is a transportation source.", source->get_vertex_name()->get_val(), each->get_vertex()->get_vertex_name()->get_val(), each->get_vertex()->get_vertex_name()->get_val())); exit(-1); } } else { Adjacency_list_iterator nexta(*schema->get_adjacencies()); Adjacency* eacha; while (eacha = nexta()) if (eacha->get_source()->equal(each->get_vertex())) break; assert(eacha); if (marka->g_equal(eacha->get_propagate())) { r = 0; tranSources->contains(eacha->get_source(),r); if (!r) { derror('e',1, form(" the Transportation Source Restriction is violated. The alternation edge '=> %s,%s' which is in the traversal graph but not in the transportation graph is not allowed, since '%s' is in the transporation graph but not a transportation source.", source->get_vertex_name()->get_val(), each->get_vertex()->get_vertex_name()->get_val(), each->get_vertex()->get_vertex_name()->get_val())); exit(-1); } } } } // suffix class wrappers } void Kernel_Sandwich::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Kernel_Sandwich","void Kernel_Sandwich::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers inner->checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Kernel::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Kernel","void Kernel::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers repeated->checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Term_Sandwich::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Term_Sandwich","void Term_Sandwich::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers inner->checkTransportationRestrictions(schema,travSources,tranSources,source); // suffix class wrappers } void Term::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Term","void Term::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers // suffix class wrappers } void CppTerm::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("CppTerm","void CppTerm::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers derror('i',1," unexpected visit at CppTerm::checkTransportationRestrictions\n"); exit(-1); // suffix class wrappers } void Normal::checkTransportationRestrictions( Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source ) { DEM_TRACE("Normal","void Normal::checkTransportationRestrictions(Cd_graph* schema,Vertex_selector* travSources,Vertex_selector* tranSources,Vertex* source)"); // prefix class wrappers static DemString * markc = new DemString("call"); static DemString * marka = new DemString("propagate"); int r = 0; if (markc->g_equal(this->get_call())) { r = 0; travSources->contains(this->get_vertex(),r); if (r) { derror('e',1, form(" the Traversal Source Restriction is violated. The transportation repetition edge '-> %s,%s' is not allowed, since '%s' is a traversal source.", source->get_vertex_name()->get_val(), this->get_vertex()->get_vertex_name()->get_val(), this->get_vertex()->get_vertex_name()->get_val())); exit(-1); } r = 0; tranSources->contains(this->get_vertex(),r); if (r) { derror('e',1, form(" the Transportation Source Restriction is violated. The transportation repetition edge '~> %s,%s' is not allowed, since '%s' is a transportation source.", source->get_vertex_name()->get_val(), this->get_vertex()->get_vertex_name()->get_val(), this->get_vertex()->get_vertex_name()->get_val())); exit(-1); } } else { Adjacency_list_iterator nexta(*schema->get_adjacencies()); Adjacency* eacha; while (eacha = nexta()) if (eacha->get_source()->equal(this->get_vertex())) break; assert(eacha); if (marka->g_equal(eacha->get_propagate())) { r = 0; tranSources->contains(eacha->get_source(),r); if (!r) { derror('e',1, form(" the Transportation Source Restriction is violated. The repetition edge '~> %s,%s' which is in the traversal graph but not in the transportation graph is not allowed, since '%s' is in the transporation graph but not a transportation source.", source->get_vertex_name()->get_val(), this->get_vertex()->get_vertex_name()->get_val(), this->get_vertex()->get_vertex_name()->get_val())); exit(-1); } } } // suffix class wrappers } int Adjacency::noInhConsCallEdges( ) { DEM_TRACE("Adjacency","int Adjacency::noInhConsCallEdges()"); int return_val = 1 ; this->noInhConsCallEdges_( return_val ); return return_val; } void Adjacency::noInhConsCallEdges_( int& return_val ) { DEM_TRACE("Adjacency","void Adjacency::noInhConsCallEdges_(int& return_val)"); // prefix class wrappers static DemString * markc = new DemString("call"); int r = 0; if (superclasses) { Vertex_list_iterator next(*superclasses); Vertex* each; while (each = next()) { if (markc->g_equal(each->get_call())) { return_val = 0; return; } } } return_val = ns->noInhConsCallEdges(); // suffix class wrappers } int Neighbors::noInhConsCallEdges( ) { DEM_TRACE("Neighbors","int Neighbors::noInhConsCallEdges()"); int return_val = 1 ; this->noInhConsCallEdges_( return_val ); return return_val; } void Neighbors::noInhConsCallEdges_( int& return_val ) { DEM_TRACE("Neighbors","void Neighbors::noInhConsCallEdges_(int& return_val)"); // prefix class wrappers // suffix class wrappers } int Neighbors_wc::noInhConsCallEdges( ) { DEM_TRACE("Neighbors_wc","int Neighbors_wc::noInhConsCallEdges()"); int return_val = 1 ; this->noInhConsCallEdges_( return_val ); return return_val; } void Neighbors_wc::noInhConsCallEdges_( int& return_val ) { DEM_TRACE("Neighbors_wc","void Neighbors_wc::noInhConsCallEdges_(int& return_val)"); // prefix class wrappers return_val = this->get_construct_ns()->noInhConsCallEdges(); // suffix class wrappers } int Any_vertex_List::noInhConsCallEdges( ) { DEM_TRACE("Any_vertex_List","int Any_vertex_List::noInhConsCallEdges()"); int return_val = 1 ; this->noInhConsCallEdges_( return_val ); return return_val; } void Any_vertex_List::noInhConsCallEdges_( int& return_val ) { DEM_TRACE("Any_vertex_List","void Any_vertex_List::noInhConsCallEdges_(int& return_val)"); // prefix class wrappers Any_vertex_list_iterator next(*this); Any_vertex* each; while (each = next()) if (!each->noInhConsCallEdges()) { return_val = 0; return; } // suffix class wrappers } int Any_vertex::noInhConsCallEdges( ) { DEM_TRACE("Any_vertex","int Any_vertex::noInhConsCallEdges()"); int return_val = 1 ; this->noInhConsCallEdges_( return_val ); return return_val; } void Any_vertex::noInhConsCallEdges_( int& return_val ) { DEM_TRACE("Any_vertex","void Any_vertex::noInhConsCallEdges_(int& return_val)"); // prefix class wrappers // suffix class wrappers } int Optional_term::noInhConsCallEdges( ) { DEM_TRACE("Optional_term","int Optional_term::noInhConsCallEdges()"); int return_val = 1 ; this->noInhConsCallEdges_( return_val ); return return_val; } void Optional_term::noInhConsCallEdges_( int& return_val ) { DEM_TRACE("Optional_term","void Optional_term::noInhConsCallEdges_(int& return_val)"); // prefix class wrappers return_val = opt->noInhConsCallEdges(); // suffix class wrappers } int Opt_labeled_term_Sandwich::noInhConsCallEdges( ) { DEM_TRACE("Opt_labeled_term_Sandwich","int Opt_labeled_term_Sandwich::noInhConsCallEdges()"); int return_val = 1 ; this->noInhConsCallEdges_( return_val ); return return_val; } void Opt_labeled_term_Sandwich::noInhConsCallEdges_( int& return_val ) { DEM_TRACE("Opt_labeled_term_Sandwich","void Opt_labeled_term_Sandwich::noInhConsCallEdges_(int& return_val)"); // prefix class wrappers return_val = inner->noInhConsCallEdges(); // suffix class wrappers } int Opt_labeled_term::noInhConsCallEdges( ) { DEM_TRACE("Opt_labeled_term","int Opt_labeled_term::noInhConsCallEdges()"); int return_val = 1 ; this->noInhConsCallEdges_( return_val ); return return_val; } void Opt_labeled_term::noInhConsCallEdges_( int& return_val ) { DEM_TRACE("Opt_labeled_term","void Opt_labeled_term::noInhConsCallEdges_(int& return_val)"); // prefix class wrappers static DemString * markc = new DemString("call"); if (markc->g_equal(this->get_call())) return_val = 0; // suffix class wrappers } void Propagation_schema::markComposEdges( char* matrix,int n,char* * names,int v ) { DEM_TRACE("Propagation_schema","void Propagation_schema::markComposEdges(char* matrix,int n,char* * names,int v)"); // prefix class wrappers paths->markComposEdges(matrix, n, names, v); // suffix class wrappers } void Cd_graph::markComposEdges( char* matrix,int n,char* * names,int v ) { DEM_TRACE("Cd_graph","void Cd_graph::markComposEdges(char* matrix,int n,char* * names,int v)"); // prefix class wrappers adjacencies->markComposEdges(this,matrix,n,names,v); // suffix class wrappers } void Adjacency_Nlist::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int v ) { DEM_TRACE("Adjacency_Nlist","void Adjacency_Nlist::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int v)"); // prefix class wrappers Adjacency_list_iterator next(*this); Adjacency* each; while (each = next()) { each->markComposEdges(schema,matrix,n,names,v); } // suffix class wrappers } void Adjacency::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int v ) { DEM_TRACE("Adjacency","void Adjacency::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int v)"); // prefix class wrappers int r; for (int i = 0; i < n; i++) if (strcmp(names[i],source->get_vertex_name()->get_val())==0) { r = i; break; } ns->markComposEdges(schema,matrix,n,names,r,v); if (superclasses) superclasses->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Adjacency::markComposEdgesInh( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Adjacency","void Adjacency::markComposEdgesInh(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers ns->markComposEdgesInh(schema,matrix,n,names,r,v); if (superclasses) superclasses->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Neighbors::markComposEdgesInh( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Neighbors","void Neighbors::markComposEdgesInh(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers // suffix class wrappers } void Neighbors_wc::markComposEdgesInh( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Neighbors_wc","void Neighbors_wc::markComposEdgesInh(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers this->get_construct_ns()->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Vertex_List::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Vertex_List","void Vertex_List::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers Vertex_list_iterator nextv(*this); Vertex* eachv; while (eachv = nextv()) { Adjacency_list_iterator nexta(*schema->get_adjacencies()); Adjacency* eacha; while (eacha = nexta()) { if (eacha->get_source()->equal(eachv)) break; } assert(eacha); eacha->markComposEdgesInh(schema,matrix,n,names,r,v); } // suffix class wrappers } void Neighbors::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Neighbors","void Neighbors::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers // suffix class wrappers } void Neighbors_wc::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Neighbors_wc","void Neighbors_wc::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers this->get_construct_ns()->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Repetit_n::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Repetit_n","void Repetit_n::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers if (this->get_sandwiched()) this->get_sandwiched()->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Alternat_ns::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Alternat_ns","void Alternat_ns::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers if (alternat_ns) alternat_ns->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Term_Barlist::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Term_Barlist","void Term_Barlist::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers Term_list_iterator next(*this); Term* each; while (each = next()) each->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Kernel_Sandwich::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Kernel_Sandwich","void Kernel_Sandwich::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers inner->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Kernel::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Kernel","void Kernel::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers repeated->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Term_Sandwich::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Term_Sandwich","void Term_Sandwich::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers inner->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Any_vertex_List::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Any_vertex_List","void Any_vertex_List::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers Any_vertex_list_iterator next(*this); Any_vertex* each; while (each = next()) each->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Any_vertex::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Any_vertex","void Any_vertex::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers // suffix class wrappers } void Opt_labeled_term::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Opt_labeled_term","void Opt_labeled_term::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers vertex->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Optional_term::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Optional_term","void Optional_term::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers opt->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Opt_labeled_term_Sandwich::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Opt_labeled_term_Sandwich","void Opt_labeled_term_Sandwich::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers inner->markComposEdges(schema,matrix,n,names,r,v); // suffix class wrappers } void Term::markComposEdges( Cd_graph* schema,char* matrix,int n,char* * names,int r,int v ) { DEM_TRACE("Term","void Term::markComposEdges(Cd_graph* schema,char* matrix,int n,char* * names,int r,int v)"); // prefix class wrappers int c; for (int i = 0; i < n; i++) if (strcmp(names[i],vertex->get_vertex_name()->get_val())==0) { c = i; break; } if (matrix[ r*n + c ] == 1) matrix[ r*n + c ] = 3; else matrix[ r*n + c ] = v; // suffix class wrappers }