@@ -4086,7 +4086,9 @@ static bool distin_helper(void *env, const void *key, unsigned int key_size, voi
40864086 struct dict_assoc * da1 = distin_env -> de -> todo [dst1 ];
40874087 struct dfa_node * dn1 = (struct dfa_node * ) & da1 [1 ];
40884088
4089- // printf("CMP %p(%p) %p(%p)\n", dn1, dn1->rep, dn2, dn2->rep);
4089+ // if (dn1->rep != dn2->rep) {
4090+ // printf("CMP %s %u(%u) %u(%u)\n", value_string(* (hvalue_t *) key), dn1->id, dn1->rep->id, dn2->id, dn2->rep->id);
4091+ // }
40904092
40914093 return dn1 -> rep == dn2 -> rep ;
40924094}
@@ -4249,10 +4251,17 @@ static unsigned int nfa2dfa(FILE *hfa, struct dict *symbols){
42494251
42504252 // Now keep partitioning until no new partitions are formed
42514253 bool new_partition = true;
4252- unsigned int work_ctr = 0 ;
4254+ unsigned int work_ctr = 0 ; // for pacifier
42534255 for (unsigned int round = 0 ; new_partition ; round ++ ) {
4256+ // Mark all nodes in each partition with a unique id.
4257+ for (unsigned int i = 0 ; i < n_new ; i ++ ) {
4258+ for (struct dfa_node * dn = new [i ]; dn != NULL ; dn = dn -> next ) {
4259+ dn -> rep = new [i ];
4260+ }
4261+ }
4262+
42544263#ifdef notdef
4255- printf ("DFA_MINIFY PARTITION %u \n" , n_new );
4264+ printf ("DFA_MINIFY PARTITION round=%u, #partitions=%u \n" , round , n_new );
42564265 printf ("Partitions:\n" );
42574266 for (unsigned int i = 0 ; i < n_new ; i ++ ) {
42584267 printf (" %u:" , i );
@@ -4274,7 +4283,7 @@ static unsigned int nfa2dfa(FILE *hfa, struct dict *symbols){
42744283 // Go through each of the old partitions
42754284 new_partition = false;
42764285 for (unsigned i = 0 ; i < n_old ; i ++ ) {
4277- // printf("Partition %u\n", i);
4286+ // printf("Partition %u #new=%u \n", i, n_new );
42784287
42794288 // Repartition the group based on distinguishability
42804289
@@ -4290,18 +4299,20 @@ static unsigned int nfa2dfa(FILE *hfa, struct dict *symbols){
42904299 continue ;
42914300 }
42924301
4293- // Initialize the first partition.
4302+ // Initialize the first partition by moving over one node .
42944303 unsigned int k = n_new ;
42954304 old [i ] = dn -> next ;
42964305 new [n_new ++ ] = dn ;
4297- dn -> rep = dn ;
42984306 dn -> next = NULL ;
42994307
4308+ // Now look at all the other nodes in the partition
43004309 while ((dn = old [i ]) != NULL ) {
43014310 old [i ] = dn -> next ;
43024311
4312+
43034313 // See if the node fits into one of the existing partitions
43044314 unsigned int j = k ;
4315+ // printf("check j=%u dn=%u rep=%u\n", j, dn->id, dn->rep->id);
43054316 for (; j < n_new ; j ++ ) {
43064317
43074318 // Pacifier
@@ -4311,8 +4322,7 @@ static unsigned int nfa2dfa(FILE *hfa, struct dict *symbols){
43114322 }
43124323
43134324 if (indistinguishable (& de , dn , new [j ])) {
4314- // printf("ind %u %u %u\n", j, dn->id, new[j]->id);
4315- dn -> rep = new [j ]-> rep ;
4325+ // printf("ind j=%u dn=%u rep=%u\n", j, dn->id, new[j]->id);
43164326 dn -> next = new [j ];
43174327 new [j ] = dn ;
43184328 break ;
@@ -4321,7 +4331,6 @@ static unsigned int nfa2dfa(FILE *hfa, struct dict *symbols){
43214331
43224332 // Otherwise, create a new partition
43234333 if (j == n_new ) {
4324- dn -> rep = dn ;
43254334 dn -> next = NULL ;
43264335 new [n_new ++ ] = dn ;
43274336 new_partition = true;
@@ -5591,9 +5600,9 @@ int exec_model_checker(int argc, char **argv){
55915600 fprintf (hfa , "}\n" );
55925601 fclose (hfa );
55935602
5594- struct dfa * dfa = dfa_read (& workers [0 ].allocator , hfaout );
5595- struct gnfa * gnfa = gnfa_from_dfa (dfa );
5596- gnfa_rip (gnfa );
5603+ // struct dfa *dfa = dfa_read(&workers[0].allocator, hfaout);
5604+ // struct gnfa *gnfa = gnfa_from_dfa(dfa);
5605+ // gnfa_rip(gnfa);
55975606 }
55985607 }
55995608
0 commit comments