Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Update.h
Go to the documentation of this file.
1#ifndef STORM_STORAGE_PRISM_UPDATE_H_
2#define STORM_STORAGE_PRISM_UPDATE_H_
3
4#include <vector>
5
9
10namespace storm {
11namespace prism {
12class Update : public LocatedInformation {
13 public:
23 Update(uint_fast64_t globalIndex, storm::expressions::Expression const& likelihoodExpression, std::vector<storm::prism::Assignment> const& assignments,
24 std::string const& filename = "", uint_fast64_t lineNumber = 0);
25
26 // Create default implementations of constructors/assignment.
27 Update() = default;
28 Update(Update const& other) = default;
29 Update& operator=(Update const& other) = default;
30 Update(Update&& other) = default;
31 Update& operator=(Update&& other) = default;
32
39
45 std::size_t getNumberOfAssignments() const;
46
52 std::vector<storm::prism::Assignment> const& getAssignments() const;
53
59 std::vector<storm::prism::Assignment>& getAssignments();
60
66 storm::prism::Assignment const& getAssignment(std::string const& variableName) const;
67
73 std::map<storm::expressions::Variable, storm::expressions::Expression> getAsVariableToExpressionMap() const;
74
80 uint_fast64_t getGlobalIndex() const;
81
88 Update substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
89
96
98
102 Update simplify() const;
103
104 friend std::ostream& operator<<(std::ostream& stream, Update const& assignment);
105
106 private:
110 void createAssignmentMapping();
111
112 // An expression specifying the likelihood of taking this update.
113 storm::expressions::Expression likelihoodExpression;
114
115 // The assignments of this update.
116 std::vector<storm::prism::Assignment> assignments;
117
118 // A mapping from variable names to their assignments.
119 std::map<std::string, uint_fast64_t> variableToAssignmentIndexMap;
120
121 // The global index of the update.
122 uint_fast64_t globalIndex;
123};
124} // namespace prism
125} // namespace storm
126
127#endif /* STORM_STORAGE_PRISM_UPDATE_H_ */
Update substituteNonStandardPredicates() const
Definition Update.cpp:92
std::size_t getNumberOfAssignments() const
Retrieves the number of assignments associated with this update.
Definition Update.cpp:40
Update & operator=(Update const &other)=default
Update substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all identifiers in the update according to the given map.
Definition Update.cpp:80
Update simplify() const
Simplifies the update in various ways (also removes identity assignments)
Definition Update.cpp:115
std::map< storm::expressions::Variable, storm::expressions::Expression > getAsVariableToExpressionMap() const
Creates a mapping representation of this update.
Definition Update.cpp:59
Update(Update &&other)=default
Update(Update const &other)=default
storm::prism::Assignment const & getAssignment(std::string const &variableName) const
Retrieves a reference to the assignment for the variable with the given name.
Definition Update.cpp:52
uint_fast64_t getGlobalIndex() const
Retrieves the global index of the update, that is, a unique index over all modules.
Definition Update.cpp:69
Update & operator=(Update &&other)=default
Update removeIdentityAssignments() const
Removes all assignments which do not change the variable.
Definition Update.cpp:104
friend std::ostream & operator<<(std::ostream &stream, Update const &assignment)
Definition Update.cpp:127
std::vector< storm::prism::Assignment > const & getAssignments() const
Retrieves a reference to the map of variable names to their respective assignments.
Definition Update.cpp:44
storm::expressions::Expression const & getLikelihoodExpression() const
Retrieves the expression for the likelihood of this update.
Definition Update.cpp:36
LabParser.cpp.
Definition cli.cpp:18