#include <rangechecker.h>
Public Member Functions | |
RangeChecker (const std::map< symbol_t, expression_t > &) | |
RangeChecker (TimedAutomataSystem *) | |
RangeChecker (TimedAutomataSystem *, const process_t &) | |
range_t | getRange (expression_t) const |
Returns the range of an expression taking the current mapping into account. | |
range_t | getRange (type_t) const |
range_t | getDeclaredRange (expression_t expr) const |
Returns the range of a variable. | |
range_t | getDeclaredRange (symbol_t symbol) const |
Returns the range of a symbol. | |
Protected Member Functions | |
bool | isInteger (expression_t) const |
range_t | rangeOfBinary (expression_t, uint32_t op, expression_t) const |
Returns the range of a binary expression. | |
bool | evaluate (expression_t expr, int32_t &value) const |
For both situations the result might depend on the process context, e.g. a template parameter might be used in the expression or might have been used in the range declaration of an integer variable. So in these cases it is important to provide the process in which the expression should be evaluated.
For constant expressions, the actual value of the expression is returned. If the expression cannot be evaluated (it is not constant), then a range is computed based on the declared ranges of variables used in the expression (and on the values of any constants used).
|
|
|
|
|
|
|
|
|
Returns the range of a symbol. If the symbol is a constant value, then this value is returned. Otherwise the declared range is returned. The function substitutes formal parameters with actual arguments before computing the range. In case of arrays, the range of the base type is returned. |
|
Returns the range of a variable. The argument must be an expression referring to a variable. |
|
|
|
Returns the range of an expression taking the current mapping into account.
|
|
|
|
Returns the range of a binary expression.
|