Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Command.h
Go to the documentation of this file.
1#ifndef STORM_STORAGE_PRISM_COMMAND_H_
2#define STORM_STORAGE_PRISM_COMMAND_H_
3
4#include <map>
5#include <string>
6#include <vector>
7
11
12namespace storm {
13namespace prism {
15 public:
29 Command(uint_fast64_t globalIndex, bool markovian, uint_fast64_t actionIndex, std::string const& actionName,
30 storm::expressions::Expression const& guardExpression, std::vector<storm::prism::Update> const& updates, std::string const& filename = "",
31 uint_fast64_t lineNumber = 0);
32
33 // Create default implementations of constructors/assignment.
34 Command() = default;
35 Command(Command const& other) = default;
36 Command& operator=(Command const& other) = default;
37 Command(Command&& other) = default;
38 Command& operator=(Command&& other) = default;
39
45 std::string const& getActionName() const;
46
52 uint_fast64_t getActionIndex() const;
53
60 bool isMarkovian() const;
61
68 void setMarkovian(bool value);
69
76
82 std::size_t getNumberOfUpdates() const;
83
89 storm::prism::Update const& getUpdate(uint_fast64_t index) const;
90
96 std::vector<storm::prism::Update> const& getUpdates() const;
97
103 std::vector<storm::prism::Update>& getUpdates();
104
110 uint_fast64_t getGlobalIndex() const;
111
118 Command substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
119
126 bool isLabeled() const;
127
135 bool containsVariablesOnlyInUpdateProbabilities(std::set<storm::expressions::Variable> const& undefinedConstantVariables) const;
136
137 friend std::ostream& operator<<(std::ostream& stream, Command const& command);
138
142 Command simplify() const;
143
144 private:
145 // The index of the action associated with this command.
146 uint_fast64_t actionIndex;
147
148 // A flag indicating whether the likelihoods attached to the updates are to be interpreted as rates rather
149 // than probabilities.
150 bool markovian;
151
152 // The name of the command.
153 std::string actionName;
154
155 // The expression that defines the guard of the command.
156 storm::expressions::Expression guardExpression;
157
158 // The list of updates of the command.
159 std::vector<storm::prism::Update> updates;
160
161 // The global index of the command.
162 uint_fast64_t globalIndex;
163
164 // A flag indicating whether the command is labeled.
165 bool labeled;
166
167 Command copyWithNewUpdates(std::vector<Update>&& newUpdates) const;
168};
169
170} // namespace prism
171} // namespace storm
172
173#endif /* STORM_STORAGE_PRISM_COMMAND_H_ */
Command(Command &&other)=default
Command & operator=(Command const &other)=default
std::vector< storm::prism::Update > const & getUpdates() const
Retrieves a vector of all updates associated with this command.
Definition Command.cpp:48
bool isLabeled() const
Retrieves whether the command possesses a synchronization label.
Definition Command.cpp:82
friend std::ostream & operator<<(std::ostream &stream, Command const &command)
Definition Command.cpp:122
std::size_t getNumberOfUpdates() const
Retrieves the number of updates associated with this command.
Definition Command.cpp:39
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.
Definition Command.cpp:86
std::string const & getActionName() const
Retrieves the action name of this command.
Definition Command.cpp:31
storm::prism::Update const & getUpdate(uint_fast64_t index) const
Retrieves a reference to the update with the given index.
Definition Command.cpp:43
Command substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all identifiers in the command according to the given map.
Definition Command.cpp:60
void setMarkovian(bool value)
Sets whether this command is a Markovian command, i.e.
Definition Command.cpp:27
storm::expressions::Expression const & getGuardExpression() const
Retrieves a reference to the guard of the command.
Definition Command.cpp:35
Command simplify() const
Simplifies this command.
Definition Command.cpp:106
uint_fast64_t getActionIndex() const
Retrieves the action index of this command.
Definition Command.cpp:19
Command & operator=(Command &&other)=default
Command(Command const &other)=default
bool isMarkovian() const
Retrieves whether the command is a Markovian command, i.e.
Definition Command.cpp:23
Command substituteNonStandardPredicates() const
Definition Command.cpp:71
uint_fast64_t getGlobalIndex() const
Retrieves the global index of the command, that is, a unique index over all modules.
Definition Command.cpp:56
LabParser.cpp.
Definition cli.cpp:18