4 #include <boost/variant.hpp>
12 namespace conversion {
16 template<
typename From>
28 template<
typename From>
41 carl::BVValue value(from.
width);
45 for (std::size_t i = 0; v > 0; i++) {
60 template<
typename From>
80 template<
typename From>
89 if (from.type() != carl::VariableType::VT_BOOL)
return false;
98 template<
typename Res>
107 template<BOOST_VARIANT_ENUM_PARAMS(
typename T)>
108 bool operator()(
const boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>& t) {
109 return boost::apply_visitor(*
this, t);
111 template<BOOST_VARIANT_ENUM_PARAMS(
typename T)>
112 bool operator()(
const boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>& t, Res& r) {
121 if ((*
this)(t))
return result;
123 SMTRAT_LOG_ERROR(
"smtrat.parser",
"Failed to convert \"" << t <<
"\" to " <<
typeid(T).name() <<
".");
132 template<
typename Res>
139 template<
typename Variant>
141 return boost::apply_visitor(*
this, t);
149 template<
typename Res>
152 template<BOOST_VARIANT_ENUM_PARAMS(
typename T)>
153 bool operator()(
const std::vector<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>>& v, std::vector<Res>&
result)
const {
156 for (
const auto& val: v) {
162 template<BOOST_VARIANT_ENUM_PARAMS(
typename T)>
166 for (
const auto& val: v) {
169 errors.
next() <<
"Failed to convert \"" << val <<
"\" to " <<
typeid(Res).name() <<
".";
Numeric mod(const Numeric &_valueA, const Numeric &_valueB)
Calculates the result of the first argument modulo the second argument.
carl::BVVariable BVVariable
carl::BVTerm BVTerm
Typedef for bitvector term.
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
carl::MultivariatePolynomial< Rational > Poly
carl::IntegralType< Rational >::type Integer
#define SMTRAT_LOG_ERROR(channel, msg)
Represents a constant of a fixed width.
bool operator()(const Rational &from, Poly &to) const
bool operator()(const Poly &from, Poly &to) const
bool operator()(const From &, Poly &) const
bool operator()(const carl::Variable &from, Poly &to) const
bool operator()(const types::BVVariable &from, types::BVTerm &to) const
bool operator()(const FixedWidthConstant< Integer > &from, types::BVTerm &to) const
bool operator()(const types::BVTerm &from, types::BVTerm &to) const
bool operator()(const From &, types::BVTerm &) const
bool operator()(const To &from, To &to) const
bool operator()(const From &, To &) const
Converts variants to some type using the Converter class.
bool operator()(const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T)> &t, Res &r)
bool operator()(const T &t)
Converter< Res > converter
bool operator()(const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T)> &t)
Converts variants to another variant type not using the Converter class.
Res operator()(const T &t)
Res convert(const Variant &t)
Converts a vector of variants to a vector of some type using the Converter class.
bool operator()(const std::vector< boost::variant< BOOST_VARIANT_ENUM_PARAMS(T)>> &v, std::vector< Res > &result, TheoryError &errors) const
bool operator()(const std::vector< boost::variant< BOOST_VARIANT_ENUM_PARAMS(T)>> &v, std::vector< Res > &result) const