carl  25.02
Computer ARithmetic Library
carl::ModelValue< Rational, Poly > Class Template Reference

Represent a sum type/variant over the different kinds of values that can be assigned to the different kinds of variables that exist in CARL and to use them in a more uniform way, e.g. More...

#include <ModelValue.h>

Public Member Functions

 ModelValue ()=default
 Default constructor. More...
 
 ModelValue (const ModelValue &mv)
 
 ModelValue (ModelValue &&mv)=default
 
template<typename T , typename T2 = typename std::enable_if<convertible_to_variant<T, Super>::value, T>::type>
 ModelValue (const T &_t)
 Initialize the Assignment from some valid type of the underlying variant. More...
 
template<typename T , typename T2 = typename std::enable_if<convertible_to_variant<T, Super>::value, T>::type>
 ModelValue (T &&_t)
 
template<typename ... Args>
 ModelValue (const std::variant< Args... > &variant)
 
 ModelValue (const MultivariateRoot< Poly > &mr)
 
ModelValueoperator= (const ModelValue &mv)
 
ModelValueoperator= (ModelValue &&mv)=default
 
template<typename T >
ModelValueoperator= (const T &t)
 Assign some value to the underlying variant. More...
 
template<typename ... Args>
ModelValueoperator= (const std::variant< Args... > &variant)
 
ModelValueoperator= (const MultivariateRoot< Poly > &mr)
 
template<typename F >
auto visit (F &&f) const
 
bool isBool () const
 
bool isRational () const
 
bool isSqrtEx () const
 
bool isRAN () const
 
bool isBVValue () const
 
bool isSortValue () const
 
bool isUFModel () const
 
bool isSubstitution () const
 
bool isPlusInfinity () const
 
bool isMinusInfinity () const
 
bool isSymbolicInterval () const
 
bool isInfinitesimal () const
 
bool asBool () const
 
const RationalasRational () const
 
const SqrtEx< Poly > & asSqrtEx () const
 
const RANasRAN () const
 
const BVValueasBVValue () const
 
const SortValueasSortValue () const
 
const UFModelasUFModel () const
 
UFModelasUFModel ()
 
const InfinityValueasInfinity () const
 
const ModelSubstitutionPtr< Rational, Poly > & asSubstitution () const
 
ModelSubstitutionPtr< Rational, Poly > & asSubstitution ()
 
const SymbolicInterval< Poly > & asSymbolicInterval () const
 
const Infinitesimal< RAN > & asInfinitesimal () const
 

Private Types

using RAN = typename Poly::RootType
 
using Super = std::variant< bool, Rational, SqrtEx< Poly >, RAN, BVValue, SortValue, UFModel, InfinityValue, ModelSubstitutionPtr< Rational, Poly >, SymbolicInterval< Poly >, Infinitesimal< RAN > >
 Base type we are deriving from. More...
 

Private Member Functions

template<typename Variant >
Super clone (const Variant &v) const
 

Private Attributes

Super mData
 

Friends

template<typename R , typename P >
std::ostream & operator<< (std::ostream &os, const ModelValue< R, P > &mv)
 
template<typename R , typename P >
bool operator== (const ModelValue< R, P > &lhs, const ModelValue< R, P > &rhs)
 
template<typename R , typename P >
bool operator< (const ModelValue< R, P > &lhs, const ModelValue< R, P > &rhs)
 

Detailed Description

template<typename Rational, typename Poly>
class carl::ModelValue< Rational, Poly >

Represent a sum type/variant over the different kinds of values that can be assigned to the different kinds of variables that exist in CARL and to use them in a more uniform way, e.g.

a plain "bool", "infinity", a "carl::RealAlgebraicNumber", a (bitvector) "carl::BVValue" etc.

Definition at line 103 of file ModelValue.h.

Member Typedef Documentation

◆ RAN

template<typename Rational , typename Poly >
using carl::ModelValue< Rational, Poly >::RAN = typename Poly::RootType
private

Definition at line 111 of file ModelValue.h.

◆ Super

template<typename Rational , typename Poly >
using carl::ModelValue< Rational, Poly >::Super = std::variant< bool, Rational, SqrtEx<Poly>, RAN, BVValue, SortValue, UFModel, InfinityValue, ModelSubstitutionPtr<Rational,Poly>, SymbolicInterval<Poly>, Infinitesimal<RAN> >
private

Base type we are deriving from.

Definition at line 115 of file ModelValue.h.

Constructor & Destructor Documentation

◆ ModelValue() [1/7]

template<typename Rational , typename Poly >
carl::ModelValue< Rational, Poly >::ModelValue ( )
default

Default constructor.

◆ ModelValue() [2/7]

template<typename Rational , typename Poly >
carl::ModelValue< Rational, Poly >::ModelValue ( const ModelValue< Rational, Poly > &  mv)
inline

Definition at line 148 of file ModelValue.h.

◆ ModelValue() [3/7]

template<typename Rational , typename Poly >
carl::ModelValue< Rational, Poly >::ModelValue ( ModelValue< Rational, Poly > &&  mv)
default

◆ ModelValue() [4/7]

template<typename Rational , typename Poly >
template<typename T , typename T2 = typename std::enable_if<convertible_to_variant<T, Super>::value, T>::type>
carl::ModelValue< Rational, Poly >::ModelValue ( const T &  _t)
inline

Initialize the Assignment from some valid type of the underlying variant.

Definition at line 157 of file ModelValue.h.

◆ ModelValue() [5/7]

template<typename Rational , typename Poly >
template<typename T , typename T2 = typename std::enable_if<convertible_to_variant<T, Super>::value, T>::type>
carl::ModelValue< Rational, Poly >::ModelValue ( T &&  _t)
inline

Definition at line 160 of file ModelValue.h.

◆ ModelValue() [6/7]

template<typename Rational , typename Poly >
template<typename ... Args>
carl::ModelValue< Rational, Poly >::ModelValue ( const std::variant< Args... > &  variant)
inline

Definition at line 163 of file ModelValue.h.

◆ ModelValue() [7/7]

template<typename Rational , typename Poly >
carl::ModelValue< Rational, Poly >::ModelValue ( const MultivariateRoot< Poly > &  mr)
inline

Definition at line 165 of file ModelValue.h.

Member Function Documentation

◆ asBool()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::asBool ( ) const
inline

Definition at line 218 of file ModelValue.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asBVValue()

template<typename Rational , typename Poly >
const BVValue& carl::ModelValue< Rational, Poly >::asBVValue ( ) const
inline

Definition at line 222 of file ModelValue.h.

Here is the call graph for this function:

◆ asInfinitesimal()

template<typename Rational , typename Poly >
const Infinitesimal<RAN>& carl::ModelValue< Rational, Poly >::asInfinitesimal ( ) const
inline

Definition at line 230 of file ModelValue.h.

Here is the call graph for this function:

◆ asInfinity()

template<typename Rational , typename Poly >
const InfinityValue& carl::ModelValue< Rational, Poly >::asInfinity ( ) const
inline

Definition at line 226 of file ModelValue.h.

Here is the call graph for this function:

◆ asRAN()

template<typename Rational , typename Poly >
const RAN& carl::ModelValue< Rational, Poly >::asRAN ( ) const
inline

Definition at line 221 of file ModelValue.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asRational()

template<typename Rational , typename Poly >
const Rational& carl::ModelValue< Rational, Poly >::asRational ( ) const
inline

Definition at line 219 of file ModelValue.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asSortValue()

template<typename Rational , typename Poly >
const SortValue& carl::ModelValue< Rational, Poly >::asSortValue ( ) const
inline

Definition at line 223 of file ModelValue.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asSqrtEx()

template<typename Rational , typename Poly >
const SqrtEx<Poly>& carl::ModelValue< Rational, Poly >::asSqrtEx ( ) const
inline

Definition at line 220 of file ModelValue.h.

Here is the call graph for this function:

◆ asSubstitution() [1/2]

template<typename Rational , typename Poly >
ModelSubstitutionPtr<Rational,Poly>& carl::ModelValue< Rational, Poly >::asSubstitution ( )
inline

Definition at line 228 of file ModelValue.h.

Here is the call graph for this function:

◆ asSubstitution() [2/2]

template<typename Rational , typename Poly >
const ModelSubstitutionPtr<Rational,Poly>& carl::ModelValue< Rational, Poly >::asSubstitution ( ) const
inline

Definition at line 227 of file ModelValue.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asSymbolicInterval()

template<typename Rational , typename Poly >
const SymbolicInterval<Poly>& carl::ModelValue< Rational, Poly >::asSymbolicInterval ( ) const
inline

Definition at line 229 of file ModelValue.h.

Here is the call graph for this function:

◆ asUFModel() [1/2]

template<typename Rational , typename Poly >
UFModel& carl::ModelValue< Rational, Poly >::asUFModel ( )
inline

Definition at line 225 of file ModelValue.h.

Here is the call graph for this function:

◆ asUFModel() [2/2]

template<typename Rational , typename Poly >
const UFModel& carl::ModelValue< Rational, Poly >::asUFModel ( ) const
inline

Definition at line 224 of file ModelValue.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone()

template<typename Rational , typename Poly >
template<typename Variant >
Super carl::ModelValue< Rational, Poly >::clone ( const Variant &  v) const
inlineprivate

Definition at line 132 of file ModelValue.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isBool()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isBool ( ) const
inline

Definition at line 201 of file ModelValue.h.

Here is the caller graph for this function:

◆ isBVValue()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isBVValue ( ) const
inline

Definition at line 205 of file ModelValue.h.

Here is the caller graph for this function:

◆ isInfinitesimal()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isInfinitesimal ( ) const
inline

Definition at line 216 of file ModelValue.h.

Here is the caller graph for this function:

◆ isMinusInfinity()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isMinusInfinity ( ) const
inline

Definition at line 212 of file ModelValue.h.

Here is the caller graph for this function:

◆ isPlusInfinity()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isPlusInfinity ( ) const
inline

Definition at line 209 of file ModelValue.h.

Here is the caller graph for this function:

◆ isRAN()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isRAN ( ) const
inline

Definition at line 204 of file ModelValue.h.

Here is the caller graph for this function:

◆ isRational()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isRational ( ) const
inline

Definition at line 202 of file ModelValue.h.

Here is the caller graph for this function:

◆ isSortValue()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isSortValue ( ) const
inline

Definition at line 206 of file ModelValue.h.

Here is the caller graph for this function:

◆ isSqrtEx()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isSqrtEx ( ) const
inline

Definition at line 203 of file ModelValue.h.

Here is the caller graph for this function:

◆ isSubstitution()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isSubstitution ( ) const
inline

Definition at line 208 of file ModelValue.h.

Here is the caller graph for this function:

◆ isSymbolicInterval()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isSymbolicInterval ( ) const
inline

Definition at line 215 of file ModelValue.h.

Here is the caller graph for this function:

◆ isUFModel()

template<typename Rational , typename Poly >
bool carl::ModelValue< Rational, Poly >::isUFModel ( ) const
inline

Definition at line 207 of file ModelValue.h.

Here is the caller graph for this function:

◆ operator=() [1/5]

template<typename Rational , typename Poly >
ModelValue& carl::ModelValue< Rational, Poly >::operator= ( const ModelValue< Rational, Poly > &  mv)
inline

Definition at line 167 of file ModelValue.h.

Here is the call graph for this function:

◆ operator=() [2/5]

template<typename Rational , typename Poly >
ModelValue& carl::ModelValue< Rational, Poly >::operator= ( const MultivariateRoot< Poly > &  mr)
inline

Definition at line 191 of file ModelValue.h.

◆ operator=() [3/5]

template<typename Rational , typename Poly >
template<typename ... Args>
ModelValue& carl::ModelValue< Rational, Poly >::operator= ( const std::variant< Args... > &  variant)
inline

Definition at line 186 of file ModelValue.h.

Here is the call graph for this function:

◆ operator=() [4/5]

template<typename Rational , typename Poly >
template<typename T >
ModelValue& carl::ModelValue< Rational, Poly >::operator= ( const T &  t)
inline

Assign some value to the underlying variant.

Parameters
tSome value.
Returns
*this.

Definition at line 180 of file ModelValue.h.

◆ operator=() [5/5]

template<typename Rational , typename Poly >
ModelValue& carl::ModelValue< Rational, Poly >::operator= ( ModelValue< Rational, Poly > &&  mv)
default

◆ visit()

template<typename Rational , typename Poly >
template<typename F >
auto carl::ModelValue< Rational, Poly >::visit ( F &&  f) const
inline

Definition at line 197 of file ModelValue.h.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<

template<typename Rational , typename Poly >
template<typename R , typename P >
bool operator< ( const ModelValue< R, P > &  lhs,
const ModelValue< R, P > &  rhs 
)
friend

◆ operator<<

template<typename Rational , typename Poly >
template<typename R , typename P >
std::ostream& operator<< ( std::ostream &  os,
const ModelValue< R, P > &  mv 
)
friend

Definition at line 255 of file ModelValue.h.

◆ operator==

template<typename Rational , typename Poly >
template<typename R , typename P >
bool operator== ( const ModelValue< R, P > &  lhs,
const ModelValue< R, P > &  rhs 
)
friend

Field Documentation

◆ mData

template<typename Rational , typename Poly >
Super carl::ModelValue< Rational, Poly >::mData
private

Definition at line 129 of file ModelValue.h.


The documentation for this class was generated from the following file: