3 * @author YOUR NAME <YOUR EMAIL ADDRESS>
6 * Created on 2018-07-12.
9 #include "NRAILModule.h"
10 #include "MonomialMappingByVariablePool.h"
12 #include "factory/AxiomFactory.h"
18 #include "boost/random.hpp"
19 #include "boost/generator_iterator.hpp"
24 template<class Settings>
25 NRAILModule<Settings>::NRAILModule(const ModuleInput* _formula, Conditionals& _conditionals, Manager* _manager):
26 Module( _formula, _conditionals, _manager )
28 linearizeSubformulaFunction = std::bind(&NRAILModule<Settings>::linearizeSubformula, this, std::placeholders::_1);
30 //mLRAFormula( new ModuleInput())
32 template<class Settings>
33 NRAILModule<Settings>::~NRAILModule()
36 template<class Settings>
37 bool NRAILModule<Settings>::informCore( const FormulaT& )
40 return true; // This should be adapted according to your implementation.
43 template<class Settings>
44 void NRAILModule<Settings>::init()
47 int zVariableCounter = 0;
48 std::string VariableName = "z_";
49 ModuleInput* originalFormula( new ModuleInput());
52 * create variables and each time increment the suffix e.g., z_0, z_1, etc.
53 * @return a carl Variable object
55 carl::Variable createZVariable(){
56 std::string GeneratedVariableName = VariableName + std::to_string(zVariableCounter++);
57 return carl::fresh_real_variable(GeneratedVariableName);
61 * create a square of the variable
62 * @param Variable a carl Variable object e.g., x_0
63 * @return a monomial object e.g., x_0^2
65 carl::Monomial::Arg createSquareOfVariable(carl::Variable Variable){
66 return carl::createMonomial((Variable), (carl::exponent)2);
70 * Insert the variable as key with monomial as value into the map
71 * The map is singeltone
72 * @param GeneratedVariable
75 void insertIntoMap(carl::Variable GeneratedVariable, carl::Monomial::Arg monomial) {
76 if (smtrat::LOG::getInstance().isDebugEnabled()) {
77 std::cout << "inserting the monomial into the map:";
79 std::cout << "GeneratedVariable: " << GeneratedVariable << ", monomial: " << monomial;
82 smtrat::MonomialMappingByVariablePool::getInstance().insertMonomialMapping(GeneratedVariable, monomial);
85 int divisionOfExponentByTwo(int exponent){
86 return (int)(exponent / 2);
90 * Check if the monomial is alreday inserted imto the map,
91 * If yes, returned the key which is a variable otherwise create new variable
92 * and insert the monomial into the map against this new variable
93 * @param monomial a monomoal object
94 * @return a carl::Variable object
96 carl::Variable insertIntoMapOrRetrieveExistingVariable(carl::Monomial::Arg monomial){
98 carl::Variable retrievedVariable = smtrat::MonomialMappingByVariablePool::getInstance().variable(monomial);
100 if(smtrat::MonomialMappingByVariablePool::getInstance().isNull(retrievedVariable)){
101 //create new variable as it doesn't exist in the map
102 carl::Variable GeneratedVariable = createZVariable();
103 //insert into the map
104 insertIntoMap(GeneratedVariable, monomial);
106 return GeneratedVariable;
109 if (smtrat::LOG::getInstance().isDebugEnabled()) {
110 std::cout << "the monomial, " << monomial << " alreday exists in the map!\nkey for this monomial in the map is, "
111 << retrievedVariable;
115 return retrievedVariable;
120 * Replace square of variable (x_0^2) of a monomial (x_0^6) by a variable (z_0),
121 * create a new monomial (z_0^3)
122 * and insert this variable as key with monomial (x_0^2) as value in the map
123 * @param Variable a carl::Variable object
124 * @param exponent an even exponent
125 * @return new monomial
127 carl::Monomial::Arg abstractUnivariateMonomialForEvenExponent(carl::Variable Variable, int exponent){
129 int exponentToBe = divisionOfExponentByTwo(exponent);
131 //carl::Variable GeneratedVariable = createZVariable();
132 carl::Monomial::Arg monomialAsSquareOfVariable = createSquareOfVariable(Variable);
134 //insertIntoMap(GeneratedVariable, monomialAsSquareOfVariable);
135 carl::Variable newlyGeneratedOrOldVariable = insertIntoMapOrRetrieveExistingVariable(monomialAsSquareOfVariable);
137 if (smtrat::LOG::getInstance().isDebugEnabled()) {
138 std::cout << "abstractUnivariateMonomialForEvenExponent: Exponent of newly generated or old variable: " << exponentToBe;
142 carl::Monomial::Arg newMonomial = carl::createMonomial(newlyGeneratedOrOldVariable, (carl::exponent)exponentToBe);
144 if (smtrat::LOG::getInstance().isDebugEnabled()) {
145 std::cout << "abstractUnivariateMonomialForEvenExponent: new Monomial: " << newMonomial;
154 * It creates monomial by taking and popping first two items from the list,
155 * Insert this new monomial as value into the map against a newly generated variable,
156 * Each time the newly generated variable is insterted at the front of the list
157 * @param variables List of carl variables
158 * @return created new linear variable
160 carl::Variable abstractProductRecursively(std::list<carl::Variable> variables){
162 while (variables.size() > 1) {
163 carl::Variable first = variables.front();
164 variables.pop_front();
166 carl::Variable second = variables.front();
167 variables.pop_front();
169 if (smtrat::LOG::getInstance().isDebugEnabled()) {
170 std::cout << "first: " << first << "\n";
171 std::cout << "second: " << second << "\n";
174 // variables must be sorted to create monomial.
175 carl::Monomial::Content mExponents(std::initializer_list<std::pair<carl::Variable, carl::exponent>>
177 {std::make_pair(first,(carl::exponent)1), std::make_pair(second, (carl::exponent)1)}
180 std::sort(mExponents.begin(), mExponents.end(), [](const std::pair<carl::Variable, carl::uint>& p1, const std::pair<carl::Variable, carl::uint>& p2){ return p1.first < p2.first; });
182 carl::Monomial::Arg createdMonomial = carl::createMonomial(std::initializer_list<std::pair<carl::Variable, carl::exponent>>
184 {mExponents[0], mExponents[1]}
186 (carl::exponent)(2));
188 if (smtrat::LOG::getInstance().isDebugEnabled()) {
189 std::cout << "createdMonomial: " << createdMonomial << "\n";
192 //carl::Variable GeneratedVariable = createZVariable();
193 carl::Variable newlyGeneratedOrOldVariable = insertIntoMapOrRetrieveExistingVariable(createdMonomial);
194 //insertIntoMap(GeneratedVariable, createdMonomial);
196 variables.push_front(newlyGeneratedOrOldVariable);
200 return variables.front();
205 * Replace square of variable (x_0^2) of a monomial (x_0^7) by a variable (z_0),
206 * create a linear monomial (z_1)
207 * and insert the variable as key with monomial as value in the map
208 * @param Variable a carl::Variable object
209 * @param exponent an odd exponent
210 * @return new linear monomial
212 carl::Monomial::Arg abstractUnivariateMonomialForOddExponent(carl::Variable Variable, int exponent){
214 std::list<carl::Variable> extraVariablesForOddExponenet;
216 int exponentToBe = divisionOfExponentByTwo(exponent);
217 //carl::Variable GeneratedVariable = createZVariable();
218 carl::Monomial::Arg monomialAsSquareOfVariable = createSquareOfVariable(Variable);
220 //insertIntoMap(GeneratedVariable, monomialAsSquareOfVariable);
221 carl::Variable newlyGeneratedOrOldVariable = insertIntoMapOrRetrieveExistingVariable(monomialAsSquareOfVariable);
223 if (smtrat::LOG::getInstance().isDebugEnabled()) {
224 std::cout << "abstractUnivariateMonomialForOddExponent: Exponent of newly generated or old variable: " << exponentToBe;
228 carl::Monomial::Arg newMonomial = carl::createMonomial(newlyGeneratedOrOldVariable, (carl::exponent)exponentToBe);
230 extraVariablesForOddExponenet.push_front(Variable);
232 // get linear monomial
233 while (!newMonomial->is_linear()) {
234 if (smtrat::LOG::getInstance().isDebugEnabled()) {
235 std::cout << "entering while" << "\n";
238 if(newMonomial->begin()->second % 2 == 0){
240 newMonomial = abstractUnivariateMonomialForEvenExponent(newMonomial->begin()->first,
241 newMonomial->begin()->second);
244 newMonomial = abstractUnivariateMonomialForOddExponent(newMonomial->begin()->first,
245 newMonomial->begin()->second);
249 // create newMonomial by multiplying newMonomial with the list extraVariablesForOddExponenet
250 if(newMonomial->is_linear()) {
251 carl::Variable variableOfNewMonomial = newMonomial->begin()->first;
252 if (smtrat::LOG::getInstance().isDebugEnabled()) {
253 std::cout << "new monomial is linear" << "\n";
254 std::cout << "variableOfNewMonomial: " << variableOfNewMonomial << "\n";
256 extraVariablesForOddExponenet.push_front(variableOfNewMonomial);
257 if (smtrat::LOG::getInstance().isDebugEnabled()) {
258 std::cout << "extraVariablesForOddExponenet: " << extraVariablesForOddExponenet << "\n";
260 newMonomial = carl::createMonomial((abstractProductRecursively(extraVariablesForOddExponenet)), (carl::exponent)1);
263 if (smtrat::LOG::getInstance().isDebugEnabled()) {
264 std::cout << "abstractUnivariateMonomialForOddExponent: new Monomial: " << newMonomial;
273 * create monomial which is linear
274 * @param Variable a carl Variable object
275 * @param exponent even or odd exponent of the variable
276 * @return a linear monomial
278 carl::Monomial::Arg abstractUnivariateMonomial (carl::Variable Variable, int exponent)
280 carl::Monomial::Arg monomial;
285 monomial = carl::createMonomial((Variable), (carl::exponent)1);
287 } else if(exponent % 2 == 0){
289 monomial = abstractUnivariateMonomialForEvenExponent(Variable, exponent);
292 monomial = abstractUnivariateMonomialForOddExponent(Variable, exponent);
296 if (monomial->num_variables() == 1 && monomial->is_linear()) {
298 if (smtrat::LOG::getInstance().isDebugEnabled()) {
299 std::cout << "final Linear Monomial: " << monomial << " tDeg: " << monomial->tdeg();
307 return abstractUnivariateMonomial(monomial->begin()->first, monomial->begin()->second);
311 * It linearizes a non-linear monomial
312 * @param monomial a monomoal object
313 * @return a linear variable
315 carl::Variable abstractMonomial(carl::Monomial::Arg monomial){
317 std::list<carl::Variable> variables;
319 carl::Variable finalVariable;
321 for (auto it = monomial->begin(); it != monomial->end(); ++it) {
323 carl::Monomial::Arg monomial = abstractUnivariateMonomial(it->first, it->second);
325 if (smtrat::LOG::getInstance().isDebugEnabled()) {
326 std::cout << "Received final Monomial is: " << monomial;
331 variables.push_back(monomial->begin()->first);
334 finalVariable = abstractProductRecursively(variables);
336 return finalVariable;
339 FormulaT linearization(FormulaT formula) {
340 originalFormula->add(formula, true);
343 const ConstraintT& constraint = formula.constraint();
345 if (smtrat::LOG::getInstance().isDebugEnabled()) {
347 std::cout << "Constraint is: " << constraint;
352 //get polynomial(lhs) of constraint
353 Poly poly = constraint.lhs();
355 std::size_t indexCount = 0;
358 std::vector<Poly> op(poly.terms().size());
360 // loops over each term and create linear polynomials
361 for( auto& term : poly.terms() ) {
363 if (!term.is_constant() && term.is_linear()) { //if the term is already linear and not a constant
368 if (smtrat::LOG::getInstance().isDebugEnabled()) {
369 std::cout << "Monomial is: " << term.monomial() << " (alreday linear)";
374 } else if (!term.is_constant()) { //if the term is a product of two or more variables
377 carl::Monomial::Arg monomial = term.monomial();
379 if (smtrat::LOG::getInstance().isDebugEnabled()) {
380 std::cout << "Monomial is: " << monomial;
384 //get the linearized variable of the monomial
385 carl::Variable finalVariable = abstractMonomial(monomial);
387 //create new polynomial
388 Poly p(term.coeff()*finalVariable);
389 if (smtrat::LOG::getInstance().isDebugEnabled()) {
390 std::cout << "Generated MultiVariantPolynomial: " << p;
396 } else { //if the term is a constants
398 //create new polynomial
407 if (smtrat::LOG::getInstance().isDebugEnabled()) {
408 std::cout << "Vector: " << op;
412 //construction lhs of the constraint
413 Poly finalPoly(Poly::ConstructorOperation::ADD,op);
416 FormulaT finalFormula = FormulaT(finalPoly, constraint.relation());
417 if (smtrat::LOG::getInstance().isDebugEnabled()) {
418 std::cout << "Generated final Formula: " << finalFormula;
420 std::cout << "Generated New constraint: " << finalFormula.constraint();
429 template<typename Settings>
430 FormulaT NRAILModule<Settings>::linearizeSubformula(const FormulaT &formula)
432 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Formula from linearizeSubformula: " << formula << " Formula Type: " << formula.type() << std::endl; }
434 if (formula.type() == carl::FormulaType::CONSTRAINT) {
435 FormulaT linearizedFormula = linearization(formula);
436 return linearizedFormula;
443 template<class Settings>
444 bool NRAILModule<Settings>::addCore( ModuleInput::const_iterator _subformula )
446 const FormulaT& formula{_subformula->formula()};
448 if (formula.type() == carl::FormulaType::FALSE){
450 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Formula type is false and UNSAT! "; }
452 mInfeasibleSubsets.push_back({formula});
457 if (formula.type() == carl::FormulaType::TRUE){
458 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Formula type is true! "; }
462 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Sub Formula: " << formula << " Sub Formula type: " << formula.type() << std::endl; }
464 FormulaT formulaFromVisitor = carl::visit_result( formula, linearizeSubformulaFunction );
466 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Generated linearized Formula FromVisitor: " << formulaFromVisitor << std::endl; }
467 ////////////////////////////////////////////////
469 // Adding the Linearized Formula to the global
470 // ModuleInput type variable. This global
471 // variable will be used to add all of the
472 // Linearized formulas to the passed formula
474 ////////////////////////////////////////////////
475 addSubformulaToPassedFormula(formulaFromVisitor);
477 return true; // This should be adapted according to your implementation.
480 template<class Settings>
481 void NRAILModule<Settings>::removeCore( ModuleInput::const_iterator )
486 template<class Settings>
487 void NRAILModule<Settings>::updateModel() const
490 if( solverState() == Answer::SAT )
496 Answer toAnswer(int value){
498 return Answer::UNSAT;
499 } else if(value == 1) {
502 return Answer::UNKNOWN;
507 * Chekcs if the estimated Assignment satisfies the input NRA formula.
508 * @param estimatedModel The estimated model.
510 Answer isNRASatisfied(Model estimatedModel)
512 unsigned result = originalFormula->satisfiedBy(estimatedModel);
513 if (smtrat::LOG::getInstance().isDebugEnabled()) {
514 std::cout << "Result " << result;
517 return toAnswer(result);
521 * Creates the estimated model.
522 * estimated model takes the solution from mModel or randomly chosen.
523 * @param linearizedModel Model of linearized formula.
525 Model createEstimatedAssignment(Model linearizedModel){
526 Model estimatedModel;
528 //collect the variables into the container "allVarsOfOriginalFormula"
529 carl::carlVariables allVarsOfOriginalFormula;
530 originalFormula->gatherVariables(allVarsOfOriginalFormula);
531 if (smtrat::LOG::getInstance().isDebugEnabled()) {
532 std::cout << "all variables of original formula: ";
533 for (auto it = allVarsOfOriginalFormula.begin(); it != allVarsOfOriginalFormula.end(); ++it) {
534 std::cout << it->name();
539 std::cout << "linearized variable | value: " << "\n";
540 for (auto it = linearizedModel.begin(); it != linearizedModel.end(); ++it) {
541 std::cout << it->first << " | " << it->second;
545 for (auto it1 = allVarsOfOriginalFormula.begin(); it1 != allVarsOfOriginalFormula.end(); ++it1) {
547 for (auto it2 = linearizedModel.begin(); it2 != linearizedModel.end(); ++it2) {
548 if(it1->name() == it2->first.asVariable().name()){
549 estimatedModel.emplace(*it1, it2->second.asRational());
555 estimatedModel.emplace(*it1, Rational(0));
558 if (smtrat::LOG::getInstance().isDebugEnabled()) {
559 std::cout << "estimated model for original formula: " << "\n";
560 for (auto it = estimatedModel.begin(); it != estimatedModel.end(); ++it) {
561 std::cout << it->first << " | " << it->second;
565 return estimatedModel;
569 * create a model combining mModel, estimatedModel and rest of the variables are guessed.
570 * This model checks the satifiability of the axioms.
571 * @param mModel Model of linearized formula.
572 * @param estimatedModel the estimated model for original formula.
573 * @return the Abstract Model
575 Model extendLinearizedModel(Model mModel, Model estimatedModel){
576 Model linearizedModel;
577 std::ostream stream(nullptr);
578 stream.rdbuf(std::cout.rdbuf());
580 for (auto mModelItarator = mModel.begin(); mModelItarator != mModel.end(); ++mModelItarator) {
581 if (mModelItarator->second.isRational())
582 linearizedModel.emplace(mModelItarator->first, mModelItarator->second.asRational());
585 for (auto estimatedModelItarator = estimatedModel.begin(); estimatedModelItarator != estimatedModel.end(); ++estimatedModelItarator) {
586 linearizedModel.emplace(estimatedModelItarator->first, estimatedModelItarator->second.asRational());
589 MonomialMap monomialMap = smtrat::MonomialMappingByVariablePool::getInstance().getMMonomialMapping();
590 for (MonomialMapIterator it = monomialMap.begin(); it != monomialMap.end(); ++it) {
591 linearizedModel.emplace(it->first, Rational(0));
593 if (smtrat::LOG::getInstance().isDebugEnabled()) {
594 std::cout << "Abstract model for checking axioms: " << "\n";
595 linearizedModel.printOneline(stream, true);
598 return linearizedModel;
601 int rand(int min, int max) {
602 std::time_t now = std::time(0);
603 boost::random::mt19937 gen{static_cast<std::uint32_t>(now)};
604 boost::random::uniform_int_distribution<> dist{min, max};
608 FormulasT unsatisfiedFormulas(AxiomFactory::AxiomType axiomType, FormulasT formulas, Model model, UNSATFormulaSelectionStrategy formulaSelectionStrategy){
610 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "unsatisfiedFormulas to be check: " << formulas << std::endl; }
612 FormulasT unsatisfiedFormulas;
614 if (axiomType == AxiomFactory::AxiomType::TANGENT_PLANE || axiomType == AxiomFactory::AxiomType::MONOTONICITY) {
615 for(FormulaT formula:formulas) {
616 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "unsatisfiedFormula: " << formula << std::endl; }
617 unsatisfiedFormulas.push_back(formula);
618 if (formulaSelectionStrategy == UNSATFormulaSelectionStrategy::FIRST){
619 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "returning first formula" << std::endl; }
620 return unsatisfiedFormulas;
624 for(FormulaT formula:formulas) {
625 if (carl::satisfied_by(formula, model) == 0){
626 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "unsatisfiedFormula: " << formula << std::endl; }
627 unsatisfiedFormulas.push_back(formula);
628 if (formulaSelectionStrategy == UNSATFormulaSelectionStrategy::FIRST){
629 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "returning first formula" << std::endl; }
630 return unsatisfiedFormulas;
635 if (unsatisfiedFormulas.empty()) {
636 return unsatisfiedFormulas;
639 int unsatisfiedFormulasSize = (int)unsatisfiedFormulas.size();
641 if (formulaSelectionStrategy == UNSATFormulaSelectionStrategy::RANDOM) {
642 std::vector<FormulaT> randomlySelectedFormulas;
644 int min = unsatisfiedFormulasSize / 2;
645 int max = (unsatisfiedFormulasSize * 80) / 100;
647 size_t nelems = rand(min, max);
649 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Selecting elements: " << nelems << " from the elemnts of: " << unsatisfiedFormulasSize << std::endl; }
650 std::sample(unsatisfiedFormulas.begin(), unsatisfiedFormulas.end(), std::back_inserter(randomlySelectedFormulas),
651 nelems, std::mt19937{std::random_device{}()});
652 return randomlySelectedFormulas;
655 return unsatisfiedFormulas;
658 FormulasT refinement(AxiomFactory::AxiomType axiomType, Model linearizedModel, UNSATFormulaSelectionStrategy formulaSelectionStrategy){
660 FormulasT axiomFormulasToBeChecked = AxiomFactory::createFormula(axiomType, linearizedModel, smtrat::MonomialMappingByVariablePool::getInstance().getMMonomialMapping());
662 FormulasT unsatFormulas = unsatisfiedFormulas(axiomType, axiomFormulasToBeChecked, linearizedModel, formulaSelectionStrategy);
664 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "pushing to unsatisfiedFormulas " << unsatFormulas << std::endl; }
666 return unsatFormulas;
670 template<class Settings>
671 Answer NRAILModule<Settings>::checkCore()
673 std::ostream stream(nullptr);
674 stream.rdbuf(std::cout.rdbuf());
677 std::vector<AxiomFactory::AxiomType> axiomType(std::begin(Settings::axiomType), std::end(Settings::axiomType));
679 assert(axiomType.size() > 0);
680 std::size_t axiom_type_size = axiomType.size() - 1;
682 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "axiom_type_size: " << axiom_type_size << std::endl; }
684 std::size_t axiomCounter = 0;
686 bool isUnsatFormulasNotEmpty = true;
688 Model linearizedModel;
692 if (smtrat::LOG::getInstance().isDebugEnabled()) {
693 std::cout << "Loop" << loopCounter << "\n";
694 std::cout << "axiomCounter" << axiomCounter << "\n";
697 if(isUnsatFormulasNotEmpty) {
699 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Calling backend for axiom counter = " << axiomCounter << std::endl; }
701 auto AnswerOfLRA = runBackends();
704 if (smtrat::LOG::getInstance().isDebugEnabled()) {
705 std::cout << "Linearized Formula is AnswerOfLRA!" << AnswerOfLRA << "\n";
708 if (AnswerOfLRA != SAT) {
710 if (smtrat::LOG::getInstance().isDebugEnabled()) {std::cout << "Linearized Formula is Unsatisfied/Unknown!" << std::endl;}
712 if (AnswerOfLRA == UNSAT) {
713 generateTrivialInfeasibleSubset();
717 // NOTE: This mModel is the actual linearized model.
718 mModel = backendsModel();
720 if (smtrat::LOG::getInstance().isDebugEnabled()) {
721 std::cout << "Solution/model of linearized formula: ";
722 mModel.printOneline(stream, true);
726 Model estimatedModel = createEstimatedAssignment(mModel);
727 auto answerOfNRA = isNRASatisfied(estimatedModel);
729 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "answerOfNRA: " << answerOfNRA << std::endl; }
731 if (answerOfNRA != UNSAT) {
733 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Input Formula is Satisfied!" << std::endl; }
735 if (smtrat::LOG::getInstance().isDebugEnabled()) { estimatedModel.printOneline(stream, true); }
738 // NOTE: mModel is the actual linearized model, linearizedModel contains linearized model with estimatedAssignments
739 linearizedModel = extendLinearizedModel(mModel, estimatedModel);
743 FormulasT unsatFormulas = refinement(axiomType[axiomCounter], linearizedModel, Settings::formulaSelectionStrategy);
745 isUnsatFormulasNotEmpty = !unsatFormulas.empty();
747 if (unsatFormulas.empty()) {
748 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "empty" << std::endl; }
751 for (FormulaT formulaT : unsatFormulas) {
752 addSubformulaToPassedFormula(formulaT);
756 if (axiomCounter == axiom_type_size) {
765 if (smtrat::LOG::getInstance().isDebugEnabled()) { std::cout << "Result is:" << std::endl; }
767 return UNKNOWN; // This should be adapted according to your implementation.