5Command::Command(uint_fast64_t globalIndex,
bool markovian, uint_fast64_t actionIndex, std::string
const& actionName,
7 uint_fast64_t lineNumber)
9 actionIndex(actionIndex),
11 actionName(actionName),
12 guardExpression(guardExpression),
14 globalIndex(globalIndex),
15 labeled(actionName !=
"") {
20 return this->actionIndex;
24 return this->markovian;
28 this->markovian = value;
32 return this->actionName;
36 return guardExpression;
40 return this->updates.size();
45 return this->updates[index];
57 return this->globalIndex;
61 std::vector<Update> newUpdates;
63 for (
auto const& update : this->
getUpdates()) {
64 newUpdates.emplace_back(update.substitute(substitution));
72 std::vector<Update> newUpdates;
74 for (
auto const& update : this->
getUpdates()) {
75 newUpdates.emplace_back(update.substituteNonStandardPredicates());
90 for (
auto const& update : this->
getUpdates()) {
91 for (
auto const& assignment : update.getAssignments()) {
92 if (assignment.getExpression().containsVariable(undefinedConstantVariables)) {
98 if (update.getLikelihoodExpression().containsVariableInITEGuard(undefinedConstantVariables)) {
107 std::vector<Update> newUpdates;
109 for (
auto const& update : this->
getUpdates()) {
110 newUpdates.emplace_back(update.simplify());
117Command Command::copyWithNewUpdates(std::vector<Update>&& newUpdates)
const {
129 for (uint_fast64_t i = 0; i < command.
getUpdates().size(); ++i) {
Expression simplify() const
Simplifies the expression according to some basic rules.
Expression reduceNesting() const
Tries to flatten the syntax tree of the expression, e.g., 1 + (2 + (3 + 4)) becomes (1 + 2) + (3 + 4)
std::vector< storm::prism::Update > const & getUpdates() const
Retrieves a vector of all updates associated with this command.
bool isLabeled() const
Retrieves whether the command possesses a synchronization label.
std::size_t getNumberOfUpdates() const
Retrieves the number of updates associated with this command.
bool containsVariablesOnlyInUpdateProbabilities(std::set< storm::expressions::Variable > const &undefinedConstantVariables) const
Checks whether the given set of variables only appears in the update probabilities of the command.
std::string const & getActionName() const
Retrieves the action name of this command.
storm::prism::Update const & getUpdate(uint_fast64_t index) const
Retrieves a reference to the update with the given index.
Command substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all identifiers in the command according to the given map.
void setMarkovian(bool value)
Sets whether this command is a Markovian command, i.e.
storm::expressions::Expression const & getGuardExpression() const
Retrieves a reference to the guard of the command.
Command simplify() const
Simplifies this command.
uint_fast64_t getActionIndex() const
Retrieves the action index of this command.
bool isMarkovian() const
Retrieves whether the command is a Markovian command, i.e.
Command substituteNonStandardPredicates() const
uint_fast64_t getGlobalIndex() const
Retrieves the global index of the command, that is, a unique index over all modules.
#define STORM_LOG_ASSERT(cond, message)
std::ostream & operator<<(std::ostream &stream, Assignment const &assignment)