6 inline std::vector<carl::BasicConstraint<P>>
constr_from_vc(
const carl::VariableComparison<P>& vc,
const carl::Assignment<typename P::RootType> assignment,
bool tarski =
false) {
7 SMTRAT_LOG_FUNC(
"smtrat.mcsat.utils", vc <<
", " << assignment <<
", " << tarski)
8 auto constraint = carl::as_constraint(vc);
11 return std::vector<carl::BasicConstraint<P>>({*constraint});
14 auto poly = defining_polynomial(vc);
15 std::vector<carl::BasicConstraint<P>> constraints;
16 for (
auto i = poly.degree(vc.var()); i > 0; i--) {
17 carl::BasicConstraint<P> less_constr(poly, carl::Relation::LESS);
19 assert(!indeterminate(less_eval));
21 constraints.emplace_back(less_constr);
23 carl::BasicConstraint<P> greater_constr(poly, carl::Relation::GREATER);
25 assert(!indeterminate(greater_eval));
27 constraints.emplace_back(greater_constr);
34 poly = carl::derivative(poly);
39 return std::vector<carl::BasicConstraint<P>>();
Rational evaluate(carl::Variable v, const Poly &p, const Rational &r)
std::vector< carl::BasicConstraint< P > > constr_from_vc(const carl::VariableComparison< P > &vc, const carl::Assignment< typename P::RootType > assignment, bool tarski=false)
#define SMTRAT_LOG_TRACE(channel, msg)
#define SMTRAT_LOG_FUNC(channel, args)