24 using Base = std::variant<Variable, BVVariable, UVariable, UninterpretedFunction>;
32 friend std::hash<ModelVariable>;
37 template<typename T, typename T2 = typename std::enable_if<convertible_to_variant<T, Base>::value, T>::type>
45 return std::holds_alternative<carl::Variable>(
mData);
52 return std::holds_alternative<carl::BVVariable>(
mData);
59 return std::holds_alternative<carl::UVariable>(
mData);
66 return std::holds_alternative<carl::UninterpretedFunction>(
mData);
74 return std::get<carl::Variable>(
mData);
82 return std::get<carl::BVVariable>(
mData);
90 return std::get<carl::UVariable>(
mData);
98 return std::get<carl::UninterpretedFunction>(
mData);
117 return os << mv.
mData;
123 struct hash<
carl::ModelVariable> {
125 return std::hash<carl::ModelVariable::Base>()(mv.
mData);
carl is the main namespace for the library.
bool operator<(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
std::ostream & operator<<(std::ostream &os, const BasicConstraint< Poly > &c)
Prints the given constraint on the given stream.
bool operator==(const BasicConstraint< P > &lhs, const BasicConstraint< P > &rhs)
A Variable represents an algebraic variable that can be used throughout carl.
Represent a BitVector-Variable.
Represent a sum type/variant over the different kinds of variables that exist in CARL to use them in ...
const carl::UVariable & asUVariable() const
carl::Variable asVariable() const
friend bool operator<(const ModelVariable &lhs, const ModelVariable &rhs)
Return true if lhs is smaller than rhs.
friend bool operator==(const ModelVariable &lhs, const ModelVariable &rhs)
Return true if lhs is equal to rhs.
ModelVariable(const T &_t)
Initialize the ModelVariable from some valid type of the underlying variant.
const carl::UninterpretedFunction & asFunction() const
bool isBVVariable() const
std::variant< Variable, BVVariable, UVariable, UninterpretedFunction > Base
Base type for the content.
const carl::BVVariable & asBVVariable() const
friend std::ostream & operator<<(std::ostream &os, const ModelVariable &mv)
std::size_t operator()(const carl::ModelVariable &mv) const
Implements an uninterpreted function.
Implements an uninterpreted variable.