Changeset acbabee for src/dgp/dgp1.cc


Ignore:
Timestamp:
12/17/14 12:13:11 (9 years ago)
Author:
Tomasz Obrebski <obrebski@…>
Branches:
master
Children:
854bece
Parents:
d484a32
git-author:
Tomasz Obrebski <obrebski@…> (12/17/14 12:10:45)
git-committer:
Tomasz Obrebski <obrebski@…> (12/17/14 12:13:11)
Message:

many changes, mainly dgp1 algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/dgp/dgp1.cc

    rd484a32 racbabee  
    22using namespace std; 
    33 
    4 #include "dgp0.hh" 
     4#include "dgp1.hh" 
    55#include "global.hh" 
    66 
     
    7171//==================================================================================================== 
    7272 
    73 int find_existing_node(int mnodeind, NodeProp p, bitset<MAXNODES>& newheadLH, bitset<MAXNODES>& newheadLV) 
    74 { 
    75   MNode& mnode = mgraph[mnodeind]; 
    76   int ret=-1; 
    77   for(vector<int>::iterator ps=mnode.snodes.begin(); ps!=mnode.snodes.end(); ++ps) 
    78     { 
    79       if(debug) fprintf(stderr,"#find existing node: checking %d ... \n", *ps); 
    80       if(sgraph[*ps].prop==p) 
    81         if(sgraph[*ps].LH==newheadLH && sgraph[*ps].LV==newheadLV) 
    82           { 
    83             ret = *ps; 
    84             if(debug) fprintf(stderr,"#\tsucceeded because of LH/LV equality ()\n"); 
    85           } 
    86         else 
    87           { 
    88             if(debug) fprintf(stderr,"#\tfailed beacause of LH/LV inequality\n"); 
    89           } 
    90     } 
    91  
    92   if(debug) fprintf(stderr,"\n"); 
    93   return ret; 
     73int find_existing_node(int mnode, NodeProp p, Edge e) 
     74{ 
     75  for(vector<int>::iterator i = mgraph[mnode].snodes.begin(); i!=mgraph[mnode].snodes.end(); ++i) 
     76    if(sgraph[*i].prop==p && sgraph[*i].edge==e) 
     77      {  
     78        if(debug) fprintf(stderr,"\t\treusing %d\n",*i); 
     79        return *i; 
     80      } 
     81  return -1; 
    9482} 
    9583 
     
    161149//==================================================================================================== 
    162150 
    163 int create_new_head_node_left(int anc, NodeProp& prop, bitset<MAXNODES>& LH, bitset<MAXNODES>& LD, bitset<MAXNODES>& LV) 
    164 { 
    165   int newheadind = sgraph.clone(anc,prop); 
     151int create_new_node(int anc, NodeProp& prop, Edge edge) 
     152{ 
     153  int newheadind = sgraph.clone(anc,prop,edge); 
    166154  nodelist.push_back(newheadind); 
    167   sgraph[newheadind].LH = LH; 
    168   sgraph[newheadind].LD = LD; 
    169   sgraph[newheadind].in_LH = true; 
    170   sgraph[newheadind].LV.reset(); 
    171  
    172155  copy_links(anc,newheadind); 
    173156  create_reverse_links(newheadind); 
    174    
    175   if(debug) sgraph.print_node_debug(stderr,"add new",newheadind,anc); 
     157  if(debug) sgraph.print_node_debug(stderr,"clone",newheadind,anc); 
    176158  // if(debug) print_sets(newheadind); 
    177159  return newheadind; 
    178160} 
    179161 
    180 int create_new_dep_node_left(int anc, NodeProp& prop, bitset<MAXNODES>& LH, bitset<MAXNODES>& LD, bitset<MAXNODES>& LV) 
    181 { 
    182   int newind = sgraph.clone(anc,prop); 
    183   nodelist.push_back(newind); 
    184   sgraph[newind].LH.reset(); 
    185   sgraph[newind].LD=LD; 
    186   sgraph[newind].in_LH=false; //??????? 
    187   sgraph[newind].LV.reset(); 
    188  
    189   copy_links(anc,newind); 
    190   create_reverse_links(newind); 
    191    
    192   if(debug) sgraph.print_node_debug(stderr,"add new",newind,anc); 
    193   // if(debug) print_sets(newind); 
    194    
    195   return newind; 
    196 } 
    197  
    198 int create_new_head_node_right(int anc, NodeProp& prop, bitset<MAXNODES>& newheadLH, bitset<MAXNODES>& newheadLD, bitset<MAXNODES>& newheadLV) 
    199 { 
    200   int newheadind = sgraph.clone(anc,prop); 
    201   nodelist.push_back(newheadind); 
    202   sgraph[newheadind].LH=newheadLH; 
    203   sgraph[newheadind].LD=newheadLD; 
    204   sgraph[newheadind].in_LH=false; 
    205   sgraph[newheadind].LV=newheadLV; 
    206    
    207   copy_links(anc,newheadind); 
    208   create_reverse_links(newheadind); 
    209  
    210   if(debug) sgraph.print_node_debug(stderr,"add new",newheadind,anc); 
    211   // if(debug) print_sets(newheadind); 
    212    
    213   return newheadind; 
    214 } 
    215  
    216 int create_new_dep_node_right(int anc, NodeProp& prop, bitset<MAXNODES>& LH, bitset<MAXNODES>& LD, bitset<MAXNODES>& LV) 
    217 { 
    218   int newind = sgraph.clone(anc,prop); 
    219   nodelist.push_back(newind); 
    220   sgraph[newind].LH=LH; 
    221   sgraph[newind].LD=LD; 
    222   sgraph[newind].in_LH=true; //??????? 
    223   sgraph[newind].LV.reset(); 
    224    
    225   copy_links(anc,newind); 
    226   create_reverse_links(newind); 
    227  
    228   if(debug) sgraph.print_node_debug(stderr,"ADD NEW",newind,anc); 
    229   // if(debug) print_sets(newind); 
    230    
    231   return newind; 
    232 } 
    233  
    234162//==================================================================================================== 
    235163 
     
    237165{ 
    238166 
    239   NodeProp &oldheadprop = sgraph[h].prop; 
    240   NodeProp &olddepprop = sgraph[d].prop; 
    241  
    242   NodeProp newheadprop  = compute_head_prop(oldheadprop,l,new_head_boubbles,olddepprop.flags); 
    243    
    244   int newheadind; 
    245   if(oldheadprop==newheadprop) 
    246     newheadind = h; 
    247   else 
    248   { 
    249     bitset<MAXNODES> newheadLH = sgraph[h].LH; 
    250     bitset<MAXNODES> newheadLV = sgraph[d].LV; 
    251     bitset<MAXNODES> newheadLD = sgraph[h].LD; 
    252  
    253     newheadind = find_existing_node(sgraph[h].mnode, newheadprop, newheadLH, newheadLV); 
    254     if( newheadind >= 0) // W£¡CZONE 
    255       sgraph[newheadind].LD |= newheadLD; 
    256     else 
     167  NodeProp &old_head_prop = sgraph[h].prop; 
     168  NodeProp &old_dep_prop = sgraph[d].prop; 
     169  NodeProp new_head_prop  = compute_head_prop(old_head_prop,l,new_head_boubbles,old_dep_prop.flags); 
     170  NodeProp new_dep_prop = compute_dep_prop(old_dep_prop,l,new_dep_boubbles); 
     171   
     172  Edge new_dep_edge(sgraph[d].edge); 
     173  int newd = find_existing_node(sgraph[d].mnode, new_dep_prop, new_dep_edge); 
     174  if( newd < 0  ) 
     175    newd = create_new_node(d,new_dep_prop,new_dep_edge); 
     176   
     177  Edge new_head_edge(sgraph[newd].edge,newd); 
     178  int newh = find_existing_node(sgraph[h].mnode, new_head_prop, new_head_edge); 
     179  if( newh < 0 ) 
     180    newh = create_new_node(h,new_head_prop,new_head_edge); 
     181     
     182  sgraph[newh].deps.push_back(Arc(newd,l.role,h,d)); 
     183  sgraph[newd].heads.push_back(Arc(newh,l.role,h,d)); 
     184 
     185  if(debug) 
     186    { 
     187      sgraph.print_arc(stderr,"link",newh,d,l.role,0); 
     188      sgraph.print_node_debug(stderr,"",newh,h); 
     189      sgraph.print_node_debug(stderr,"",newd,d); 
     190    } 
     191} 
     192 
     193//---------------------------------------------------------------------------------------------------- 
     194 
     195void connect_right(int h, int d, const Link& l, list<Boubble*>& new_head_boubbles, list<Boubble*>& new_dep_boubbles) 
     196{ 
     197  NodeProp &old_head_prop = sgraph[h].prop; 
     198  NodeProp &old_dep_prop = sgraph[d].prop; 
     199  NodeProp new_head_prop = compute_head_prop(old_head_prop,l,new_head_boubbles,old_dep_prop.flags); 
     200  NodeProp new_dep_prop = compute_dep_prop(old_dep_prop,l,new_dep_boubbles); 
     201 
     202  Edge new_head_edge(sgraph[h].edge); 
     203  int newh = find_existing_node(sgraph[h].mnode, new_head_prop, new_head_edge); 
     204  if( newh < 0 ) 
    257205      { 
    258         newheadind = create_new_head_node_left(h,newheadprop,newheadLH,newheadLD,newheadLV); 
    259         sgraph[newheadind].edge.clear(); 
    260         sgraph[newheadind].edge_contains_self = false; 
     206        newh = create_new_node(h,new_head_prop,new_head_edge); 
     207        sgraph[newh].visible_as_neighbour = false; 
    261208      } 
    262      
    263   } 
    264  
    265   NodeProp newdepprop = compute_dep_prop(olddepprop,l,new_dep_boubbles); 
    266  
    267   int newdepind; 
    268    
    269   if(olddepprop==newdepprop) 
    270     newdepind = d; 
    271   else 
    272   { 
    273     bitset<MAXNODES> newdepLH = sgraph[d].LH; 
    274     bitset<MAXNODES> newdepLV = sgraph[d].LV; 
    275     bitset<MAXNODES> newdepLD = sgraph[d].LD; 
    276  
    277     newdepind = find_existing_node(sgraph[d].mnode, newdepprop, newdepLH, newdepLV); 
    278     if( newdepind >= 0) // W£¡CZONE 
    279       sgraph[newdepind].LD |= newdepLD; // TYLKO DLA LD 
    280     else 
    281       { 
    282         newdepind = create_new_dep_node_left(d,newdepprop,newdepLH,newdepLD,newdepLV); 
    283         sgraph[newdepind].edge.clear(); 
    284         //sgraph[newdepind].edge.push_back(newdepind); // TO 
    285         sgraph[newdepind].edge_contains_self = true; // LUB TO 
    286       } 
    287   } 
    288    
    289  
    290   sgraph[newheadind].deps.push_back(Arc(newdepind,l.role,h,d)); 
    291   sgraph[newdepind].heads.push_back(Arc(newheadind,l.role,h,d)); 
    292   sgraph[newheadind].edge.push_back(newdepind); 
    293    
    294   if(sgraph[d].saturated()) sgraph[newheadind].LV |= sgraph[d].LV; 
    295  
    296   sgraph[newheadind].LD.set(d); 
    297   if(sgraph[d].saturated()) sgraph[newheadind].LD |= sgraph[d].LD; 
    298    
    299   if(debug) sgraph.print_arc(stderr,"new link",newheadind,d,l.role,0); 
    300   if(debug) sgraph.print_node_debug(stderr,"update",newheadind,h); 
    301   // if(debug) print_sets(newheadind); 
    302   if(debug) sgraph.print_node_debug(stderr,"update",newdepind,d); 
    303   // if(debug) print_sets(newdepind); 
    304 } 
    305  
    306 //---------------------------------------------------------------------------------------------------- 
    307  
    308 void connect_right(int h, int d, const Link& l, list<Boubble*>& new_head_boubbles, list<Boubble*>& new_dep_boubbles) 
    309 { 
    310   NodeProp &oldheadprop = sgraph[h].prop; 
    311  
    312   NodeProp newheadprop = compute_head_prop(oldheadprop,l,new_head_boubbles, sgraph[d].prop.flags); 
    313  
    314   int newheadind; 
    315    
    316   if(oldheadprop==newheadprop) 
    317     newheadind = h; 
    318   else 
    319   { 
    320     bitset<MAXNODES> newheadLH = sgraph[h].LH; 
    321     bitset<MAXNODES> newheadLV = sgraph[h].LV; 
    322     bitset<MAXNODES> newheadLD = sgraph[h].LD; 
    323  
    324     newheadind = find_existing_node(sgraph[h].mnode, newheadprop, newheadLH, newheadLV); 
    325  
    326     if(debug) fprintf(stderr,"#HEAD EXISTS %d\n",newheadind); 
    327  
    328     if( newheadind >= 0) // W£¡CZONE 
    329       sgraph[newheadind].LD |= newheadLD; // TYLKO DLA LD 
    330     else 
    331       { 
    332         newheadind = create_new_head_node_right(h,newheadprop,newheadLH,newheadLD,newheadLV); 
    333         //if(!sgraph[h].edge.empty()) sgraph[newheadind].edge.push_back(newheadind); // TO 
    334         sgraph[newheadind].edge_contains_self = sgraph[h].edge_contains_self;      // LUB TO 
    335         sgraph[newheadind].visible_as_neighbour = false; 
    336       } 
    337   } 
    338  
    339   NodeProp &olddepprop = sgraph[d].prop; 
    340   NodeProp newdepprop = compute_dep_prop(olddepprop,l,new_dep_boubbles); 
    341  
    342   int newdepind; 
    343    
    344   if(olddepprop==newdepprop) 
    345     newdepind = d; 
    346   else 
    347   { 
    348     bitset<MAXNODES> newdepLH = sgraph[d].LH; 
    349     bitset<MAXNODES> newdepLV = sgraph[d].LV; 
    350     bitset<MAXNODES> newdepLD = sgraph[d].LD; 
    351  
    352     newdepind = find_existing_node(sgraph[d].mnode, newdepprop, newdepLH, newdepLV); 
    353  
    354     if(debug) fprintf(stderr,"#DEP EXISTS %d\n",newdepind); 
    355  
    356     if( newdepind >= 0) // W£¡CZONE 
    357       sgraph[newdepind].LD |= newdepLD; // TYLKO DLA LD 
    358     else 
    359       { 
    360         newdepind = create_new_dep_node_right(d,newdepprop,newdepLH,newdepLD,newdepLV); 
    361         sgraph[newdepind].edge.clear(); 
    362         sgraph[newdepind].edge_contains_self = false; 
    363       } 
    364   } 
    365  
    366  
    367   sgraph[newdepind].heads.push_back(Arc(newheadind,l.role,h,d)); 
    368   sgraph[newheadind].deps.push_back(Arc(newdepind,l.role,h,d)); 
    369   //sgraph[newdepind].edge.push_back(newheadind); 
    370  
    371   sgraph[newdepind].LH.set(newheadind); 
    372  
    373   //  sgraph[*d].prop.merge_boubbles(new_dep_boubbles); 
    374    
    375   if(sgraph[newheadind].saturated()) sgraph[newdepind].LH |= sgraph[newheadind].LH; 
    376  
    377   if(debug) sgraph.print_arc(stderr,"new link",newheadind,newdepind,l.role,1); 
    378   if(debug) sgraph.print_node_debug(stderr,"update",newheadind,h); 
    379   if(debug) sgraph.print_node_debug(stderr,"update",newdepind,d); 
    380    
    381 } 
    382  
    383 //==================================================================================================== 
    384  
    385 // bool check_meeting_boubles(list<Boubble*>& hboubbles, list<Boubble*>& dboubbles) 
    386 // { 
    387 //   bool hremove=false;             // czy usun±æ ostatnio sprawdzany b±bel 
    388 //   bool dremove=false;             // czy usun±æ ostatnio sprawdzany b±bel 
    389  
    390 //   for(list<Boubble*>::iterator hb = hboubbles.begin(); hb != hboubbles.end(); hb = hremove ? hboubbles.erase(hb) : ++hb ) 
    391 //     { 
    392 //       hremove=false; 
    393 //       for(list<Boubble*>::iterator db = dboubbles.begin(); db != dboubbles.end(); db = dremove ? dboubbles.erase(db) : ++db ) 
    394 //      { 
    395 //        dremove=false; 
    396 //        if( (*hb)->rel()==(*db)->rel() && (*hb)->dir()==DOWN && (*db)->dir()==UP && (*hb)->reverse()!=(*db)->reverse() ) 
    397 //          { 
    398 //            int srcnode,dstnode; 
    399 //            if( (*hb)->reverse()==false ) 
    400 //              srcnode = (*hb)->src(), dstnode = (*db)->src(); 
    401 //            else 
    402 //              srcnode = (*db)->src(), dstnode = (*hb)->src(); 
    403 //            if( grammar.check_longrel(sgraph.cat(srcnode), sgraph.cat(dstnode), (*hb)->rel()) ) 
    404 //              { 
    405 //                hremove=dremove=true; 
    406 //                if(debug) fprintf(stderr,"BOUBBLES MET!!!\n"); 
    407 //              } 
    408 //            else 
    409 //              { 
    410 //                if(debug) fprintf(stderr,"BOUBBLES' MEETING FAILED!!!\n"); 
    411 //                return false; 
    412 //              } 
    413 //          } 
    414 //      } 
    415 //     } 
    416 //   return true; 
    417 // } 
     209 
     210  Edge new_dep_edge; 
     211  int newd = find_existing_node(sgraph[d].mnode, new_dep_prop, new_dep_edge); 
     212  if( newd < 0) 
     213    newd = create_new_node(d,new_dep_prop,new_dep_edge); 
     214 
     215 
     216  sgraph[newd].heads.push_back(Arc(newh,l.role,h,d)); 
     217  sgraph[newh].deps.push_back(Arc(newd,l.role,h,d)); 
     218 
     219  if(debug) 
     220    { 
     221      sgraph.print_arc(stderr,"link",newh,newd,l.role,1); 
     222      sgraph.print_node_debug(stderr,"",newh,h); 
     223      sgraph.print_node_debug(stderr,"",newd,d); 
     224    } 
     225   
     226} 
    418227 
    419228//==================================================================================================== 
     
    424233  bool dremove=false;             // czy usun±æ ostatnio sprawdzany b±bel 
    425234 
     235  // cerr << "CHECKING MEETING BUBBLES" << endl; 
     236 
    426237  for(list<Boubble*>::iterator hb = boubbles.begin(); hb != boubbles.end(); hb = hremove ? boubbles.erase(hb) : ++hb ) 
    427238    { 
    428       cout << endl << "hb:" << **hb ; 
    429239      hremove=false; 
    430240      for(list<Boubble*>::iterator db = hb; db != boubbles.end(); db = dremove ? boubbles.erase(db) : ++db ) 
    431241        { 
    432           cout << " db:" << **db; 
     242          // cerr << " db:" << **db; 
    433243          dremove=false; 
    434244          if( (*hb)->rel()==(*db)->rel() && (*hb)->reverse()!=(*db)->reverse() ) 
    435245            { 
    436               cout << "Z"; 
     246              // cerr << "Z";  
    437247              int srcnode,dstnode; 
    438248              if( (*hb)->reverse()==false ) 
     
    442252              if( grammar.check_longrel(sgraph.cat(srcnode), sgraph.cat(dstnode), (*hb)->rel()) ) 
    443253                { 
    444                   cout << " REMOVE "; 
     254                  // cerr << " REMOVE "; 
    445255                  hremove=dremove=true; 
    446256                  if(debug) fprintf(stderr,"BOUBBLES MET!!!\n"); 
     
    448258              else 
    449259                { 
    450                   cout << " FAIL "; 
     260                  // cerr << " FAIL "; 
    451261                  if(debug) fprintf(stderr,"BOUBBLES' MEETING FAILED!!!\n"); 
    452262                  return false; 
     
    471281      if( grammar.check_longrel(sgraph.cat((*b)->src()), sgraph.cat(node), (*b)->rel()) ) 
    472282        { 
    473           cout << endl << "REMOVE ChBatT " << **b << endl; 
     283          // cerr << endl << "REMOVE ChBatT " << **b << endl; 
    474284          remove=true; 
    475285        } 
     
    489299  int i; 
    490300  while((i=lvi.next()) >= 0) 
    491     { 
    492       //if(debug) sgraph.print_node_debug(stderr,"D-CUR>",i,-1); 
    493  
    494301      if(sgraph.saturated(i)) 
    495302        { 
    496           if(debug) {fprintf(stderr,"%d <--",i); } 
     303          if(debug) {fprintf(stderr,"\t%d <-- %d",i,j); } 
    497304           
    498305          list<const Link*> ji_links = grammar.connectable2( sgraph.cat(j), sgraph.cat(i), sgraph[j].prop.flags, sgraph[i].prop.flags); // ref do Roles!!! 
     
    517324                          if(debug) fprintf(stderr," ...SUCCESS!\n"); 
    518325                          connect_left( j, i, **ri, new_head_boubbles, new_dep_boubbles); 
    519                           lvi.update_edge(sgraph,i); 
     326                          // lvi.update_edge(sgraph,i); 
    520327                        } 
    521328                      else 
     
    526333        } 
    527334      else 
    528           if(debug) {fprintf(stderr,"%d <--     unsaturated\n",i); } 
    529     } 
    530    
     335        if(debug) {fprintf(stderr,"\t%d <-- %d\t%d unsaturated\n",i,j,i); }   
    531336} 
    532337//---------------------------------------------------------------------------------------------------- 
     
    537342  int i; 
    538343  while((i=lvi.next()) >= 0) 
    539     { 
    540       // if(debug) sgraph.print_node_debug(stderr,"H-CUR> ",i,-1); 
    541       if(sgraph.saturated(j)) 
    542         { 
    543           if(debug) fprintf(stderr, "%d -->",i); 
    544            
    545           list<const Link*> ij_links = grammar.connectable2( sgraph.cat(i), sgraph.cat(j), sgraph[i].prop.flags, sgraph[j].prop.flags ); 
    546           list<const Link*>::iterator ri = ij_links.begin(); 
    547           if(ri == ij_links.end()) { if(debug) fprintf(stderr,"     no roles\n"); } 
    548           else 
    549             { 
    550               for(; ri != ij_links.end(); ++ri ) 
    551                 { 
    552                   if(debug) fprintf(stderr,"     %s",(*ri)->role.str()); 
    553                   if( !grammar.check_constr2( sgraph[i].prop, sgraph[j].prop, 1, **ri ) ) 
    554                     { if(debug) fprintf(stderr," ...constraints failed\n"); } 
    555                   else 
    556                     { 
    557                       list<Boubble*> new_head_boubbles = collect_head_boubbles(i,j,(*ri)->role); 
    558                       list<Boubble*> new_dep_boubbles = collect_dep_boubbles(i,j,(*ri)->role); 
    559                        
    560                       if( check_meeting_boubles(new_head_boubbles) && 
    561                           check_meeting_boubles(new_dep_boubbles) && 
    562                           check_boubbles_at_target(new_head_boubbles,i) && 
    563                           check_boubbles_at_target(new_dep_boubbles,j) ) 
    564                         { 
    565                           if(debug) fprintf(stderr," ...SUCCESS!\n"); 
    566                           connect_right( i, j, **ri, new_head_boubbles, new_dep_boubbles ); 
    567                         } 
    568                       else 
    569                         { if(debug) fprintf(stderr," ...bubbles failed\n",i); } 
    570                     } 
    571                 } 
    572             } 
    573         } 
    574       else 
    575           if(debug) {fprintf(stderr,"%d <--     unsaturated\n",j); } 
    576     } 
     344    if(sgraph.saturated(j)) 
     345      { 
     346        if(debug) fprintf(stderr, "\t%d --> %d",i,j); 
     347         
     348        list<const Link*> ij_links = grammar.connectable2( sgraph.cat(i), sgraph.cat(j), sgraph[i].prop.flags, sgraph[j].prop.flags ); 
     349        list<const Link*>::iterator ri = ij_links.begin(); 
     350        if(ri == ij_links.end()) { if(debug) fprintf(stderr,"     no roles\n"); } 
     351        else 
     352          { 
     353            for(; ri != ij_links.end(); ++ri ) 
     354              { 
     355                if(debug) fprintf(stderr,"     %s",(*ri)->role.str()); 
     356                if( !grammar.check_constr2( sgraph[i].prop, sgraph[j].prop, 1, **ri ) ) 
     357                  { if(debug) fprintf(stderr," ...constraints failed\n"); } 
     358                else 
     359                  { 
     360                    list<Boubble*> new_head_boubbles = collect_head_boubbles(i,j,(*ri)->role); 
     361                    list<Boubble*> new_dep_boubbles = collect_dep_boubbles(i,j,(*ri)->role); 
     362                     
     363                    if( check_meeting_boubles(new_head_boubbles) && 
     364                        check_meeting_boubles(new_dep_boubbles) && 
     365                        check_boubbles_at_target(new_head_boubbles,i) && 
     366                        check_boubbles_at_target(new_dep_boubbles,j) ) 
     367                      { 
     368                        if(debug) fprintf(stderr," ...SUCCESS!\n"); 
     369                        connect_right( i, j, **ri, new_head_boubbles, new_dep_boubbles ); 
     370                      } 
     371                    else 
     372                      { if(debug) fprintf(stderr," ...bubbles failed\n",i); } 
     373                  } 
     374              } 
     375          } 
     376      } 
     377    else 
     378      if(debug) {fprintf(stderr,"\t* <-- %d    unsaturated\n",j); } 
    577379} 
    578380 
     
    662464    nodelist.push_back(basenode); 
    663465 
    664     if(debug) sgraph.print_node_debug(stderr,"add base",basenode,-1); // STDOUT!!! 
     466    if(debug) sgraph.print_node_debug(stderr,"node",basenode,-1); // STDOUT!!! 
    665467    // if(debug) print_sets(basenode); 
    666468 
     
    668470    while(++cursor != nodelist.end()) 
    669471    { 
    670       if(debug) sgraph.print_node_debug(stderr,"MAIN-CUR> ",*cursor,-1); 
     472      if(debug) sgraph.print_node_debug(stderr,"CUR>",*cursor,-1); 
    671473      try_connect_dependents(*cursor); 
    672474      try_connect_heads(*cursor); 
Note: See TracChangeset for help on using the changeset viewer.