libutap
0.93
Uppaal Timed Automata Parser
|
A reference to an expression. More...
#include <expression.h>
Public Member Functions | |
expression_t () | |
Default constructor. More... | |
expression_t (const expression_t &) | |
Copy constructor. More... | |
expression_t & | operator= (const expression_t &) |
Assignment operator. More... | |
~expression_t () | |
Destructor. More... | |
bool | usesFP () const |
bool | usesClock () const |
bool | isDynamic () const |
bool | hasDynamicSub () const |
expression_t | clone () const |
Make a shallow clone of the expression. More... | |
expression_t | deeperClone () const |
Makes a deep clone of the expression. More... | |
expression_t | deeperClone (symbol_t from, symbol_t to) const |
Makes a deep clone of the expression and replaces the symbol "from" with the symbol "to". More... | |
expression_t | deeperClone (frame_t frame, frame_t select=frame_t()) const |
Makes a deep clone of the expression and replaces each symbol with a symbol from the given frame(s), with the same name. More... | |
Constants::kind_t | getKind () const |
Returns the kind of the expression. More... | |
size_t | getSize () const |
Returns the number of subexpression. More... | |
const position_t & | getPosition () const |
Returns the position of this expression. More... | |
type_t | getType () const |
Returns the type of the expression. More... | |
void | setType (type_t) |
Sets the type of the expression. More... | |
int32_t | getValue () const |
Returns the value field of this expression. More... | |
int32_t | getIndex () const |
Returns the index field of this expression. More... | |
double | getDoubleValue () const |
Returns the value field of this expression. More... | |
bool | empty () const |
Returns true if this is an empty expression. More... | |
Constants::synchronisation_t | getSync () const |
Returns the synchronisation type of SYNC operations. More... | |
std::string | toString (bool old=false) const |
Returns a string representation of the expression. More... | |
expression_t & | operator[] (uint32_t) |
Returns the ith subexpression. More... | |
const expression_t | operator[] (uint32_t) const |
Returns the ith subexpression. More... | |
expression_t & | get (uint32_t) |
Returns the ith subexpression. More... | |
const expression_t & | get (uint32_t) const |
Returns the ith subexpression. More... | |
bool | equal (const expression_t &) const |
Equality operator. More... | |
symbol_t | getSymbol () |
Returns the symbol of a variable reference. More... | |
void | getSymbols (std::set< symbol_t > &symbols) const |
Returns the set of symbols this expression might resolve into. More... | |
const symbol_t | getSymbol () const |
Returns the symbol this expression evaluates to. More... | |
bool | isReferenceTo (const std::set< symbol_t > &) const |
Returns true if this expression is a reference to a symbol in the given set. More... | |
bool | changesVariable (const std::set< symbol_t > &) const |
True if this expression can change any of the variables identified by the given symbols. More... | |
bool | changesAnyVariable () const |
True if this expression can change any variable at all. More... | |
bool | dependsOn (const std::set< symbol_t > &) const |
True if the evaluation of this expression depends on any of the symbols in the given set. More... | |
void | collectPossibleWrites (std::set< symbol_t > &) const |
void | collectPossibleReads (std::set< symbol_t > &, bool collectRandom=false) const |
bool | operator< (const expression_t) const |
Less-than operator. More... | |
bool | operator== (const expression_t) const |
Equality operator. More... | |
expression_t | subst (symbol_t, expression_t) const |
bool | isTrue () const |
A reference to an expression.
An expression is a tree of operations and is identified by the root of the tree. There are many kinds of operations (see kind_t), some are leafs in the tree (identifers, constants), some are unary operations (unary minus, negation), some are binary (plus, minus, etc.), and some are n-ary (lists, function calls).
Expressions can be annotated with types. The type of an expression should never contain information about whether the expression is a variable reference, a constant value or about the range of the result value. Use the TypeChecker and RangeChecker classes to determine these informations.
All nodes have the following attributes:
kind indicates the kind of operation position indicates the position of the expression in the input file. type the type of the result of evaluating the expression size the number of subexpressions sub the subexpressions
Some nodes have extra attributes (depending on the kind):
value the value of a CONSTANT node sync the synchronisation of a SYNC node index the index of a DOT node symbol the symbol of an IDENTIFIER node
Expressions are created by using the static factory methods.
Definition at line 70 of file expression.h.
|
inline |
Default constructor.
Creates an empty expression.
Definition at line 76 of file expression.h.
References changesAnyVariable(), changesVariable(), clone(), collectPossibleReads(), collectPossibleWrites(), createBinary(), createConstant(), createDeadlock(), createDot(), createDouble(), createExit(), createIdentifier(), createNary(), createSync(), createTernary(), createUnary(), deeperClone(), dependsOn(), empty(), equal(), getDoubleValue(), getIndex(), getKind(), getPosition(), getPrecedence(), getSize(), getSymbol(), getSymbols(), getSync(), getType(), getValue(), hasDynamicSub(), isDynamic(), isReferenceTo(), isTrue(), operator<(), UTAP::operator<<(), operator=(), operator==(), operator[](), setType(), subst(), toString(), usesClock(), usesFP(), and ~expression_t().
expression_t::expression_t | ( | const expression_t & | e | ) |
Copy constructor.
Definition at line 70 of file expression.cpp.
expression_t::~expression_t | ( | ) |
Destructor.
Definition at line 178 of file expression.cpp.
Referenced by expression_t().
bool expression_t::changesAnyVariable | ( | ) | const |
True if this expression can change any variable at all.
Definition at line 852 of file expression.cpp.
Referenced by UTAP::TypeChecker::checkDynamicExpressions(), expression_t(), UTAP::TypeChecker::TypeChecker(), UTAP::TypeChecker::visitAssertStatement(), UTAP::TypeChecker::visitBlockStatement(), UTAP::TypeChecker::visitCondition(), UTAP::TypeChecker::visitEdge(), UTAP::TypeChecker::visitHybridClock(), UTAP::TypeChecker::visitInstance(), UTAP::TypeChecker::visitIODecl(), UTAP::TypeChecker::visitMessage(), UTAP::TypeChecker::visitProperty(), UTAP::TypeChecker::visitState(), and UTAP::TypeChecker::visitVariable().
bool expression_t::changesVariable | ( | const std::set< symbol_t > & | symbols | ) | const |
True if this expression can change any of the variables identified by the given symbols.
Definition at line 844 of file expression.cpp.
Referenced by expression_t().
expression_t expression_t::clone | ( | ) | const |
Make a shallow clone of the expression.
Definition at line 81 of file expression.cpp.
Referenced by expression_t(), UTAP::ExpressionBuilder::exprExistsDynamicEnd(), and UTAP::ExpressionBuilder::exprForAllDynamicEnd().
void expression_t::collectPossibleReads | ( | std::set< symbol_t > & | , |
bool | collectRandom = false |
||
) | const |
Definition at line 2143 of file expression.cpp.
References UTAP::function_t::depends, UTAP::Constants::FUNCALL, UTAP::symbol_t::getData(), UTAP::symbol_t::getType(), UTAP::Constants::IDENTIFIER, UTAP::type_t::isFunction(), UTAP::Constants::RANDOM_ARCSINE_F, UTAP::Constants::RANDOM_BETA_F, UTAP::Constants::RANDOM_F, UTAP::Constants::RANDOM_GAMMA_F, UTAP::Constants::RANDOM_NORMAL_F, UTAP::Constants::RANDOM_POISSON_F, UTAP::Constants::RANDOM_TRI_F, UTAP::Constants::RANDOM_WEIBULL_F, and UTAP::symbol().
Referenced by UTAP::StatementBuilder::collectDependencies(), collectDependencies(), expression_t(), UTAP::TypeChecker::TypeChecker(), and UTAP::CollectDependenciesVisitor::visitExpression().
void expression_t::collectPossibleWrites | ( | std::set< symbol_t > & | ) | const |
Definition at line 2081 of file expression.cpp.
References UTAP::Constants::ASSAND, UTAP::Constants::ASSDIV, UTAP::Constants::ASSIGN, UTAP::Constants::ASSLSHIFT, UTAP::Constants::ASSMINUS, UTAP::Constants::ASSMOD, UTAP::Constants::ASSMULT, UTAP::Constants::ASSOR, UTAP::Constants::ASSPLUS, UTAP::Constants::ASSRSHIFT, UTAP::Constants::ASSXOR, UTAP::function_t::changes, UTAP::Constants::FUNCALL, UTAP::symbol_t::getData(), UTAP::symbol_t::getType(), UTAP::type_t::isConstant(), UTAP::type_t::isFunction(), UTAP::Constants::POSTDECREMENT, UTAP::Constants::POSTINCREMENT, UTAP::Constants::PREDECREMENT, UTAP::Constants::PREINCREMENT, UTAP::Constants::REF, UTAP::type_t::size(), UTAP::symbol(), and UTAP::function_t::uid.
Referenced by expression_t(), and UTAP::CollectChangesVisitor::visitExpression().
|
static |
Create a binary expression.
Definition at line 2268 of file expression.cpp.
Referenced by UTAP::CompileTimeComputableValues::contains(), UTAP::ExpressionBuilder::exprArray(), UTAP::ExpressionBuilder::exprAssignment(), UTAP::ExpressionBuilder::exprBinary(), UTAP::ExpressionBuilder::exprBuiltinFunction2(), UTAP::ExpressionBuilder::exprCallEnd(), UTAP::ExpressionBuilder::exprComma(), expression_t(), UTAP::ExpressionBuilder::exprExistsEnd(), UTAP::ExpressionBuilder::exprForAllEnd(), UTAP::ExpressionBuilder::exprMitlConj(), UTAP::ExpressionBuilder::exprMitlDisj(), UTAP::ExpressionBuilder::exprScenario(), and UTAP::ExpressionBuilder::exprSumEnd().
|
static |
Create a CONSTANT expression.
Definition at line 2209 of file expression.cpp.
References UTAP::Constants::CONSTANT, UTAP::type_t::createPrimitive(), and UTAP::Constants::INT.
Referenced by UTAP::CompileTimeComputableValues::contains(), expression_t(), UTAP::ExpressionBuilder::exprMitlBox(), UTAP::ExpressionBuilder::exprMitlDiamond(), UTAP::ExpressionBuilder::exprMitlRelease(), UTAP::ExpressionBuilder::exprMitlUntil(), UTAP::ExpressionBuilder::exprProbaCompare(), UTAP::ExpressionBuilder::exprProbaExpected(), UTAP::ExpressionBuilder::exprSimulate(), and UTAP::ExpressionBuilder::makeConstant().
|
static |
Create a DEADLOCK expression.
Definition at line 2312 of file expression.cpp.
References UTAP::Constants::CONSTRAINT, UTAP::type_t::createPrimitive(), and UTAP::Constants::DEADLOCK.
Referenced by UTAP::ExpressionBuilder::exprDeadlock(), and expression_t().
|
static |
Create a DOT expression.
Definition at line 2293 of file expression.cpp.
References UTAP::Constants::DOT.
Referenced by UTAP::ExpressionBuilder::exprDot(), expression_t(), and UTAP::ExpressionBuilder::exprScenario().
|
static |
Definition at line 2225 of file expression.cpp.
References UTAP::Constants::CONSTANT, UTAP::type_t::createPrimitive(), and UTAP::Constants::DOUBLE.
Referenced by UTAP::ExpressionBuilder::exprDouble(), expression_t(), UTAP::ExpressionBuilder::exprProbaQualitative(), and UTAP::ExpressionBuilder::makeConstant().
|
static |
Definition at line 2217 of file expression.cpp.
References UTAP::type_t::createPrimitive(), UTAP::Constants::EXIT, and UTAP::Constants::VOID_TYPE.
Referenced by expression_t(), and UTAP::ExpressionBuilder::exprExit().
|
static |
Create an IDENTIFIER expression.
Definition at line 2233 of file expression.cpp.
References UTAP::symbol_t::getType(), UTAP::Constants::IDENTIFIER, and UTAP::symbol().
Referenced by UTAP::ExpressionBuilder::exprDot(), expression_t(), UTAP::ExpressionBuilder::exprExistsDynamicEnd(), UTAP::ExpressionBuilder::exprExistsEnd(), UTAP::ExpressionBuilder::exprForAllDynamicEnd(), UTAP::ExpressionBuilder::exprForAllEnd(), UTAP::ExpressionBuilder::exprForeachDynamicEnd(), UTAP::ExpressionBuilder::exprId(), UTAP::ExpressionBuilder::exprScenario(), UTAP::ExpressionBuilder::exprSumDynamicEnd(), and UTAP::ExpressionBuilder::exprSumEnd().
|
static |
Create an n-ary expression.
Definition at line 2248 of file expression.cpp.
Referenced by UTAP::StatementBuilder::declInitialiserList(), UTAP::ExpressionBuilder::exprCallEnd(), UTAP::ExpressionBuilder::exprDot(), expression_t(), UTAP::ExpressionBuilder::exprExistsDynamicEnd(), UTAP::ExpressionBuilder::exprForAllDynamicEnd(), UTAP::ExpressionBuilder::exprForeachDynamicEnd(), UTAP::ExpressionBuilder::exprMitlBox(), UTAP::ExpressionBuilder::exprMitlDiamond(), UTAP::ExpressionBuilder::exprMitlRelease(), UTAP::ExpressionBuilder::exprMitlUntil(), UTAP::ExpressionBuilder::exprNary(), UTAP::ExpressionBuilder::exprProbaCompare(), UTAP::ExpressionBuilder::exprProbaExpected(), UTAP::ExpressionBuilder::exprProbaQualitative(), UTAP::ExpressionBuilder::exprProbaQuantitative(), UTAP::ExpressionBuilder::exprSimulate(), UTAP::ExpressionBuilder::exprSpawn(), UTAP::ExpressionBuilder::exprSumDynamicEnd(), and isSameScalarType().
|
static |
Create a SYNC expression.
Definition at line 2303 of file expression.cpp.
References UTAP::Constants::SYNC.
Referenced by expression_t(), UTAP::SystemBuilder::procMessage(), and UTAP::SystemBuilder::procSync().
|
static |
Create a ternary expression.
Definition at line 2280 of file expression.cpp.
Referenced by UTAP::ExpressionBuilder::exprBuiltinFunction3(), expression_t(), UTAP::ExpressionBuilder::exprInlineIf(), UTAP::ExpressionBuilder::exprSMCControl(), and UTAP::ExpressionBuilder::exprTernary().
|
static |
Create a unary expression.
Definition at line 2259 of file expression.cpp.
Referenced by UTAP::ExpressionBuilder::exprBuiltinFunction1(), expression_t(), UTAP::ExpressionBuilder::exprMitlAtom(), UTAP::ExpressionBuilder::exprMitlBox(), UTAP::ExpressionBuilder::exprMitlDiamond(), UTAP::ExpressionBuilder::exprMitlFormula(), UTAP::ExpressionBuilder::exprMitlNext(), UTAP::ExpressionBuilder::exprNumOf(), UTAP::ExpressionBuilder::exprPostDecrement(), UTAP::ExpressionBuilder::exprPostIncrement(), UTAP::ExpressionBuilder::exprPreDecrement(), UTAP::ExpressionBuilder::exprPreIncrement(), UTAP::ExpressionBuilder::exprProbaQualitative(), UTAP::ExpressionBuilder::exprScenario(), UTAP::ExpressionBuilder::exprUnary(), and toMITLAtom().
expression_t expression_t::deeperClone | ( | ) | const |
Makes a deep clone of the expression.
Definition at line 92 of file expression.cpp.
Referenced by expression_t().
expression_t expression_t::deeperClone | ( | symbol_t | from, |
symbol_t | to | ||
) | const |
Makes a deep clone of the expression and replaces the symbol "from" with the symbol "to".
Definition at line 107 of file expression.cpp.
References if().
expression_t expression_t::deeperClone | ( | frame_t | frame, |
frame_t | select = frame_t() |
||
) | const |
Makes a deep clone of the expression and replaces each symbol with a symbol from the given frame(s), with the same name.
Definition at line 123 of file expression.cpp.
References UTAP::frame_t::resolve().
bool expression_t::dependsOn | ( | const std::set< symbol_t > & | symbols | ) | const |
True if the evaluation of this expression depends on any of the symbols in the given set.
Definition at line 859 of file expression.cpp.
Referenced by expression_t().
bool expression_t::empty | ( | ) | const |
Returns true if this is an empty expression.
Definition at line 671 of file expression.cpp.
Referenced by UTAP::TypeChecker::checkExpression(), UTAP::CompileTimeComputableValues::contains(), expression_t(), UTAP::XMLWriter::labels(), UTAP::XMLWriter::location(), UTAP::TypeChecker::visitBlockStatement(), UTAP::TypeChecker::visitCondition(), UTAP::TypeChecker::visitEdge(), UTAP::SignalFlow::visitExpression(), UTAP::TypeChecker::visitMessage(), UTAP::TypeChecker::visitProgressMeasure(), UTAP::TypeChecker::visitReturnStatement(), UTAP::TypeChecker::visitState(), UTAP::TypeChecker::visitUpdate(), and UTAP::TypeChecker::visitVariable().
bool expression_t::equal | ( | const expression_t & | e | ) | const |
Equality operator.
Two expressions are identical iff all the sub expressions are identical and if the kind, value and symbol of the root are identical.
Definition at line 685 of file expression.cpp.
References getSize().
Referenced by expression_t().
expression_t & expression_t::get | ( | uint32_t | i | ) |
Returns the ith subexpression.
Definition at line 659 of file expression.cpp.
Referenced by UTAP::ExpressionBuilder::exprExistsDynamicEnd(), UTAP::ExpressionBuilder::exprForAllDynamicEnd(), hasMITLInQuantifiedSub(), hasSpawnOrExit(), UTAP::TypeChecker::visitEdge(), and UTAP::TypeChecker::visitMessage().
const expression_t & expression_t::get | ( | uint32_t | i | ) | const |
Returns the ith subexpression.
Definition at line 665 of file expression.cpp.
double expression_t::getDoubleValue | ( | ) | const |
Returns the value field of this expression.
This call is not valid for all expressions.
Definition at line 629 of file expression.cpp.
References UTAP::Constants::CONSTANT, and UTAP::Constants::DOUBLE.
Referenced by expression_t().
int32_t expression_t::getIndex | ( | ) | const |
Returns the index field of this expression.
Definition at line 635 of file expression.cpp.
References UTAP::Constants::DOT.
Referenced by expression_t().
kind_t expression_t::getKind | ( | ) | const |
Returns the kind of the expression.
Definition at line 182 of file expression.cpp.
Referenced by append(), UTAP::TypeChecker::checkDynamicExpressions(), UTAP::TypeChecker::checkExpression(), checkIDList(), UTAP::CompileTimeComputableValues::contains(), expression_t(), UTAP::ExpressionBuilder::exprExistsDynamicEnd(), UTAP::ExpressionBuilder::exprForAllDynamicEnd(), hasMITLInQuantifiedSub(), hasSpawnOrExit(), hasStrictLowerBound(), hasStrictUpperBound(), isConstantDouble(), isConstantInteger(), isGameProperty(), isListOfFormulas(), isMITL(), isProcessID(), isSameScalarType(), UTAP::TypeChecker::TypeChecker(), UTAP::SignalFlow::visitExpression(), UTAP::TypeChecker::visitIODecl(), UTAP::TypeChecker::visitProperty(), UTAP::TypeChecker::visitState(), and UTAP::TypeChecker::visitSystemAfter().
const position_t & expression_t::getPosition | ( | ) | const |
Returns the position of this expression.
Definition at line 188 of file expression.cpp.
References UTAP::Statement::accept(), and usesFP().
Referenced by UTAP::CompileTimeComputableValues::contains(), expression_t(), isSameScalarType(), and UTAP::TypeChecker::TypeChecker().
|
static |
Definition at line 873 of file expression.cpp.
References UTAP::Constants::A_BUCHI, UTAP::Constants::A_UNTIL, UTAP::Constants::A_WEAKUNTIL, UTAP::Constants::ABS_F, UTAP::Constants::ACOS_F, UTAP::Constants::ACOSH_F, UTAP::Constants::AF, UTAP::Constants::AG, UTAP::Constants::AG_R_Piotr, UTAP::Constants::AND, UTAP::Constants::ARRAY, UTAP::Constants::ASIN_F, UTAP::Constants::ASINH_F, UTAP::Constants::ASSAND, UTAP::Constants::ASSDIV, UTAP::Constants::ASSIGN, UTAP::Constants::ASSLSHIFT, UTAP::Constants::ASSMINUS, UTAP::Constants::ASSMOD, UTAP::Constants::ASSMULT, UTAP::Constants::ASSOR, UTAP::Constants::ASSPLUS, UTAP::Constants::ASSRSHIFT, UTAP::Constants::ASSXOR, UTAP::Constants::ATAN2_F, UTAP::Constants::ATAN_F, UTAP::Constants::ATANH_F, UTAP::Constants::BIT_AND, UTAP::Constants::BIT_LSHIFT, UTAP::Constants::BIT_OR, UTAP::Constants::BIT_RSHIFT, UTAP::Constants::BIT_XOR, UTAP::Constants::CBRT_F, UTAP::Constants::CEIL_F, UTAP::Constants::COMMA, UTAP::Constants::CONSISTENCY, UTAP::Constants::CONSTANT, UTAP::Constants::CONTROL, UTAP::Constants::CONTROL_TOPT, UTAP::Constants::CONTROL_TOPT_DEF1, UTAP::Constants::CONTROL_TOPT_DEF2, UTAP::Constants::COPYSIGN_F, UTAP::Constants::COS_F, UTAP::Constants::COSH_F, UTAP::Constants::DEADLOCK, UTAP::Constants::DIV, UTAP::Constants::DOT, UTAP::Constants::DYNAMICEVAL, UTAP::Constants::EF, UTAP::Constants::EF_CONTROL, UTAP::Constants::EF_R_Piotr, UTAP::Constants::EG, UTAP::Constants::EQ, UTAP::Constants::ERF_F, UTAP::Constants::ERFC_F, UTAP::Constants::EXISTS, UTAP::Constants::EXISTSDYNAMIC, UTAP::Constants::EXIT, UTAP::Constants::EXP2_F, UTAP::Constants::EXP_F, UTAP::Constants::EXPM1_F, UTAP::Constants::FABS_F, UTAP::Constants::FDIM_F, UTAP::Constants::FINT_F, UTAP::Constants::FLOOR_F, UTAP::Constants::FMA_F, UTAP::Constants::FMAX_F, UTAP::Constants::FMIN_F, UTAP::Constants::FMOD_F, UTAP::Constants::FORALL, UTAP::Constants::FORALLDYNAMIC, UTAP::Constants::FOREACHDYNAMIC, UTAP::Constants::FPCLASSIFY_F, UTAP::Constants::FRACTION, UTAP::Constants::FUNCALL, UTAP::Constants::GE, UTAP::Constants::GT, UTAP::Constants::HYPOT_F, UTAP::Constants::IDENTIFIER, UTAP::Constants::ILOGB_F, UTAP::Constants::IMPLEMENTATION, UTAP::Constants::INF_VAR, UTAP::Constants::INLINEIF, UTAP::Constants::ISFINITE_F, UTAP::Constants::ISINF_F, UTAP::Constants::ISNAN_F, UTAP::Constants::ISNORMAL_F, UTAP::Constants::ISUNORDERED_F, UTAP::Constants::LDEXP_F, UTAP::Constants::LE, UTAP::Constants::LEADSTO, UTAP::Constants::LGAMMA_F, UTAP::Constants::LIST, UTAP::Constants::LN_F, UTAP::Constants::LOG10_F, UTAP::Constants::LOG1P_F, UTAP::Constants::LOG2_F, UTAP::Constants::LOG_F, UTAP::Constants::LOGB_F, UTAP::Constants::LT, UTAP::Constants::MAX, UTAP::Constants::MIN, UTAP::Constants::MINUS, UTAP::Constants::MITLATOM, UTAP::Constants::MITLCONJ, UTAP::Constants::MITLDISJ, UTAP::Constants::MITLFORMULA, UTAP::Constants::MITLNEXT, UTAP::Constants::MITLRELEASE, UTAP::Constants::MITLUNTIL, UTAP::Constants::MOD, UTAP::Constants::MULT, UTAP::Constants::NEQ, UTAP::Constants::NEXTAFTER_F, UTAP::Constants::NOT, UTAP::Constants::NUMOF, UTAP::Constants::OR, UTAP::Constants::PLUS, UTAP::Constants::PO_CONTROL, UTAP::Constants::POSTDECREMENT, UTAP::Constants::POSTINCREMENT, UTAP::Constants::POW_F, UTAP::Constants::PREDECREMENT, UTAP::Constants::PREINCREMENT, UTAP::Constants::PROBABOX, UTAP::Constants::PROBADIAMOND, UTAP::Constants::PROBAEXP, UTAP::Constants::PROBAMINBOX, UTAP::Constants::PROBAMINDIAMOND, UTAP::Constants::PROCESSVAR, UTAP::Constants::RANDOM_ARCSINE_F, UTAP::Constants::RANDOM_BETA_F, UTAP::Constants::RANDOM_F, UTAP::Constants::RANDOM_GAMMA_F, UTAP::Constants::RANDOM_NORMAL_F, UTAP::Constants::RANDOM_POISSON_F, UTAP::Constants::RANDOM_TRI_F, UTAP::Constants::RANDOM_WEIBULL_F, UTAP::Constants::RATE, UTAP::Constants::REFINEMENT_GE, UTAP::Constants::REFINEMENT_LE, UTAP::Constants::RESTRICT, UTAP::Constants::ROUND_F, UTAP::Constants::SCENARIO, UTAP::Constants::SCENARIO2, UTAP::Constants::SIGNBIT_F, UTAP::Constants::SIMULATE, UTAP::Constants::SIMULATION_GE, UTAP::Constants::SIMULATION_LE, UTAP::Constants::SIN_F, UTAP::Constants::SINH_F, UTAP::Constants::SMC_CONTROL, UTAP::Constants::SPAWN, UTAP::Constants::SPECIFICATION, UTAP::Constants::SQRT_F, UTAP::Constants::SUM, UTAP::Constants::SUMDYNAMIC, UTAP::Constants::SUP_VAR, UTAP::Constants::SYNC, UTAP::Constants::SYNTAX_COMPOSITION, UTAP::Constants::TAN_F, UTAP::Constants::TANH_F, UTAP::Constants::TGAMMA_F, UTAP::Constants::TIOCOMPOSITION, UTAP::Constants::TIOCONJUNCTION, UTAP::Constants::TIOQUOTIENT, UTAP::Constants::TRUNC_F, UTAP::Constants::UNARY_MINUS, and UTAP::Constants::XOR.
Referenced by expression_t().
size_t expression_t::getSize | ( | ) | const |
Returns the number of subexpression.
Definition at line 379 of file expression.cpp.
References UTAP::Constants::A_BUCHI, UTAP::Constants::A_UNTIL, UTAP::Constants::A_WEAKUNTIL, UTAP::Constants::ABS_F, UTAP::Constants::ACOS_F, UTAP::Constants::ACOSH_F, UTAP::Constants::AF, UTAP::Constants::AG, UTAP::Constants::AG_R_Piotr, UTAP::Constants::AND, UTAP::Constants::ARRAY, UTAP::Constants::ASIN_F, UTAP::Constants::ASINH_F, UTAP::Constants::ASSAND, UTAP::Constants::ASSDIV, UTAP::Constants::ASSIGN, UTAP::Constants::ASSLSHIFT, UTAP::Constants::ASSMINUS, UTAP::Constants::ASSMOD, UTAP::Constants::ASSMULT, UTAP::Constants::ASSOR, UTAP::Constants::ASSPLUS, UTAP::Constants::ASSRSHIFT, UTAP::Constants::ASSXOR, UTAP::Constants::ATAN2_F, UTAP::Constants::ATAN_F, UTAP::Constants::ATANH_F, UTAP::Constants::BIT_AND, UTAP::Constants::BIT_LSHIFT, UTAP::Constants::BIT_OR, UTAP::Constants::BIT_RSHIFT, UTAP::Constants::BIT_XOR, UTAP::Constants::CBRT_F, UTAP::Constants::CEIL_F, UTAP::Constants::COMMA, UTAP::Constants::CONSISTENCY, UTAP::Constants::CONSTANT, UTAP::Constants::CONTROL, UTAP::Constants::CONTROL_TOPT, UTAP::Constants::CONTROL_TOPT_DEF1, UTAP::Constants::CONTROL_TOPT_DEF2, UTAP::Constants::COPYSIGN_F, UTAP::Constants::COS_F, UTAP::Constants::COSH_F, UTAP::Constants::DEADLOCK, UTAP::Constants::DIV, UTAP::Constants::DOT, UTAP::Constants::DYNAMICEVAL, UTAP::Constants::EF, UTAP::Constants::EF_CONTROL, UTAP::Constants::EF_R_Piotr, UTAP::Constants::EG, UTAP::Constants::EQ, UTAP::Constants::ERF_F, UTAP::Constants::ERFC_F, UTAP::Constants::EXISTS, UTAP::Constants::EXISTSDYNAMIC, UTAP::Constants::EXIT, UTAP::Constants::EXP2_F, UTAP::Constants::EXP_F, UTAP::Constants::EXPM1_F, UTAP::Constants::FABS_F, UTAP::Constants::FDIM_F, UTAP::Constants::FINT_F, UTAP::Constants::FLOOR_F, UTAP::Constants::FMA_F, UTAP::Constants::FMAX_F, UTAP::Constants::FMIN_F, UTAP::Constants::FMOD_F, UTAP::Constants::FORALL, UTAP::Constants::FORALLDYNAMIC, UTAP::Constants::FOREACHDYNAMIC, UTAP::Constants::FPCLASSIFY_F, UTAP::Constants::FRACTION, UTAP::Constants::FUNCALL, UTAP::Constants::GE, UTAP::Constants::GT, UTAP::Constants::HYPOT_F, UTAP::Constants::IDENTIFIER, UTAP::Constants::ILOGB_F, UTAP::Constants::IMPLEMENTATION, UTAP::Constants::INF_VAR, UTAP::Constants::INLINEIF, UTAP::Constants::ISFINITE_F, UTAP::Constants::ISINF_F, UTAP::Constants::ISNAN_F, UTAP::Constants::ISNORMAL_F, UTAP::Constants::ISUNORDERED_F, UTAP::Constants::LDEXP_F, UTAP::Constants::LE, UTAP::Constants::LEADSTO, UTAP::Constants::LGAMMA_F, UTAP::Constants::LIST, UTAP::Constants::LN_F, UTAP::Constants::LOG10_F, UTAP::Constants::LOG1P_F, UTAP::Constants::LOG2_F, UTAP::Constants::LOG_F, UTAP::Constants::LOGB_F, UTAP::Constants::LT, UTAP::Constants::MAX, UTAP::Constants::MIN, UTAP::Constants::MINUS, UTAP::Constants::MITLATOM, UTAP::Constants::MITLCONJ, UTAP::Constants::MITLDISJ, UTAP::Constants::MITLEXISTS, UTAP::Constants::MITLFORALL, UTAP::Constants::MITLFORMULA, UTAP::Constants::MITLNEXT, UTAP::Constants::MITLRELEASE, UTAP::Constants::MITLUNTIL, UTAP::Constants::MOD, UTAP::Constants::MULT, UTAP::Constants::NEQ, UTAP::Constants::NEXTAFTER_F, UTAP::Constants::NOT, UTAP::Constants::NUMOF, UTAP::Constants::OR, UTAP::Constants::PLUS, UTAP::Constants::PMAX, UTAP::Constants::PO_CONTROL, UTAP::Constants::POSTDECREMENT, UTAP::Constants::POSTINCREMENT, UTAP::Constants::POW_F, UTAP::Constants::PREDECREMENT, UTAP::Constants::PREINCREMENT, UTAP::Constants::PROBABOX, UTAP::Constants::PROBACMP, UTAP::Constants::PROBADIAMOND, UTAP::Constants::PROBAEXP, UTAP::Constants::PROBAMINBOX, UTAP::Constants::PROBAMINDIAMOND, UTAP::Constants::RANDOM_ARCSINE_F, UTAP::Constants::RANDOM_BETA_F, UTAP::Constants::RANDOM_F, UTAP::Constants::RANDOM_GAMMA_F, UTAP::Constants::RANDOM_NORMAL_F, UTAP::Constants::RANDOM_POISSON_F, UTAP::Constants::RANDOM_TRI_F, UTAP::Constants::RANDOM_WEIBULL_F, UTAP::Constants::RATE, UTAP::Constants::REFINEMENT_GE, UTAP::Constants::REFINEMENT_LE, UTAP::Constants::RESTRICT, UTAP::Constants::ROUND_F, UTAP::Constants::SCENARIO, UTAP::Constants::SCENARIO2, UTAP::Constants::SIGNBIT_F, UTAP::Constants::SIMULATE, UTAP::Constants::SIMULATEREACH, UTAP::Constants::SIMULATION_GE, UTAP::Constants::SIMULATION_LE, UTAP::Constants::SIN_F, UTAP::Constants::SINH_F, UTAP::Constants::SMC_CONTROL, UTAP::Constants::SPAWN, UTAP::Constants::SPECIFICATION, UTAP::Constants::SQRT_F, UTAP::Constants::SUM, UTAP::Constants::SUMDYNAMIC, UTAP::Constants::SUP_VAR, UTAP::Constants::SYNC, UTAP::Constants::SYNTAX_COMPOSITION, UTAP::Constants::TAN_F, UTAP::Constants::TANH_F, UTAP::Constants::TGAMMA_F, UTAP::Constants::TIOCOMPOSITION, UTAP::Constants::TIOCONJUNCTION, UTAP::Constants::TIOQUOTIENT, UTAP::Constants::TRUNC_F, UTAP::Constants::UNARY_MINUS, and UTAP::Constants::XOR.
Referenced by UTAP::TypeChecker::checkExpression(), checkIDList(), equal(), expression_t(), hasMITLInQuantifiedSub(), hasSpawnOrExit(), hasStrictLowerBound(), hasStrictUpperBound(), isListOfFormulas(), isSameScalarType(), UTAP::SignalFlow::visitExpression(), and UTAP::TypeChecker::visitProperty().
symbol_t expression_t::getSymbol | ( | ) |
Returns the symbol of a variable reference.
The expression must be a left-hand side value. In case of dot-expressions, the record/process symbol is returned. In case of an inline if, the 'true' branch is returned.
(a=1).getSymbol() returns 'a' (s.f).getSymbol() returns 's' (i<1?j:k).getSymbol() returns 'j'
The expression must be a left-hand side value. The symbol returned is the symbol of the variable the expression if resulting in a reference to. NOTE: In case of inline if, the symbol referenced by the 'true' part is returned.
Definition at line 718 of file expression.cpp.
Referenced by UTAP::ExpressionBuilder::exprDot(), expression_t(), and UTAP::SignalFlow::visitExpression().
const symbol_t expression_t::getSymbol | ( | ) | const |
Returns the symbol this expression evaluates to.
Notice that not all expression evaluate to a symbol.
Definition at line 723 of file expression.cpp.
References UTAP::Constants::ARRAY, UTAP::Constants::ASSAND, UTAP::Constants::ASSDIV, UTAP::Constants::ASSIGN, UTAP::Constants::ASSLSHIFT, UTAP::Constants::ASSMINUS, UTAP::Constants::ASSMOD, UTAP::Constants::ASSMULT, UTAP::Constants::ASSOR, UTAP::Constants::ASSPLUS, UTAP::Constants::ASSRSHIFT, UTAP::Constants::ASSXOR, UTAP::Constants::COMMA, UTAP::Constants::DOT, UTAP::Constants::FUNCALL, UTAP::Constants::IDENTIFIER, UTAP::Constants::INLINEIF, UTAP::Constants::PREDECREMENT, UTAP::Constants::PREINCREMENT, UTAP::Constants::SCENARIO, and UTAP::Constants::SYNC.
void expression_t::getSymbols | ( | std::set< symbol_t > & | symbols | ) | const |
Returns the set of symbols this expression might resolve into.
In case of inline if, both the 'true' and 'false' branch is added. In case of dot-expressions, both the left hand reference and the member field are returned.
(a=1).getSymbol() returns 'a' (s.f).getSymbol() returns 's,f' (i<1?j:k).getSymbol() returns 'j,k'
Definition at line 775 of file expression.cpp.
References UTAP::Constants::ARRAY, UTAP::Constants::ASSAND, UTAP::Constants::ASSDIV, UTAP::Constants::ASSIGN, UTAP::Constants::ASSLSHIFT, UTAP::Constants::ASSMINUS, UTAP::Constants::ASSMOD, UTAP::Constants::ASSMULT, UTAP::Constants::ASSOR, UTAP::Constants::ASSPLUS, UTAP::Constants::ASSRSHIFT, UTAP::Constants::ASSXOR, UTAP::Constants::COMMA, UTAP::Constants::DOT, UTAP::Constants::IDENTIFIER, UTAP::Constants::INLINEIF, UTAP::Constants::PREDECREMENT, UTAP::Constants::PREINCREMENT, and UTAP::Constants::SYNC.
Referenced by expression_t().
synchronisation_t expression_t::getSync | ( | ) | const |
Returns the synchronisation type of SYNC operations.
Definition at line 641 of file expression.cpp.
References UTAP::Constants::SYNC.
Referenced by expression_t(), UTAP::TypeChecker::visitEdge(), and UTAP::SignalFlow::visitExpression().
type_t expression_t::getType | ( | ) | const |
Returns the type of the expression.
Definition at line 611 of file expression.cpp.
Referenced by append(), UTAP::TypeChecker::checkDynamicExpressions(), UTAP::TypeChecker::checkExpression(), UTAP::CompileTimeComputableValues::contains(), UTAP::ExpressionBuilder::exprArray(), UTAP::ExpressionBuilder::exprAssignment(), UTAP::ExpressionBuilder::exprBuiltinFunction2(), UTAP::ExpressionBuilder::exprBuiltinFunction3(), UTAP::ExpressionBuilder::exprComma(), UTAP::ExpressionBuilder::exprDot(), expression_t(), UTAP::ExpressionBuilder::exprInlineIf(), UTAP::ExpressionBuilder::exprScenario(), UTAP::ExpressionBuilder::exprSumDynamicEnd(), isBound(), isClock(), isConstraint(), isCost(), isDiff(), isDouble(), isFormula(), isGuard(), isInteger(), isIntegral(), isInvariant(), isInvariantWR(), isProcessID(), isSameScalarType(), isVoid(), UTAP::TypeChecker::visitCondition(), UTAP::TypeChecker::visitEdge(), UTAP::SignalFlow::visitExpression(), UTAP::TypeChecker::visitMessage(), UTAP::TypeChecker::visitProperty(), UTAP::TypeChecker::visitState(), and UTAP::TypeChecker::visitSystemAfter().
int32_t expression_t::getValue | ( | ) | const |
Returns the value field of this expression.
This call is not valid for all expressions.
Definition at line 623 of file expression.cpp.
References UTAP::Constants::CONSTANT.
Referenced by append(), UTAP::TypeChecker::checkDynamicExpressions(), expression_t(), UTAP::SignalFlow::visitExpression(), and UTAP::TypeChecker::visitProperty().
bool expression_t::hasDynamicSub | ( | ) | const |
Definition at line 353 of file expression.cpp.
Referenced by expression_t(), UTAP::CollectDynamicExpressions::visitExpression(), and UTAP::TypeChecker::visitVariable().
bool expression_t::isDynamic | ( | ) | const |
Definition at line 329 of file expression.cpp.
References UTAP::Constants::EXISTSDYNAMIC, UTAP::Constants::EXIT, UTAP::Constants::FORALLDYNAMIC, UTAP::Constants::NUMOF, UTAP::Constants::SPAWN, and UTAP::Constants::SUMDYNAMIC.
Referenced by expression_t(), UTAP::CollectDynamicExpressions::visitExpression(), and UTAP::TypeChecker::visitVariable().
bool expression_t::isReferenceTo | ( | const std::set< symbol_t > & | symbols | ) | const |
Returns true if this expression is a reference to a symbol in the given set.
Returns true if expr might be a reference to a symbol in the set.
Definition at line 836 of file expression.cpp.
Referenced by expression_t().
bool expression_t::isTrue | ( | ) | const |
Definition at line 676 of file expression.cpp.
References UTAP::Constants::CONSTANT.
Referenced by expression_t(), and UTAP::TypeChecker::visitEdge().
bool expression_t::operator< | ( | const expression_t | e | ) | const |
Less-than operator.
Makes it possible to put expression_t objects into an STL set.
Definition at line 2048 of file expression.cpp.
Referenced by expression_t().
expression_t & expression_t::operator= | ( | const expression_t & | e | ) |
Assignment operator.
Definition at line 75 of file expression.cpp.
Referenced by expression_t().
bool expression_t::operator== | ( | const expression_t | e | ) | const |
Equality operator.
Returns true if the two references point to the same expression object.
Definition at line 2053 of file expression.cpp.
Referenced by expression_t().
expression_t & expression_t::operator[] | ( | uint32_t | i | ) |
Returns the ith subexpression.
Definition at line 647 of file expression.cpp.
Referenced by expression_t().
const expression_t expression_t::operator[] | ( | uint32_t | i | ) | const |
Returns the ith subexpression.
Definition at line 653 of file expression.cpp.
void expression_t::setType | ( | type_t | type | ) |
Sets the type of the expression.
Definition at line 617 of file expression.cpp.
Referenced by UTAP::TypeChecker::checkExpression(), UTAP::ExpressionBuilder::exprCallEnd(), UTAP::ExpressionBuilder::exprDouble(), expression_t(), UTAP::ExpressionBuilder::exprFalse(), and UTAP::ExpressionBuilder::exprTrue().
expression_t expression_t::subst | ( | symbol_t | symbol, |
expression_t | expr | ||
) | const |
Definition at line 153 of file expression.cpp.
References UTAP::Constants::IDENTIFIER, and subst().
Referenced by expression_t(), and subst().
std::string expression_t::toString | ( | bool | old = false | ) | const |
Returns a string representation of the expression.
The string returned must be deallocated with delete[]. Returns NULL is the expression is empty.
Definition at line 2062 of file expression.cpp.
Referenced by append(), UTAP::ExpressionBuilder::exprDot(), expression_t(), getBuiltinFunName(), UTAP::XMLWriter::labels(), UTAP::XMLWriter::location(), operator<<(), UTAP::ExprStatement::toString(), UTAP::AssertStatement::toString(), UTAP::ForStatement::toString(), UTAP::WhileStatement::toString(), UTAP::SwitchStatement::toString(), UTAP::CaseStatement::toString(), UTAP::IfStatement::toString(), and UTAP::ReturnStatement::toString().
bool expression_t::usesClock | ( | ) | const |
Definition at line 308 of file expression.cpp.
References isClock().
Referenced by expression_t().
bool expression_t::usesFP | ( | ) | const |
Definition at line 211 of file expression.cpp.
References UTAP::Constants::ACOS_F, UTAP::Constants::ACOSH_F, UTAP::Constants::ASIN_F, UTAP::Constants::ASINH_F, UTAP::Constants::ATAN2_F, UTAP::Constants::ATAN_F, UTAP::Constants::ATANH_F, UTAP::Constants::CBRT_F, UTAP::Constants::CEIL_F, checkForFP(), UTAP::Constants::COPYSIGN_F, UTAP::Constants::COS_F, UTAP::Constants::COSH_F, UTAP::Constants::DOUBLE, UTAP::Constants::ERF_F, UTAP::Constants::ERFC_F, UTAP::Constants::EXP2_F, UTAP::Constants::EXP_F, UTAP::Constants::EXPM1_F, UTAP::Constants::FABS_F, UTAP::Constants::FDIM_F, UTAP::Constants::FINT_F, UTAP::Constants::FLOOR_F, UTAP::Constants::FMA_F, UTAP::Constants::FMAX_F, UTAP::Constants::FMIN_F, UTAP::Constants::FMOD_F, UTAP::Constants::FPCLASSIFY_F, UTAP::Constants::FUNCALL, UTAP::Constants::HYPOT_F, UTAP::Constants::ILOGB_F, UTAP::Constants::ISFINITE_F, UTAP::Constants::ISINF_F, UTAP::Constants::ISNAN_F, UTAP::Constants::ISNORMAL_F, UTAP::Constants::ISUNORDERED_F, UTAP::Constants::LDEXP_F, UTAP::Constants::LGAMMA_F, UTAP::Constants::LN_F, UTAP::Constants::LOG10_F, UTAP::Constants::LOG1P_F, UTAP::Constants::LOG2_F, UTAP::Constants::LOG_F, UTAP::Constants::LOGB_F, UTAP::Constants::NEXTAFTER_F, UTAP::Constants::POW_F, UTAP::Constants::RANDOM_ARCSINE_F, UTAP::Constants::RANDOM_BETA_F, UTAP::Constants::RANDOM_F, UTAP::Constants::RANDOM_GAMMA_F, UTAP::Constants::RANDOM_NORMAL_F, UTAP::Constants::RANDOM_POISSON_F, UTAP::Constants::RANDOM_TRI_F, UTAP::Constants::RANDOM_WEIBULL_F, UTAP::Constants::ROUND_F, UTAP::Constants::SIGNBIT_F, UTAP::Constants::SIN_F, UTAP::Constants::SINH_F, UTAP::Constants::SQRT_F, UTAP::symbol(), UTAP::Constants::TAN_F, UTAP::Constants::TANH_F, UTAP::Constants::TGAMMA_F, and UTAP::Constants::TRUNC_F.
Referenced by expression_t(), and getPosition().