Beispiel #1
0
bdd reachable_states(bdd I, bdd T)
{
   bdd C, by, bx = bddfalse;
   bdd tmp1;
   
   do
   {
      bdd_addref(bx);
      
      by = bx;
#if 1
      tmp1 = bdd_addref( bdd_apply(T, bx, bddop_and) );
      C = bdd_addref( bdd_exist(tmp1, normvarset) );
      bdd_delref(tmp1);
#else
      C = bdd_addref( bdd_appex(bx, T, bddop_and, normvar, N*3) );
#endif
      
      tmp1 = bdd_addref( bdd_replace(C, pairs) );
      bdd_delref(C);
      C = tmp1;

      tmp1 = bdd_apply(I, C, bddop_or);
      bdd_delref(C);

      bdd_delref(bx);
      bx = tmp1;
      
      /*printf("."); fflush(stdout);*/
   }
   while(bx != by);
   
   printf("\n");
   return bx;
}
Beispiel #2
0
int has_deadlocks(bdd R, bdd T)
{
   bdd C = bddtrue;
   
   for(int i=0; i<N; i++)
      C &= bdd_exist(T, primvar, N*3);
   //C &= bdd_exist(bdd_exist(bdd_exist(T,i*6+3),i*6+5),i*6+1);
   
   if(C != bddfalse && R != bddfalse)
      return 0;
   
   return 1;
}
Beispiel #3
0
/* ML type: bdd -> varSet -> bdd */
EXTERNML value mlbdd_bdd_exist(value b1, value varset) /* ML */
{
  return mlbdd_make(bdd_exist(Bdd_val(b1),Bdd_val(varset)));
}