Exemple #1
0
Result PropEngine::checkSat(unsigned long& millis, unsigned long& resource) {
  Assert(!d_inCheckSat, "Sat solver in solve()!");
  Debug("prop") << "PropEngine::checkSat()" << endl;

  // Mark that we are in the checkSat
  ScopedBool scopedBool(d_inCheckSat);
  d_inCheckSat = true;

  // TODO This currently ignores conflicts (a dangerous practice).
  d_theoryEngine->presolve();

  if(options::preprocessOnly()) {
    millis = resource = 0;
    return Result(Result::SAT_UNKNOWN, Result::REQUIRES_FULL_CHECK);
  }

  // Set the timer
  d_satTimer.set(millis);

  // Reset the interrupted flag
  d_interrupted = false;

  // Check the problem
  SatValue result = d_satSolver->solve(resource);

  millis = d_satTimer.elapsed();

  if( result == SAT_VALUE_UNKNOWN ) {
    Result::UnknownExplanation why =
      d_satTimer.expired() ? Result::TIMEOUT :
        (d_interrupted ? Result::INTERRUPTED : Result::RESOURCEOUT);
    return Result(Result::SAT_UNKNOWN, why);
  }

  if( result == SAT_VALUE_TRUE && Debug.isOn("prop") ) {
    printSatisfyingAssignment();
  }

  Debug("prop") << "PropEngine::checkSat() => " << result << endl;
  if(result == SAT_VALUE_TRUE && d_theoryEngine->isIncomplete()) {
    return Result(Result::SAT_UNKNOWN, Result::INCOMPLETE);
  }
  return Result(result == SAT_VALUE_TRUE ? Result::SAT : Result::UNSAT);
}
void MainWindow::updateFrameDurationSpinBox()
{
	QString nodePath = spriteView->getCurrentNodeOrRoot();
	QList<int> selected = animationView->getSelected();

	ScopedBool scopedBool(preventFrameDurationChange);
	if (selected.isEmpty())
	{
		spinBoxFrameDuration->setValue(0);
		spinBoxFrameDuration->setEnabled(false);
	}
	else
	{
		bool different = false;
		int duration = project.animGetDurations(nodePath, selected, different);

		spinBoxFrameDuration->setValue(different ? 0 : duration);
		spinBoxFrameDuration->setEnabled(true);
	}
}