23 if (it->constraint().relation() != carl::Relation::LEQ)
continue;
24 for (
auto it_other = std::next(it); it_other !=
m_constraints.end(); ++it_other) {
25 if (it_other->constraint().relation() != carl::Relation::LEQ)
continue;
26 if (it_other->constraint().lhs() + it->constraint().lhs() ==
Poly(0)) {
34 auto first_ineq = std::partition(
37 [](
const auto& c) { return c.constraint().relation() == carl::Relation::EQ; }
41 for (
auto eq_it =
m_constraints.begin(); eq_it != first_ineq; ++eq_it) {
42 Poly lhs = eq_it->constraint().lhs();
43 assert(lhs.is_linear());
44 std::optional<TermT> subst_term = std::nullopt;
45 for (
const auto& term: lhs) {
46 if (term.is_constant())
continue;
55 done.push_back(*eq_it);
59 Poly subst = (
Poly(*subst_term) - lhs)/(subst_term->coeff());
60 std::for_each(std::next(eq_it),
m_constraints.end(), [&subst_term, &subst](
auto& c){
61 Poly other_lhs = c.constraint().lhs();
62 carl::substitute_inplace(other_lhs, subst_term->single_variable(), subst);
63 c = FormulaT(other_lhs, c.constraint().relation());
67 for (
const auto& c : done) {
68 if (c.constraint().is_consistent() == 0) {
EquationSubstitution(FormulasT &&cs, std::vector< carl::Variable > &&vs)
std::vector< carl::Variable > m_variables
FormulasT remaining_constraints()
EquationSubstitution(const FormulasT &cs, const std::vector< carl::Variable > &vs)
std::vector< carl::Variable > remaining_variables()
static bool find(V &ts, const T &t)
carl::Formula< Poly > FormulaT
carl::MultivariatePolynomial< Rational > Poly
carl::Formulas< Poly > FormulasT
#define SMTRAT_LOG_DEBUG(channel, msg)