Пример #1
0
void Solver::reduceDB(void)
{
    int     i, j;
    double  extra_lim = cla_inc / learnts.size();    // Remove any clause below this activity

    sort(learnts, reduceDB_lt());
    for (i = j = 0; i < learnts.size() / 2; i++){
        if (!learnts[i]->locked(*this))
            learnts[i]->remove(*this);
        else
            learnts[j++] = learnts[i];
    }
    for (; i < learnts.size(); i++){
        if (!learnts[i]->locked(*this) && learnts[i]->activity() < extra_lim)
            learnts[i]->remove(*this);
        else
            learnts[j++] = learnts[i];
    }
    learnts.shrink(i - j);
}
Пример #2
0
void Solver::reduceDB()
{
  int     i, j;
  
	
    nbReduceDB++;
    sort(learnts, reduceDB_lt());
    
    for (i = j = 0; i < learnts.size() / RATIOREMOVECLAUSES; i++){
	if (learnts[i]->size() > 2 && !locked(*learnts[i]) && learnts[i]->activity()>2){
	  removeClause(*learnts[i]);
	}
        else
	  learnts[j++] = learnts[i];
      }
      for (; i < learnts.size(); i++){
	learnts[j++] = learnts[i];
    }
      learnts.shrink(i - j);
      nof_learnts   *= learntsize_inc;
}
Пример #3
0
void MiniSATP::reduceDB()
{
    // Added Line
    // Prevent any clause removal for now
    int     i, j;
    double  extra_lim = cla_inc / learnts.size();    // Remove any clause below this activity

    sort(learnts, reduceDB_lt());
    for (i = j = 0; i < learnts.size() / 2; i++){
        if (learnts[i]->size() > 2 && !locked(*learnts[i]))
            removeClause(*learnts[i]);
        else
            learnts[j++] = learnts[i];
    }
    for (; i < learnts.size(); i++){
        if (learnts[i]->size() > 2 && !locked(*learnts[i]) && learnts[i]->activity() < extra_lim)
            removeClause(*learnts[i]);
        else
            learnts[j++] = learnts[i];
    }
    learnts.shrink(i - j);
}