Storm 1.10.0.1
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
10
11namespace storm {
12namespace prism {
14 public:
28 Command(uint_fast64_t globalIndex, bool markovian, uint_fast64_t actionIndex, std::string const& actionName,
29 storm::expressions::Expression const& guardExpression, std::vector<storm::prism::Update> const& updates, std::string const& filename = "",
30 uint_fast64_t lineNumber = 0);
31
32 // Create default implementations of constructors/assignment.
33 Command() = default;
34 Command(Command const& other) = default;
35 Command& operator=(Command const& other) = default;
36 Command(Command&& other) = default;
37 Command& operator=(Command&& other) = default;
38
44 std::string const& getActionName() const;
45
51 uint_fast64_t getActionIndex() const;
52
59 bool isMarkovian() const;
60
67 void setMarkovian(bool value);
68
75
81 std::size_t getNumberOfUpdates() const;
82
88 storm::prism::Update const& getUpdate(uint_fast64_t index) const;
89
95 std::vector<storm::prism::Update> const& getUpdates() const;
96
102 std::vector<storm::prism::Update>& getUpdates();
103
109 uint_fast64_t getGlobalIndex() const;
110
117 Command substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
118
125 bool isLabeled() const;
126
134 bool containsVariablesOnlyInUpdateProbabilities(std::set<storm::expressions::Variable> const& undefinedConstantVariables) const;
135
136 friend std::ostream& operator<<(std::ostream& stream, Command const& command);
137
141 Command simplify() const;
142
143 private:
144 // The index of the action associated with this command.
145 uint_fast64_t actionIndex;
146
147 // A flag indicating whether the likelihoods attached to the updates are to be interpreted as rates rather
148 // than probabilities.
149 bool markovian;
150
151 // The name of the command.
152 std::string actionName;
153
154 // The expression that defines the guard of the command.
155 storm::expressions::Expression guardExpression;
156
157 // The list of updates of the command.
158 std::vector<storm::prism::Update> updates;
159
160 // The global index of the command.
161 uint_fast64_t globalIndex;
162
163 // A flag indicating whether the command is labeled.
164 bool labeled;
165
166 Command copyWithNewUpdates(std::vector<Update>&& newUpdates) const;
167};
168
169} // namespace prism
170} // namespace storm
171
172#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.