Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
OrderedAssignments.h
Go to the documentation of this file.
1#pragma once
2
4
6
7namespace storm {
8namespace jani {
9
10class VariableSet;
11
12namespace detail {
15} // namespace detail
16
18 public:
22 OrderedAssignments(std::vector<Assignment> const& assignments = std::vector<Assignment>());
23
24 explicit OrderedAssignments(Assignment const& assignment);
25
33 bool add(Assignment const& assignment, bool addToExisting = false);
34
40 bool remove(Assignment const& assignment);
41
47 bool hasMultipleLevels(bool onlyTransient = false) const;
48
55 OrderedAssignments simplifyLevels(bool synchronous, VariableSet const& localVars, bool first = true) const;
56
60 bool empty(bool onlyTransient = false) const;
61
65 void clear();
66
70 std::size_t getNumberOfAssignments() const;
71
76 int64_t getLowestLevel(bool onlyTransient = false) const;
77
82 int64_t getHighestLevel(bool onlyTransient = false) const;
83
87 bool contains(Assignment const& assignment) const;
88
93
98
102 detail::ConstAssignments getTransientAssignments(int64_t assignmentLevel) const;
103
108
112 detail::ConstAssignments getNonTransientAssignments(int64_t assignmentLevel) const;
113
117 bool hasTransientAssignment() const;
118
123
128
133
138
142 void substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution, bool const substituteTranscendentalNumbers);
143
147 void changeAssignmentVariables(std::map<Variable const*, std::reference_wrapper<Variable const>> const& remapping);
148
152 bool areLinear() const;
153
154 friend std::ostream& operator<<(std::ostream& stream, OrderedAssignments const& assignments);
155
157
161 bool checkOrder() const;
162
163 private:
164 uint64_t isReadBeforeAssignment(LValue const& lValue, uint64_t assignmentNumber, uint64_t start = 0) const;
165 uint64_t isWrittenBeforeAssignment(LValue const& LValue, uint64_t assignmentNumber, uint64_t start = 0) const;
166
172 uint64_t upperBound(int64_t index) const;
173
174 static std::vector<std::shared_ptr<Assignment>>::const_iterator lowerBound(Assignment const& assignment,
175 std::vector<std::shared_ptr<Assignment>> const& assignments);
176
177 // The vectors to store the assignments. These need to be ordered at all times.
178 std::vector<std::shared_ptr<Assignment>> allAssignments;
179 std::vector<std::shared_ptr<Assignment>> transientAssignments;
180 std::vector<std::shared_ptr<Assignment>> nonTransientAssignments;
181};
182
183} // namespace jani
184} // namespace storm
boost::transform_iterator< Dereferencer< value_type >, input_iterator > iterator
bool hasMultipleLevels(bool onlyTransient=false) const
Checks whether the assignments have several levels.
void substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution, bool const substituteTranscendentalNumbers)
Substitutes all variables in all expressions according to the given substitution.
void changeAssignmentVariables(std::map< Variable const *, std::reference_wrapper< Variable const > > const &remapping)
Changes all variables in assignments based on the given mapping.
bool empty(bool onlyTransient=false) const
Retrieves whether this set of assignments is empty.
OrderedAssignments simplifyLevels(bool synchronous, VariableSet const &localVars, bool first=true) const
Produces a new OrderedAssignments object with simplified leveling.
std::size_t getNumberOfAssignments() const
Retrieves the total number of assignments.
detail::Assignments::iterator begin()
Returns an iterator to the assignments.
int64_t getLowestLevel(bool onlyTransient=false) const
Retrieves the lowest level among all assignments.
detail::ConstAssignments getNonTransientAssignments() const
Returns all non-transient assignments in this set of assignments.
detail::ConstAssignments getTransientAssignments() const
Returns all transient assignments in this set of assignments.
bool checkOrder() const
Checks whether this ordered assignment is in the correct order.
int64_t getHighestLevel(bool onlyTransient=false) const
Retrieves the highest level among all assignments.
bool areLinear() const
Checks the assignments for linearity.
friend std::ostream & operator<<(std::ostream &stream, OrderedAssignments const &assignments)
bool hasTransientAssignment() const
Retrieves whether the set of assignments has at least one transient assignment.
bool remove(Assignment const &assignment)
Removes the given assignment from this set of assignments.
detail::ConstAssignments getAllAssignments() const
Returns all assignments in this set of assignments.
OrderedAssignments clone() const
detail::Assignments::iterator end()
Returns an iterator past the end of the assignments.
void clear()
Removes all assignments from this set.
bool add(Assignment const &assignment, bool addToExisting=false)
Adds the given assignment to the set of assignments.
bool contains(Assignment const &assignment) const
Retrieves whether the given assignment is contained in this set of assignments.
LabParser.cpp.
Definition cli.cpp:18