43 template <
class combineType>
44 bool combine(
const std::vector< std::vector< std::vector< combineType > > >& _toCombine, std::vector< std::vector< combineType > >& _combination )
47 if( _toCombine.empty() )
return true;
48 std::vector<typename std::vector< std::vector< combineType > >::const_iterator > combination
49 = std::vector<typename std::vector< std::vector< combineType > >::const_iterator >();
50 unsigned estimatedResultSize = 1;
51 for(
auto iter = _toCombine.begin(); iter != _toCombine.end(); ++iter )
55 estimatedResultSize *= (unsigned)iter->size();
59 combination.push_back( iter->begin() );
62 bool lastCombinationReached =
false;
63 while( !lastCombinationReached )
66 _combination.push_back( std::vector< combineType >() );
67 bool previousCounterIncreased =
false;
70 auto currentVector = _toCombine.begin();
71 for(
auto combineElement = combination.begin(); combineElement != combination.end(); ++combineElement )
74 _combination.back().insert( _combination.back().end(), (*combineElement)->begin(), (*combineElement)->end() );
76 if( !previousCounterIncreased )
79 if( *combineElement != currentVector->end() )
80 previousCounterIncreased =
true;
83 if( combineElement != --combination.end() )
84 *combineElement = currentVector->begin();
86 lastCombinationReached =
true;
165 void getOddBitStrings(
size_t _length, std::vector< std::bitset<MAX_PRODUCT_SPLIT_NUMBER> >& _strings );
171 void getEvenBitStrings(
size_t _length, std::vector< std::bitset<MAX_PRODUCT_SPLIT_NUMBER> >& _strings );
const unsigned MAX_PRODUCT_SPLIT_NUMBER
Class containing a method applying a virtual substitution.
const unsigned MAX_NUM_OF_COMBINATION_RESULT
The maximum number of the resulting combinations when combining according to the method combine.
bool substituteNormalSqrtNeq(const smtrat::Poly &_radicand, const smtrat::Poly &_q, const smtrat::Poly &_r, DisjunctionOfConstraintConjunctions &_result, bool _accordingPaper)
Sub-method of substituteNormalSqrt, where applying the substitution led to a term containing a square...
bool combine(const std::vector< std::vector< std::vector< combineType > > > &_toCombine, std::vector< std::vector< combineType > > &_combination)
Combines vectors.
void substituteInfLessGreater(const smtrat::ConstraintT &_cons, const Substitution &_subs, DisjunctionOfConstraintConjunctions &_result)
Applies the given substitution to the given constraint, where the substitution is of the form [x -> +...
bool substituteNormal(const smtrat::ConstraintT &_cons, const Substitution &_subs, DisjunctionOfConstraintConjunctions &_result, bool _accordingPaper, Variables &_conflictingVariables, const smtrat::EvalDoubleIntervalMap &_solutionSpace)
bool substituteNormalSqrtLeq(const smtrat::Poly &_radicand, const smtrat::Poly &_q, const smtrat::Poly &_r, const smtrat::Poly &_s, DisjunctionOfConstraintConjunctions &_result, bool _accordingPaper)
Sub-method of substituteNormalSqrt, where applying the substitution led to a term containing a square...
bool substituteEpsGradients(const smtrat::ConstraintT &_cons, const Substitution &_subs, const Relation _relation, DisjunctionOfConstraintConjunctions &_result, bool _accordingPaper, Variables &_conflictingVariables, const smtrat::EvalDoubleIntervalMap &_solutionSpace)
void getEvenBitStrings(std::size_t _length, std::vector< std::bitset< MAX_PRODUCT_SPLIT_NUMBER > > &_strings)
bool substituteNormalSqrtLess(const smtrat::Poly &_radicand, const smtrat::Poly &_q, const smtrat::Poly &_r, const smtrat::Poly &_s, DisjunctionOfConstraintConjunctions &_result, bool _accordingPaper)
Sub-method of substituteNormalSqrt, where applying the substitution led to a term containing a square...
void substituteInf(const smtrat::ConstraintT &_cons, const Substitution &_subs, DisjunctionOfConstraintConjunctions &_result, Variables &_conflictingVariables, const smtrat::EvalDoubleIntervalMap &_solutionSpace)
void substituteNotTrivialCase(const smtrat::ConstraintT &_cons, const Substitution &_subs, DisjunctionOfConstraintConjunctions &_result)
Deals with the case, that the left hand side of the constraint to substitute is not a trivial polynom...
std::vector< ConstraintVector > DisjunctionOfConstraintConjunctions
a vector of vectors of constraints
void splitSosDecompositions(DisjunctionOfConstraintConjunctions &_toSimplify)
std::vector< smtrat::ConstraintT > ConstraintVector
a vector of constraints
bool substitutePlusEps(const smtrat::ConstraintT &_cons, const Substitution &_subs, DisjunctionOfConstraintConjunctions &_result, bool _accordingPaper, Variables &_conflictingVariables, const smtrat::EvalDoubleIntervalMap &_solutionSpace)
void simplify(DisjunctionOfConstraintConjunctions &_toSimplify)
Simplifies a disjunction of conjunctions of constraints by deleting consistent constraint and inconsi...
bool substitute(const smtrat::ConstraintT &_cons, const Substitution &_subs, DisjunctionOfConstraintConjunctions &_result, bool _accordingPaper, Variables &_conflictingVariables, const smtrat::EvalDoubleIntervalMap &_solutionSpace)
bool splitProducts(DisjunctionOfConstraintConjunctions &_toSimplify, bool _onlyNeq)
Splits all constraints in the given disjunction of conjunctions of constraints having a non-trivial f...
DisjunctionOfConstraintConjunctions getSignCombinations(const smtrat::ConstraintT &_constraint)
For a given constraint f_1*...*f_n ~ 0 this method computes all combinations of constraints f_1 ~_1 0...
bool substituteNormalSqrtEq(const smtrat::Poly &_radicand, const smtrat::Poly &_q, const smtrat::Poly &_r, DisjunctionOfConstraintConjunctions &_result, bool _accordingPaper)
Sub-method of substituteNormalSqrt, where applying the substitution led to a term containing a square...
void substituteTrivialCase(const smtrat::ConstraintT &_cons, const Substitution &_subs, DisjunctionOfConstraintConjunctions &_result)
Deals with the case, that the left hand side of the constraint to substitute is a trivial polynomial ...
void print(DisjunctionOfConstraintConjunctions &_substitutionResults)
Prints the given disjunction of conjunction of constraints.
void getOddBitStrings(std::size_t _length, std::vector< std::bitset< MAX_PRODUCT_SPLIT_NUMBER > > &_strings)
Class to create the formulas for axioms.
carl::MultivariatePolynomial< Rational > Poly
carl::Constraint< Poly > ConstraintT
std::map< carl::Variable, DoubleInterval > EvalDoubleIntervalMap