17 template<
typename Rational,
typename Poly>
19 template<
typename Rational,
typename Poly>
20 class ModelSubstitution;
21 template<
typename Rational,
typename Poly>
22 class ModelMVRootSubstitution;
23 template<
typename Rational,
typename Poly>
25 template<
typename Rational,
typename Poly,
typename Substitution,
typename... Args>
27 template<
typename Rational,
typename Poly,
typename Substitution,
typename... Args>
29 template<
typename Rational,
typename Poly>
45 return os << (iv.
positive ?
"+" :
"-") <<
"infinity";
55 template<
typename Rational,
typename Poly>
57 template<
typename R,
typename P>
59 template<
typename R,
typename P>
61 template<
typename R,
typename P>
70 template<
typename Variant>
77 [](
const auto& t) {
return Super(t); }
95 template<typename T, typename T2 = typename std::enable_if<convertible_to_variant<T, Super>::value, T>::type>
98 template<typename T, typename T2 = typename std::enable_if<convertible_to_variant<T, Super>::value, T>::type>
101 template<
typename ...Args>
124 template<
typename ...Args>
131 mData = createSubstitution<Rational,Poly>(mr).asSubstitution();
144 return std::holds_alternative<bool>(
mData);
151 return std::holds_alternative<Rational>(
mData);
158 return std::holds_alternative<SqrtEx<Poly>>(
mData);
165 return std::holds_alternative<typename Poly::RootType>(
mData);
172 return std::holds_alternative<BVValue>(
mData);
179 return std::holds_alternative<SortValue>(
mData);
186 return std::holds_alternative<UFModel>(
mData);
193 return std::holds_alternative<InfinityValue>(
mData) && std::get<InfinityValue>(
mData).positive;
199 return std::holds_alternative<InfinityValue>(
mData) && !std::get<InfinityValue>(
mData).positive;
203 return std::holds_alternative<ModelSubstitutionPtr<Rational,Poly>>(
mData);
211 return std::get<bool>(
mData);
219 return std::get<Rational>(
mData);
227 return std::get<SqrtEx<Poly>>(
mData);
233 const typename Poly::RootType&
asRAN()
const {
235 return std::get<typename Poly::RootType>(
mData);
243 return std::get<carl::BVValue>(
mData);
251 return std::get<SortValue>(
mData);
259 return std::get<UFModel>(
mData);
263 return std::get<UFModel>(
mData);
270 return std::get<InfinityValue>(
mData);
275 return std::get<ModelSubstitutionPtr<Rational,Poly>>(
mData);
279 return std::get<ModelSubstitutionPtr<Rational,Poly>>(
mData);
294 template<
typename Rational,
typename Poly>
299 template<
typename Rational,
typename Poly>
304 template<
typename R,
typename P>
306 return os << mv.
mData;
Represent a dynamic root, also known as a "root expression".
Represent a real algebraic number (RAN) in one of several ways:
carl is the main namespace for the library.
bool operator<(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
ModelValue< Rational, Poly > createSubstitution(Args &&... args)
std::ostream & operator<<(std::ostream &os, const BasicConstraint< Poly > &c)
Prints the given constraint on the given stream.
void visit(const Formula< Pol > &formula, Visitor func)
Recursively calls func on every subformula.
bool operator==(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
ModelSubstitutionPtr< Rational, Poly > createSubstitutionPtr(Args &&... args)
std::unique_ptr< ModelSubstitution< Rational, Poly > > ModelSubstitutionPtr
Represent a sum type/variant over the different kinds of values that can be assigned to the different...
const InfinityValue & asInfinity() const
bool isPlusInfinity() const
std::variant< bool, Rational, SqrtEx< Poly >, typename Poly::RootType, BVValue, SortValue, UFModel, InfinityValue, ModelSubstitutionPtr< Rational, Poly > > Super
Base type we are deriving from.
ModelValue & operator=(ModelValue &&mv)=default
const Poly::RootType & asRAN() const
ModelValue & operator=(const MultivariateRoot< Poly > &mr)
Super clone(const Variant &v) const
ModelValue & operator=(const std::variant< Args... > &variant)
ModelValue(const std::variant< Args... > &variant)
const SqrtEx< Poly > & asSqrtEx() const
const ModelSubstitutionPtr< Rational, Poly > & asSubstitution() const
friend std::ostream & operator<<(std::ostream &os, const ModelValue< R, P > &mv)
bool isMinusInfinity() const
ModelValue(const ModelValue &mv)
const Rational & asRational() const
ModelValue()=default
Default constructor.
ModelValue & operator=(const ModelValue &mv)
const SortValue & asSortValue() const
ModelValue(ModelValue &&mv)=default
const carl::BVValue & asBVValue() const
ModelSubstitutionPtr< Rational, Poly > & asSubstitution()
friend bool operator==(const ModelValue< R, P > &lhs, const ModelValue< R, P > &rhs)
bool isSubstitution() const
ModelValue(const MultivariateRoot< Poly > &mr)
const UFModel & asUFModel() const
ModelValue & operator=(const T &t)
Assign some value to the underlying variant.
friend bool operator<(const ModelValue< R, P > &lhs, const ModelValue< R, P > &rhs)
ModelValue(const T &_t)
Initialize the Assignment from some valid type of the underlying variant.
This class represents infinity or minus infinity, depending on its flag positive.
Implements a sort value, being a value of the uninterpreted domain specified by this sort.
Implements a sort value, being a value of the uninterpreted domain specified by this sort.