예제 #1
0
파일: MCBModule.cpp 프로젝트: smtrat/smtrat
	void MCBModule<Settings>::updateModel() const {
		clearModel();
		if (solverState() == SAT || (solverState() != UNSAT && appliedPreprocessing())) {
			getBackendsModel();
			mModel.update(mAssignments);
			mAssignments.clear();
		}
	}
예제 #2
0
	void CoCoAGBModule<Settings>::updateModel() const
	{
		mModel.clear();
		if( solverState() == Answer::SAT )
		{
			// Your code.
		}
	}
예제 #3
0
 void CubeLIAModule<Settings>::updateModel() const
 {
     if( !mModelComputed && !mModelUpdated )
     {
         clearModel();
         if( solverState() != UNSAT )
         {
             getBackendsModel();
         }
         mModelUpdated = true;
     }
 }
예제 #4
0
    Answer CNFerModule::checkCore()
    {
        auto receivedSubformula = firstUncheckedReceivedSubformula();
        while( receivedSubformula != rReceivedFormula().end() )
        {
            /*
             * Add the currently considered formula of the received constraint as clauses
             * to the passed formula.
             */
            FormulaT formulaToAssertInCnf = receivedSubformula->formula().toCNF( true, true, true );
            if( formulaToAssertInCnf.getType() == TRUE )
            {
                // No need to add it.
            }
            else if( formulaToAssertInCnf.getType() == FALSE )
            {
                receivedFormulasAsInfeasibleSubset( receivedSubformula );
                return UNSAT;
            }
            else
            {
                if( formulaToAssertInCnf.getType() == AND )
                {
                    for( const FormulaT& subFormula : formulaToAssertInCnf.subformulas()  )
                    {
                        #ifdef SMTRAT_DEVOPTION_Statistics
                        mpStatistics->addClauseOfSize( subFormula.size() );
                        #endif
                        addSubformulaToPassedFormula( subFormula, receivedSubformula->formula() );
                    }
                }
                else
                {
                    #ifdef SMTRAT_DEVOPTION_Statistics
                    mpStatistics->addClauseOfSize( receivedSubformula->formula().size() );
                    #endif
                    addSubformulaToPassedFormula( formulaToAssertInCnf, receivedSubformula->formula() );
                }
            }
            ++receivedSubformula;
        }
        //No given formulas is SAT but only if no other run was before
        if( rPassedFormula().empty() && solverState() == UNKNOWN )
        {
            return SAT;
        }
        else
        {
            #ifdef SMTRAT_DEVOPTION_Statistics
            carl::Variables avars;
            rPassedFormula().arithmeticVars( avars );
            mpStatistics->nrOfArithVariables() = avars.size();
            carl::Variables bvars;
            rPassedFormula().booleanVars( bvars );
            mpStatistics->nrOfBoolVariables() = bvars.size();
            #endif
            Answer a = runBackends();

            if( a == UNSAT )
            {
                getInfeasibleSubsets();
            }
            return a;
        }
    }