7 #include <boost/logic/tribool_io.hpp>
11 template<
typename Number,
typename Poly>
24 template<
typename Pol>
30 auto varIter = vars.begin();
31 auto varIntervalIter = _solutionInterval.begin();
32 while (varIter != vars.end() && varIntervalIter != _solutionInterval.end()) {
33 if (*varIter < varIntervalIter->first) {
35 }
else if (*varIter > varIntervalIter->first) {
42 if (varIter != vars.end())
62 if (solutionSpace.
upper() < 0)
73 if (solutionSpace.
lower() > 0)
86 if (solutionSpace.
lower() > 0)
97 if (solutionSpace.
upper() < 0)
105 std::cout <<
"Error in isConsistent: unexpected relation symbol." << std::endl;
123 template<
typename Pol>
130 auto varIter = vars.begin();
131 auto varIntervalIter = _solutionInterval.begin();
132 while (varIter != vars.end() && varIntervalIter != _solutionInterval.end()) {
133 if (*varIter < varIntervalIter->first) {
135 }
else if (*varIter > varIntervalIter->first) {
142 if (varIter != vars.end())
151 else if (!solutionSpace.
contains(0))
167 if (solutionSpace.
upper() < 0)
178 if (solutionSpace.
lower() > 0)
189 if (solutionSpace.
upper() <= 0) {
194 if (solutionSpace.
lower() > 0) {
196 }
else if (solutionSpace.
lower() == 0) {
208 if (solutionSpace.
lower() >= 0)
212 if (solutionSpace.
upper() < 0)
214 else if (solutionSpace.
upper() == 0) {
224 std::cout <<
"Error in isConsistent: unexpected relation symbol." << std::endl;
carl is the main namespace for the library.
bool evaluate(const BasicConstraint< Poly > &c, const Assignment< Number > &m)
static unsigned consistent_with(const BasicConstraint< Pol > &c, const Assignment< Interval< double >> &_solutionInterval)
Checks whether this constraint is consistent with the given assignment from the its variables to inte...
@ WEAK
the given bound is compared by a weak ordering relation
@ STRICT
the given bound is compared by a strict ordering relation
@ INFTY
the given bound is interpreted as minus or plus infinity depending on whether it is the left or the r...
std::map< Variable, T > Assignment
void variables(const BasicConstraint< Pol > &c, carlVariables &vars)
Represent a polynomial (in)equality against zero.
Relation relation() const
The class which contains the interval arithmetic including trigonometric functions.
bool is_empty() const
Function which determines, if the interval is empty.
BoundType lower_bound_type() const
The getter for the lower bound type of the interval.
const Number & upper() const
The getter for the upper boundary of the interval.
bool contains(const Number &val) const
Checks if the interval contains the given value.
const Number & lower() const
The getter for the lower boundary of the interval.
BoundType upper_bound_type() const
The getter for the upper bound type of the interval.
bool is_zero() const
Function which determines, if the interval is the zero interval.