carl  24.04
Computer ARithmetic Library
carl::ModelSubstitution< Rational, Poly > Class Template Referenceabstract

Represent a expression for a ModelValue with variables as placeholders, where the final expression's value depends on the bindings/values of these variables. More...

#include <ModelSubstitution.h>

Inheritance diagram for carl::ModelSubstitution< Rational, Poly >:

Public Member Functions

 ModelSubstitution ()=default
 
virtual ~ModelSubstitution () noexcept=default
 
const ModelValue< Rational, Poly > & evaluate (const Model< Rational, Poly > &model) const
 
void resetCache () const
 
virtual bool dependsOn (const ModelVariable &) const
 Check if this substitution needs the given model variable. More...
 
virtual void print (std::ostream &os) const
 Print this substitution to the given output stream. More...
 
virtual void multiplyBy (const Rational &_number)=0
 Multiply this model substitution by a rational. More...
 
virtual void add (const Rational &_number)=0
 Add a rational to this model substitution. More...
 
virtual ModelSubstitutionPtr< Rational, Poly > clone () const =0
 Create a copy of this model substitution. More...
 
virtual Formula< Poly > representingFormula (const ModelVariable &mv)=0
 
template<typename Iterator >
const ModelValue< Rational, Poly > & getModelValue (Iterator _mvit, Model< Rational, Poly > &_model)
 

Protected Member Functions

virtual ModelValue< Rational, Poly > evaluateSubstitution (const Model< Rational, Poly > &model) const =0
 Evaluate this substitution with respect to the given model. More...
 

Private Attributes

std::optional< ModelValue< Rational, Poly > > mCachedValue
 

Detailed Description

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

Represent a expression for a ModelValue with variables as placeholders, where the final expression's value depends on the bindings/values of these variables.

The values are given in the (abstract) form of a "carl::Model".

Definition at line 26 of file ModelSubstitution.h.

Constructor & Destructor Documentation

◆ ModelSubstitution()

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

◆ ~ModelSubstitution()

template<typename Rational , typename Poly >
virtual carl::ModelSubstitution< Rational, Poly >::~ModelSubstitution ( )
virtualdefaultnoexcept

Member Function Documentation

◆ add()

template<typename Rational , typename Poly >
virtual void carl::ModelSubstitution< Rational, Poly >::add ( const Rational _number)
pure virtual

◆ clone()

template<typename Rational , typename Poly >
virtual ModelSubstitutionPtr<Rational,Poly> carl::ModelSubstitution< Rational, Poly >::clone ( ) const
pure virtual

◆ dependsOn()

template<typename Rational , typename Poly >
virtual bool carl::ModelSubstitution< Rational, Poly >::dependsOn ( const ModelVariable ) const
inlinevirtual

◆ evaluate()

template<typename Rational , typename Poly >
const ModelValue<Rational, Poly>& carl::ModelSubstitution< Rational, Poly >::evaluate ( const Model< Rational, Poly > &  model) const
inline

Definition at line 37 of file ModelSubstitution.h.

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

◆ evaluateSubstitution()

template<typename Rational , typename Poly >
virtual ModelValue<Rational, Poly> carl::ModelSubstitution< Rational, Poly >::evaluateSubstitution ( const Model< Rational, Poly > &  model) const
protectedpure virtual

Evaluate this substitution with respect to the given model.

Implemented in carl::ModelConditionalSubstitution< Rational, Poly >, carl::ModelPolynomialSubstitution< Rational, Poly >, carl::ModelMVRootSubstitution< Rational, Poly >, and carl::ModelFormulaSubstitution< Rational, Poly >.

Here is the caller graph for this function:

◆ getModelValue()

template<typename Rational , typename Poly >
template<typename Iterator >
const ModelValue<Rational,Poly>& carl::ModelSubstitution< Rational, Poly >::getModelValue ( Iterator  _mvit,
Model< Rational, Poly > &  _model 
)
inline

Definition at line 66 of file ModelSubstitution.h.

Here is the call graph for this function:

◆ multiplyBy()

template<typename Rational , typename Poly >
virtual void carl::ModelSubstitution< Rational, Poly >::multiplyBy ( const Rational _number)
pure virtual

◆ print()

template<typename Rational , typename Poly >
virtual void carl::ModelSubstitution< Rational, Poly >::print ( std::ostream &  os) const
inlinevirtual

Print this substitution to the given output stream.

Reimplemented in carl::ModelPolynomialSubstitution< Rational, Poly >, carl::ModelMVRootSubstitution< Rational, Poly >, carl::ModelFormulaSubstitution< Rational, Poly >, and carl::ModelConditionalSubstitution< Rational, Poly >.

Definition at line 52 of file ModelSubstitution.h.

Here is the caller graph for this function:

◆ representingFormula()

◆ resetCache()

template<typename Rational , typename Poly >
void carl::ModelSubstitution< Rational, Poly >::resetCache ( ) const
inline

Definition at line 43 of file ModelSubstitution.h.

Field Documentation

◆ mCachedValue

template<typename Rational , typename Poly >
std::optional<ModelValue<Rational, Poly> > carl::ModelSubstitution< Rational, Poly >::mCachedValue
mutableprivate

Definition at line 28 of file ModelSubstitution.h.


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