Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::expressions::UnaryExpression Class Reference

#include <UnaryExpression.h>

Inheritance diagram for storm::expressions::UnaryExpression:
Collaboration diagram for storm::expressions::UnaryExpression:

Public Member Functions

 UnaryExpression (ExpressionManager const &manager, Type const &type, std::shared_ptr< BaseExpression const > const &operand)
 Creates a unary expression with the given return type and operand.
 
 UnaryExpression (UnaryExpression const &other)=default
 
UnaryExpressionoperator= (UnaryExpression const &other)=delete
 
 UnaryExpression (UnaryExpression &&)=default
 
UnaryExpressionoperator= (UnaryExpression &&)=delete
 
virtual ~UnaryExpression ()=default
 
virtual bool isFunctionApplication () const override
 Checks if the expression is a function application (of any sort).
 
virtual bool containsVariables () const override
 Retrieves whether the expression contains a variable.
 
virtual uint_fast64_t getArity () const override
 Returns the arity of the expression.
 
virtual std::shared_ptr< BaseExpression const > getOperand (uint_fast64_t operandIndex) const override
 Retrieves the given operand from the expression.
 
virtual void gatherVariables (std::set< storm::expressions::Variable > &variables) const override
 Retrieves the set of all variables that appear in the expression.
 
std::shared_ptr< BaseExpression const > const & getOperand () const
 Retrieves the operand of the unary expression.
 
- Public Member Functions inherited from storm::expressions::BaseExpression
 BaseExpression (ExpressionManager const &manager, Type const &type)
 Constructs a base expression with the given return type.
 
 BaseExpression (BaseExpression const &)=default
 
BaseExpressionoperator= (BaseExpression const &)=delete
 
 BaseExpression (BaseExpression &&)=default
 
BaseExpressionoperator= (BaseExpression &&)=delete
 
virtual ~BaseExpression ()=default
 
Expression toExpression () const
 Converts the base expression to a proper expression.
 
virtual bool evaluateAsBool (Valuation const *valuation=nullptr) const
 Evaluates the expression under the valuation of unknowns (variables and constants) given by the valuation and returns the resulting boolean value.
 
virtual int_fast64_t evaluateAsInt (Valuation const *valuation=nullptr) const
 Evaluates the expression under the valuation of unknowns (variables and constants) given by the valuation and returns the resulting integer value.
 
virtual double evaluateAsDouble (Valuation const *valuation=nullptr) const
 Evaluates the expression under the valuation of unknowns (variables and constants) given by the valuation and returns the resulting double value.
 
virtual storm::RationalNumber evaluateAsRational () const
 Evaluates the expression and returns the resulting rational number.
 
virtual std::string const & getIdentifier () const
 Retrieves the identifier associated with this expression.
 
virtual OperatorType getOperator () const
 Retrieves the operator of a function application.
 
virtual bool isLiteral () const
 Retrieves whether the expression is a literal.
 
virtual bool isVariable () const
 Retrieves whether the expression is a variable.
 
virtual bool isTrue () const
 Checks if the expression is equal to the boolean literal true.
 
virtual bool isFalse () const
 Checks if the expression is equal to the boolean literal false.
 
virtual std::shared_ptr< BaseExpression const > simplify () const =0
 Simplifies the expression according to some simple rules.
 
std::shared_ptr< BaseExpression const > reduceNesting () const
 Tries to flatten the syntax tree of the expression, e.g., 1 + (2 + (3 + 4)) becomes (1 + 2) + (3 + 4)
 
virtual boost::any accept (ExpressionVisitor &visitor, boost::any const &data) const =0
 Accepts the given visitor by calling its visit method.
 
bool hasNumericalType () const
 Retrieves whether the expression has a numerical type, i.e., integer or double.
 
bool hasIntegerType () const
 Retrieves whether the expression has an integer type.
 
bool hasBitVectorType () const
 Retrieves whether the expression has a bitvector type.
 
bool hasBooleanType () const
 Retrieves whether the expression has a boolean type.
 
bool hasRationalType () const
 Retrieves whether the expression has a rational return type.
 
std::shared_ptr< BaseExpression const > getSharedPointer () const
 Retrieves a shared pointer to this expression.
 
ExpressionManager const & getManager () const
 Retrieves the manager responsible for this expression.
 
Type const & getType () const
 Retrieves the type of the expression.
 
virtual bool isIfThenElseExpression () const
 
IfThenElseExpression const & asIfThenElseExpression () const
 
virtual bool isBinaryBooleanFunctionExpression () const
 
BinaryBooleanFunctionExpression const & asBinaryBooleanFunctionExpression () const
 
virtual bool isBinaryNumericalFunctionExpression () const
 
BinaryNumericalFunctionExpression const & asBinaryNumericalFunctionExpression () const
 
virtual bool isBinaryRelationExpression () const
 
BinaryRelationExpression const & asBinaryRelationExpression () const
 
virtual bool isBooleanLiteralExpression () const
 
BooleanLiteralExpression const & asBooleanLiteralExpression () const
 
virtual bool isIntegerLiteralExpression () const
 
IntegerLiteralExpression const & asIntegerLiteralExpression () const
 
virtual bool isRationalLiteralExpression () const
 
RationalLiteralExpression const & asRationalLiteralExpression () const
 
virtual bool isUnaryBooleanFunctionExpression () const
 
UnaryBooleanFunctionExpression const & asUnaryBooleanFunctionExpression () const
 
virtual bool isUnaryNumericalFunctionExpression () const
 
UnaryNumericalFunctionExpression const & asUnaryNumericalFunctionExpression () const
 
virtual bool isVariableExpression () const
 
VariableExpression const & asVariableExpression () const
 
virtual bool isPredicateExpression () const
 
PredicateExpression const & asPredicateExpression () const
 

Additional Inherited Members

- Protected Member Functions inherited from storm::expressions::BaseExpression
virtual void printToStream (std::ostream &stream) const =0
 Prints the expression to the given stream.
 

Detailed Description

Definition at line 9 of file UnaryExpression.h.

Constructor & Destructor Documentation

◆ UnaryExpression() [1/3]

storm::expressions::UnaryExpression::UnaryExpression ( ExpressionManager const &  manager,
Type const &  type,
std::shared_ptr< BaseExpression const > const &  operand 
)

Creates a unary expression with the given return type and operand.

Parameters
managerThe manager responsible for this expression.
typeThe return type of the expression.
operandThe operand of the unary expression.

Definition at line 8 of file UnaryExpression.cpp.

◆ UnaryExpression() [2/3]

storm::expressions::UnaryExpression::UnaryExpression ( UnaryExpression const &  other)
default

◆ UnaryExpression() [3/3]

storm::expressions::UnaryExpression::UnaryExpression ( UnaryExpression &&  )
default

◆ ~UnaryExpression()

virtual storm::expressions::UnaryExpression::~UnaryExpression ( )
virtualdefault

Member Function Documentation

◆ containsVariables()

bool storm::expressions::UnaryExpression::containsVariables ( ) const
overridevirtual

Retrieves whether the expression contains a variable.

Returns
True iff the expression contains a variable.

Reimplemented from storm::expressions::BaseExpression.

Definition at line 17 of file UnaryExpression.cpp.

◆ gatherVariables()

void storm::expressions::UnaryExpression::gatherVariables ( std::set< storm::expressions::Variable > &  variables) const
overridevirtual

Retrieves the set of all variables that appear in the expression.

Parameters
Theset into which all variables in this expresson are inserted.

Implements storm::expressions::BaseExpression.

Definition at line 21 of file UnaryExpression.cpp.

◆ getArity()

uint_fast64_t storm::expressions::UnaryExpression::getArity ( ) const
overridevirtual

Returns the arity of the expression.

Returns
The arity of the expression.

Reimplemented from storm::expressions::BaseExpression.

Definition at line 29 of file UnaryExpression.cpp.

◆ getOperand() [1/2]

std::shared_ptr< BaseExpression const > const & storm::expressions::UnaryExpression::getOperand ( ) const

Retrieves the operand of the unary expression.

Returns
The operand of the unary expression.

Definition at line 25 of file UnaryExpression.cpp.

◆ getOperand() [2/2]

std::shared_ptr< BaseExpression const > storm::expressions::UnaryExpression::getOperand ( uint_fast64_t  operandIndex) const
overridevirtual

Retrieves the given operand from the expression.

Parameters
operandIndexThe index of the operand to retrieve. This must be lower than the arity of the expression.
Returns
The operand at the given index.

Reimplemented from storm::expressions::BaseExpression.

Definition at line 33 of file UnaryExpression.cpp.

◆ isFunctionApplication()

bool storm::expressions::UnaryExpression::isFunctionApplication ( ) const
overridevirtual

Checks if the expression is a function application (of any sort).

Returns
True iff the expression is a function application.

Reimplemented from storm::expressions::BaseExpression.

Definition at line 13 of file UnaryExpression.cpp.

◆ operator=() [1/2]

UnaryExpression & storm::expressions::UnaryExpression::operator= ( UnaryExpression &&  )
delete

◆ operator=() [2/2]

UnaryExpression & storm::expressions::UnaryExpression::operator= ( UnaryExpression const &  other)
delete

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