25 template<
typename Poly>
28 template<
typename Poly>
62 template <
class combineType>
63 inline bool combine(
const std::vector< std::vector< std::vector< combineType > > >& _toCombine, std::vector< std::vector< combineType > >& _combination );
72 template<
typename Poly>
84 template<
typename Poly>
96 template<
typename Poly>
109 template<
typename Poly>
120 template<
typename Poly>
123 template<
typename Poly>
135 template<
typename Poly>
142 inline void getOddBitStrings(
size_t _length, std::vector< std::bitset<MAX_PRODUCT_SPLIT_NUMBER> >& _strings );
148 inline void getEvenBitStrings(
size_t _length, std::vector< std::bitset<MAX_PRODUCT_SPLIT_NUMBER> >& _strings );
154 template<
typename Poly>
166 template<
typename Poly>
181 template<
typename Poly>
200 template<
typename Poly>
219 template<
typename Poly>
239 template<
typename Poly>
259 template<
typename Poly>
278 template<
typename Poly>
296 template<
typename Poly>
311 template<
typename Poly>
323 template<
typename Poly>
334 template<
typename Poly>
345 template<
typename Poly>
359 template<
typename Poly>
374 template<
typename Poly>
400 template<
typename Poly>
407 if (varcomp.
var() != var) {
415 std::vector<zero<Poly>> zeros;
419 assert(zeros.size() == 1);
427 std::map<std::reference_wrapper<const Constraint<Poly>>,
CaseDistinction<Poly>, std::less<Constraint<Poly>>> result_cache;
428 for (
const auto& vcase : *subRes1) {
429 std::vector<CaseDistinction<Poly>> subresults;
430 size_t num_cases = 1;
431 for (
const auto& constr : vcase) {
432 if (result_cache.find(std::cref(constr)) == result_cache.end()) {
435 result_cache.emplace(std::cref(constr), *subRes2);
437 auto subRes2 = result_cache.at(std::cref(constr));
438 subresults.push_back(subRes2);
439 num_cases = num_cases * subRes2.size();
443 for (
size_t i = 0; i < num_cases; i++) {
445 result.emplace_back(zeros[0].side_condition.begin(), zeros[0].side_condition.end());
446 for (
auto const& vec : subresults) {
447 auto index = temp % vec.size();
449 result.back().insert(result.back().end(), vec[index].begin(), vec[index].end());
const unsigned MAX_PRODUCT_SPLIT_NUMBER
The maximal number of splits performed, if the left-hand side of a constraints is a product of polyno...
const unsigned MAX_NUM_OF_COMBINATION_RESULT
The maximum number of the resulting combinations when combining according to the method combine.
Variable fresh_real_variable() noexcept
Relation inverse(Relation r)
Inverts the given relation symbol.
std::set< Variable > Variables
auto & get(const std::string &name)
std::optional< CaseDistinction< Poly > > substitute(const Constraint< Poly > &cons, const Variable var, const Term< Poly > &term)
Applies a substitution to a constraint.
bool simplify_inplace(CaseDistinction< Poly > &cases)
Simplifies the case distinction in place.
static bool gather_zeros(const Constraint< Poly > &constraint, const Variable &eliminationVar, std::vector< zero< Poly >> &results)
Gathers zeros with side conditions from the given constraint in the given variable.
std::vector< Constraint< Poly > > ConstraintConjunction
a vector of constraints
std::vector< ConstraintConjunction< Poly > > CaseDistinction
a vector of vectors of constraints
void splitSosDecompositions(CaseDistinction< Poly > &)
void substituteInf(const Constraint< Poly > &_cons, const Substitution< Poly > &_subs, CaseDistinction< Poly > &_result, carl::Variables &_conflictingVariables, const detail::EvalDoubleIntervalMap &_solutionSpace)
Applies the given substitution to the given constraint, where the substitution is of the form [x -> -...
void substituteTrivialCase(const Constraint< Poly > &_cons, const Substitution< Poly > &_subs, CaseDistinction< Poly > &_result)
Deals with the case, that the left hand side of the constraint to substitute is a trivial polynomial ...
std::map< carl::Variable, DoubleInterval > EvalDoubleIntervalMap
void print(CaseDistinction< Poly > &_substitutionResults)
Prints the given disjunction of conjunction of constraints.
bool substituteNormalSqrtLeq(const Poly &_radicand, const Poly &_q, const Poly &_r, const Poly &_s, CaseDistinction< Poly > &_result, bool _accordingPaper)
Sub-method of substituteNormalSqrt, where applying the substitution led to a term containing a square...
bool substitutePlusEps(const Constraint< Poly > &_cons, const Substitution< Poly > &_subs, CaseDistinction< Poly > &_result, bool _accordingPaper, carl::Variables &_conflictingVariables, const detail::EvalDoubleIntervalMap &_solutionSpace)
Applies the given substitution to the given constraint, where the substitution is of the form [x -> t...
bool substituteEpsGradients(const Constraint< Poly > &_cons, const Substitution< Poly > &_subs, const carl::Relation _relation, CaseDistinction< Poly > &, bool _accordingPaper, carl::Variables &_conflictingVariables, const detail::EvalDoubleIntervalMap &_solutionSpace)
Sub-method of substituteEps, where one of the gradients in the point represented by the substitution ...
bool substituteNormalSqrtNeq(const Poly &_radicand, const Poly &_q, const Poly &_r, CaseDistinction< Poly > &_result, bool _accordingPaper)
Sub-method of substituteNormalSqrt, where applying the substitution led to a term containing a square...
void substituteNotTrivialCase(const Constraint< Poly > &, const Substitution< Poly > &, CaseDistinction< Poly > &)
Deals with the case, that the left hand side of the constraint to substitute is not a trivial polynom...
void getOddBitStrings(size_t _length, std::vector< std::bitset< MAX_PRODUCT_SPLIT_NUMBER > > &_strings)
bool substitute(const Constraint< Poly > &, const Substitution< Poly > &, CaseDistinction< Poly > &, bool _accordingPaper, carl::Variables &, const detail::EvalDoubleIntervalMap &)
Applies a substitution to a constraint and stores the results in the given vector.
bool substituteNormalSqrtLess(const Poly &_radicand, const Poly &_q, const Poly &_r, const Poly &_s, CaseDistinction< Poly > &_result, bool _accordingPaper)
Sub-method of substituteNormalSqrt, where applying the substitution led to a term containing a square...
bool splitProducts(CaseDistinction< Poly > &, bool=false)
Splits all constraints in the given disjunction of conjunctions of constraints having a non-trivial f...
void getEvenBitStrings(size_t _length, std::vector< std::bitset< MAX_PRODUCT_SPLIT_NUMBER > > &_strings)
void substituteInfLessGreater(const Constraint< Poly > &_cons, const Substitution< Poly > &_subs, CaseDistinction< Poly > &_result)
Applies the given substitution to the given constraint, where the substitution is of the form [x -> +...
bool substituteNormalSqrtEq(const Poly &_radicand, const Poly &_q, const Poly &_r, CaseDistinction< Poly > &_result, bool _accordingPaper)
Sub-method of substituteNormalSqrt, where applying the substitution led to a term containing a square...
bool substituteNormal(const Constraint< Poly > &_cons, const Substitution< Poly > &_subs, CaseDistinction< Poly > &_result, bool _accordingPaper, carl::Variables &_conflictingVariables, const detail::EvalDoubleIntervalMap &_solutionSpace)
Applies a substitution of a variable to a term, which is not minus infinity nor a to an square root e...
void simplify(CaseDistinction< Poly > &)
Simplifies a disjunction of conjunctions of constraints by deleting consistent constraint and inconsi...
CaseDistinction< Poly > getSignCombinations(const Constraint< Poly > &)
For a given constraint f_1*...*f_n ~ 0 this method computes all combinations of constraints f_1 ~_1 0...
std::ostream & operator<<(std::ostream &os, const Substitution< Poly > &s)
bool combine(const std::vector< std::vector< std::vector< combineType > > > &_toCombine, std::vector< std::vector< combineType > > &_combination)
Combines vectors.
A Variable represents an algebraic variable that can be used throughout carl.
const Poly & poly() const noexcept
Represent a sum type/variant of an (in)equality between a variable on the left-hand side and multivar...
const std::variant< MR, RAN > & value() const
Relation relation() const
Represent a polynomial (in)equality against zero.
Substitution(const Variable &variable, const Term< Poly > &term)
const carl::Variable & variable() const
const Term< Poly > & term() const
const Variable & m_variable
const Term< Poly > & m_term
bool is_minus_infty() const