Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Automaton.cpp
Go to the documentation of this file.
2
9
15
16namespace storm {
17namespace jani {
18
19Automaton::Automaton(std::string const& name, storm::expressions::Variable const& locationExpressionVariable)
20 : name(name), locationExpressionVariable(locationExpressionVariable) {
21 // Add a sentinel element to the mapping from locations to starting indices.
22 locationToStartingIndex.push_back(0);
23}
24
26 std::string const& variablePrefix) {
27 STORM_LOG_ASSERT(var.getManager() == manager, "Expected same manager.");
28 return manager.declareVariable(variablePrefix + var.getName(), var.getType());
29}
30
31Automaton Automaton::clone(storm::expressions::ExpressionManager& manager, std::string const& nameOfClone, std::string const& variablePrefix) const {
32 Automaton result(*this);
33 result.name = nameOfClone;
34 result.locationExpressionVariable = cloneVariable(manager, result.locationExpressionVariable, variablePrefix);
35 auto allVars = result.getAllExpressionVariables();
36 std::map<storm::expressions::Variable, storm::expressions::Expression> oldToNewVarMap;
37 for (auto const& v : allVars) {
38 oldToNewVarMap[v] = cloneVariable(manager, v, variablePrefix).getExpression();
39 }
40 result.variables.substituteExpressionVariables(oldToNewVarMap);
41 // When cloning an automaton, keep the transcendental numbers as they are.
42 const bool substituteTranscendentalNumbers = false;
43 result.substitute(oldToNewVarMap, substituteTranscendentalNumbers);
44 return result;
45}
46
47std::string const& Automaton::getName() const {
48 return name;
49}
50
51Variable const& Automaton::addVariable(Variable const& variable) {
52 return variables.addVariable(variable);
53}
54
55bool Automaton::hasVariable(std::string const& name) const {
56 return variables.hasVariable(name);
57}
58
60 return variables;
61}
62
64 return variables;
65}
66
67std::set<storm::expressions::Variable> Automaton::getAllExpressionVariables() const {
68 std::set<storm::expressions::Variable> result;
69 for (auto const& variable : this->getVariables()) {
70 result.insert(variable.getExpressionVariable());
71 }
72 return result;
73}
74
76 return variables.hasTransientVariable();
77}
78
80 auto insertionRes = functionDefinitions.emplace(functionDefinition.getName(), functionDefinition);
81 STORM_LOG_THROW(insertionRes.second, storm::exceptions::InvalidArgumentException,
82 "A function with the name " << functionDefinition.getName() << " already exists in this automaton (" << this->getName() << ").");
83 return insertionRes.first->second;
84}
85
86std::unordered_map<std::string, FunctionDefinition> const& Automaton::getFunctionDefinitions() const {
87 return functionDefinitions;
88}
89
90std::unordered_map<std::string, FunctionDefinition>& Automaton::getFunctionDefinitions() {
91 return functionDefinitions;
92}
93
94bool Automaton::hasLocation(std::string const& name) const {
95 return locationToIndex.find(name) != locationToIndex.end();
96}
97
98std::vector<Location> const& Automaton::getLocations() const {
99 return locations;
100}
101
102std::vector<Location>& Automaton::getLocations() {
103 return locations;
104}
105
106Location const& Automaton::getLocation(uint64_t index) const {
107 return locations[index];
108}
109
111 return locations[index];
112}
113
114uint64_t Automaton::addLocation(Location const& location) {
115 STORM_LOG_THROW(!this->hasLocation(location.getName()), storm::exceptions::WrongFormatException,
116 "Cannot add location with name '" << location.getName() << "', because a location with this name already exists.");
117 locationToIndex.emplace(location.getName(), locations.size());
118 locations.push_back(location);
119 locationToStartingIndex.push_back(edges.size());
120 return locations.size() - 1;
121}
122
123uint64_t Automaton::getLocationIndex(std::string const& name) const {
124 STORM_LOG_ASSERT(hasLocation(name), "Location not found.");
125 return locationToIndex.at(name);
126}
127
128void Automaton::addInitialLocation(std::string const& name) {
129 auto it = locationToIndex.find(name);
130 STORM_LOG_THROW(it != locationToIndex.end(), storm::exceptions::InvalidArgumentException,
131 "Cannot make unknown location '" << name << "' the initial location.");
132 return addInitialLocation(it->second);
133}
134
135void Automaton::addInitialLocation(uint64_t index) {
136 STORM_LOG_THROW(index < locations.size(), storm::exceptions::InvalidArgumentException,
137 "Cannot make location with index " << index << " initial: out of bounds.");
138 initialLocationIndices.insert(index);
139}
140
141std::set<uint64_t> const& Automaton::getInitialLocationIndices() const {
142 return initialLocationIndices;
143}
144
145std::map<uint64_t, std::string> Automaton::buildIdToLocationNameMap() const {
146 std::map<uint64_t, std::string> mapping;
147 uint64_t i = 0;
148 for (auto const& loc : locations) {
149 mapping[i] = loc.getName();
150 ++i;
151 }
152 return mapping;
153}
154
156 return locationExpressionVariable;
157}
158
159Edge const& Automaton::getEdge(uint64_t index) const {
160 return edges.getConcreteEdges()[index];
161}
162
164 auto it = locationToIndex.find(name);
165 STORM_LOG_THROW(it != locationToIndex.end(), storm::exceptions::InvalidArgumentException, "Cannot retrieve edges from unknown location '" << name << ".");
166 return getEdgesFromLocation(it->second);
167}
168
170 auto it = edges.begin();
171 std::advance(it, locationToStartingIndex[index]);
172 auto ite = edges.begin();
173 std::advance(ite, locationToStartingIndex[index + 1]);
174 return Edges(it, ite);
175}
176
178 auto it = locationToIndex.find(name);
179 STORM_LOG_THROW(it != locationToIndex.end(), storm::exceptions::InvalidArgumentException, "Cannot retrieve edges from unknown location '" << name << ".");
180 return getEdgesFromLocation(it->second);
181}
182
184 auto it = edges.begin();
185 std::advance(it, locationToStartingIndex[index]);
186 auto ite = edges.begin();
187 std::advance(ite, locationToStartingIndex[index + 1]);
188 return ConstEdges(it, ite);
189}
190
191Automaton::Edges Automaton::getEdgesFromLocation(uint64_t locationIndex, uint64_t actionIndex) {
192 typedef std::vector<Edge>::iterator ForwardIt;
193
194 // Perform binary search for start of edges with the given action index.
195 auto first = edges.begin();
196 std::advance(first, locationToStartingIndex[locationIndex]);
197 auto last = edges.begin();
198 std::advance(last, locationToStartingIndex[locationIndex + 1]);
199 typename std::iterator_traits<ForwardIt>::difference_type count, step;
200 count = std::distance(first, last);
201
202 ForwardIt it1;
203 while (count > 0) {
204 it1 = first;
205 step = count / 2;
206 std::advance(it1, step);
207 if (it1->getActionIndex() < actionIndex) {
208 first = ++it1;
209 count -= step + 1;
210 } else {
211 count = step;
212 }
213 }
214 it1 = first;
215
216 // If there is no such edge, we can return now.
217 if (it1 != last && it1->getActionIndex() > actionIndex) {
218 return Edges(last, last);
219 }
220
221 // Otherwise, perform a binary search for the end of the edges with the given action index.
222 count = std::distance(it1, last);
223
224 ForwardIt it2;
225 while (count > 0) {
226 it2 = it1;
227 step = count / 2;
228 std::advance(it2, step);
229 if (actionIndex >= it2->getActionIndex()) {
230 first = ++it2;
231 count -= step + 1;
232 } else {
233 count = step;
234 }
235 }
236 it2 = first;
237
238 return Edges(it1, it2);
239}
240
241Automaton::ConstEdges Automaton::getEdgesFromLocation(uint64_t locationIndex, uint64_t actionIndex) const {
242 typedef std::vector<Edge>::const_iterator ForwardIt;
243
244 // Perform binary search for start of edges with the given action index.
245 auto first = edges.begin();
246 std::advance(first, locationToStartingIndex[locationIndex]);
247 auto last = edges.begin();
248 std::advance(last, locationToStartingIndex[locationIndex + 1]);
249 typename std::iterator_traits<ForwardIt>::difference_type count, step;
250 count = std::distance(first, last);
251
252 ForwardIt it1;
253 while (count > 0) {
254 it1 = first;
255 step = count / 2;
256 std::advance(it1, step);
257 if (it1->getActionIndex() < actionIndex) {
258 first = ++it1;
259 count -= step + 1;
260 } else {
261 count = step;
262 }
263 }
264 it1 = first;
265
266 // If there is no such edge, we can return now.
267 if (it1 != last && it1->getActionIndex() > actionIndex) {
268 return ConstEdges(last, last);
269 }
270
271 // Otherwise, perform a binary search for the end of the edges with the given action index.
272 count = std::distance(it1, last);
273
274 ForwardIt it2;
275 while (count > 0) {
276 it2 = first;
277 step = count / 2;
278 std::advance(it2, step);
279 if (actionIndex >= it2->getActionIndex()) {
280 first = ++it2;
281 count -= step + 1;
282 } else {
283 count = step;
284 }
285 }
286 it2 = first;
287
288 return ConstEdges(it1, it2);
289}
290
292 return edges;
293}
294
296 return edges;
297}
298
299void Automaton::addEdge(Edge const& edge) {
300 STORM_LOG_THROW(edge.getSourceLocationIndex() < locations.size(), storm::exceptions::InvalidArgumentException,
301 "Cannot add edge with unknown source location index '" << edge.getSourceLocationIndex() << "'.");
302 STORM_LOG_ASSERT(validate(), "Automaton validation failed.");
303
304 edges.insertEdge(edge, locationToStartingIndex[edge.getSourceLocationIndex()], locationToStartingIndex[edge.getSourceLocationIndex() + 1]);
305 // Update the set of action indices of this automaton.
306 actionIndices.insert(edge.getActionIndex());
307
308 // Now update the starting indices of all subsequent locations.
309 for (uint64_t locationIndex = edge.getSourceLocationIndex() + 1; locationIndex < locationToStartingIndex.size(); ++locationIndex) {
310 ++locationToStartingIndex[locationIndex];
311 }
312}
313
314std::vector<Edge>& Automaton::getEdges() {
315 return edges.getConcreteEdges();
316}
317
318std::vector<Edge> const& Automaton::getEdges() const {
319 return edges.getConcreteEdges();
320}
321
322std::set<uint64_t> Automaton::getActionIndices() const {
323 return edges.getActionIndices();
324}
325
327 return locations.size();
328}
329
331 return edges.size();
332}
333
336 return false;
337 }
338 if (getInitialStatesRestriction().containsVariables()) {
339 return true;
340 } else {
342 }
343}
344
346 return initialStatesRestriction.isInitialized();
347}
348
350 if (this->hasInitialStatesRestriction() && !this->getInitialStatesRestriction().isTrue()) {
351 return true;
352 }
353
354 for (auto const& variable : this->getVariables()) {
355 if (variable.hasInitExpression() && !variable.isTransient()) {
356 return true;
357 }
358 }
359
360 return false;
361}
362
364 return initialStatesRestriction;
365}
366
368 this->initialStatesRestriction = initialStatesRestriction;
369}
370
373
374 // Add initial state restriction if there is one.
375 if (this->hasInitialStatesRestriction() && !this->getInitialStatesRestriction().isTrue()) {
376 result = this->getInitialStatesRestriction();
377 }
378
379 // Add the expressions for all non-transient variables that have initial expressions.
380 for (auto const& variable : this->getVariables()) {
381 if (variable.isTransient()) {
382 continue;
383 }
384
385 if (variable.hasInitExpression()) {
386 storm::expressions::Expression newInitExpression;
387 if (variable.getType().isBasicType() && variable.getType().asBasicType().isBooleanType()) {
388 newInitExpression = storm::expressions::iff(variable.getExpressionVariable(), variable.getInitExpression());
389 } else {
390 newInitExpression = variable.getExpressionVariable() == variable.getInitExpression();
391 }
392 if (result.isInitialized()) {
393 result = result && newInitExpression;
394 } else {
395 result = newInitExpression;
396 }
397 }
398 }
399
400 return result;
401}
402
404 if (this->hasInitialStatesRestriction()) {
405 return false;
406 }
407
408 bool result = true;
409 for (auto const& variable : this->getVariables()) {
410 if (variable.isTransient()) {
411 continue;
412 }
413
414 result &= variable.hasInitExpression();
415
416 if (!result) {
417 break;
418 }
419 }
420
421 return result;
422}
423
424bool Automaton::hasEdgeLabeledWithActionIndex(uint64_t actionIndex) const {
425 return actionIndices.find(actionIndex) != actionIndices.end();
426}
427
428std::vector<storm::expressions::Expression> Automaton::getAllRangeExpressions() const {
429 std::vector<storm::expressions::Expression> result;
430 for (auto const& variable : this->getVariables().getBoundedIntegerVariables()) {
431 result.push_back(variable.getRangeExpression());
432 }
433 return result;
434}
435
436void Automaton::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution,
437 bool const substituteTranscendentalNumbers) {
438 for (auto& functionDefinition : this->getFunctionDefinitions()) {
439 functionDefinition.second.substitute(substitution, substituteTranscendentalNumbers);
440 }
441
442 this->getVariables().substitute(substitution, substituteTranscendentalNumbers);
443
444 for (auto& location : this->getLocations()) {
445 location.substitute(substitution, substituteTranscendentalNumbers);
446 }
447
449 this->setInitialStatesRestriction(substituteJaniExpression(this->getInitialStatesRestriction(), substitution, substituteTranscendentalNumbers));
450 }
451
452 edges.substitute(substitution, substituteTranscendentalNumbers);
453}
454void Automaton::registerTemplateEdge(std::shared_ptr<TemplateEdge> const& te) {
455 edges.insertTemplateEdge(te);
456}
457
458void Automaton::changeAssignmentVariables(std::map<Variable const*, std::reference_wrapper<Variable const>> const& remapping) {
459 for (auto& location : locations) {
460 location.changeAssignmentVariables(remapping);
461 }
462 edges.changeAssignmentVariables(remapping);
463}
464
465void Automaton::finalize(Model const& containingModel) {
466 // simplifyIndexedAssignments();
467 edges.finalize(containingModel);
468}
469
470bool Automaton::containsVariablesOnlyInProbabilitiesOrTransientAssignments(std::set<storm::expressions::Variable> const& variables) const {
471 // Check initial states restriction expression.
472 if (this->hasInitialStatesRestriction()) {
473 if (this->getInitialStatesRestriction().containsVariable(variables)) {
474 return false;
475 }
476 }
477
478 // Check global variable definitions.
479 if (this->getVariables().containsVariablesInBoundExpressionsOrInitialValues(variables)) {
480 return false;
481 }
482
483 // Check edges.
484 for (auto const& edge : edges) {
485 if (edge.usesVariablesInNonTransientAssignments(variables)) {
486 return false;
487 }
488 }
489
490 return true;
491}
492
494 edges.pushAssignmentsToDestinations();
495}
496
498 std::set<std::shared_ptr<storm::jani::TemplateEdge>> encounteredTemplateEdges;
499
500 for (uint64_t locationIndex = 0; locationIndex < locations.size(); ++locationIndex) {
501 auto& location = locations[locationIndex];
502 auto edges = this->getEdgesFromLocation(locationIndex);
503
504 storm::jani::Location newLocation(location.getName());
505 bool createNewLocation = true;
506 for (auto& edge : edges) {
507 STORM_LOG_THROW(encounteredTemplateEdges.find(edge.getTemplateEdge()) == encounteredTemplateEdges.end(), storm::exceptions::NotSupportedException,
508 "Pushing location assignments to edges is only supported for automata with unique template edges.");
509
510 auto& templateEdge = edge.getTemplateEdge();
511 encounteredTemplateEdges.insert(templateEdge);
512
513 for (auto const& assignment : location.getAssignments().getTransientAssignments()) {
514 auto const& var = assignment.getVariable();
515 if (var.isTransient() && var.getType().isBasicType() && var.getType().asBasicType().isRealType()) {
516 templateEdge->addTransientAssignment(assignment, true);
517 } else if (createNewLocation) {
518 newLocation.addTransientAssignment(assignment);
519 }
520 }
521
522 if (createNewLocation) {
523 createNewLocation = false;
524 }
525 }
526
527 location = std::move(newLocation);
528 }
529}
530
532 for (auto const& edge : this->getEdges()) {
533 if (edge.hasTransientEdgeDestinationAssignments()) {
534 return true;
535 }
536 }
537 return false;
538}
539
541 edges.liftTransientDestinationAssignments(maxLevel);
542}
543
545 STORM_LOG_ASSERT(locationToStartingIndex.size() == locations.size() + 1, "Location index size mismatch.");
546 for (uint64_t i = 0; i < locations.size(); i++) {
547 STORM_LOG_ASSERT(locationToStartingIndex[i] <= locationToStartingIndex[i + 1], "Location index not monotonically increasing.");
548 }
549 return true;
550}
551
552bool Automaton::usesAssignmentLevels(bool onlyTransient) const {
553 return edges.usesAssignmentLevels(onlyTransient);
554}
555
557 bool result = true;
558
559 for (auto const& location : this->getLocations()) {
560 result &= location.isLinear();
561 }
562 if (result) {
563 result &= edges.isLinear();
564 }
565 return result;
566}
567
569 std::vector<Edge> oldEdges = this->edges.getConcreteEdges();
570
571 this->edges.clearConcreteEdges();
572 actionIndices.clear();
573 for (auto& e : locationToStartingIndex) {
574 e = 0;
575 }
576
577 for (auto const& index : edgeIndices) {
578 this->addEdge(oldEdges[index]);
579 }
580}
581
582void Automaton::writeDotToStream(std::ostream& outStream, std::vector<std::string> const& actionNames) const {
583 outStream << "\tsubgraph " << name << " {\n";
584
585 // Write all locations to the stream.
586 uint64_t locIndex = 0;
587 for (auto const& loc : locations) {
588 outStream << "\t" << name << "_s" << locIndex << "[ label=\"" << loc.getName() << "\"];\n";
589 ++locIndex;
590 }
591 // Write for each edge an node to the stream;
592 uint64_t edgeIndex = 0;
593 for (auto const& edge : edges) {
594 outStream << "\t" << name << "_e" << edgeIndex << "[ label=\"\" , shape=circle, width=.2, style=filled, fillcolor=\"black\"];\n";
595 ++edgeIndex;
596
597 // Silencing unused variable warning.
598 (void)edge;
599 }
600
601 // Connect edges
602 edgeIndex = 0;
603 for (auto const& edge : edges) {
604 outStream << "\t" << name << "_s" << edge.getSourceLocationIndex() << " -> " << name << "_e" << edgeIndex << " [label=\""
605 << actionNames.at(edge.getActionIndex()) << "\"];\n";
606 for (auto const& edgeDest : edge.getDestinations()) {
607 outStream << "\t" << name << "_e" << edgeIndex << " -> " << name << "_s" << edgeDest.getLocationIndex() << ";\n";
608 }
609 ++edgeIndex;
610 }
611
612 outStream << "\t}\n";
613}
614} // namespace jani
615} // namespace storm
bool evaluateAsBool(Valuation const *valuation=nullptr) const
Evaluates the expression under the valuation of variables given by the valuation and returns the resu...
bool isInitialized() const
Checks whether the object encapsulates a base-expression.
This class is responsible for managing a set of typed variables and all expressions using these varia...
ExpressionManager const & getManager() const
Retrieves the manager responsible for this variable.
Definition Variable.cpp:54
Type const & getType() const
Retrieves the type of the variable.
Definition Variable.cpp:50
storm::expressions::Expression getExpression() const
Retrieves an expression that represents the variable.
Definition Variable.cpp:34
std::string const & getName() const
Retrieves the name of the variable.
Definition Variable.cpp:46
detail::ConstEdges ConstEdges
Definition Automaton.h:30
VariableSet & getVariables()
Retrieves the variables of this automaton.
Definition Automaton.cpp:59
Automaton clone(storm::expressions::ExpressionManager &manager, std::string const &nameOfClone, std::string const &variablePrefix) const
Definition Automaton.cpp:31
bool usesAssignmentLevels(bool onlyTransient=false) const
Retrieves whether the automaton uses an assignment level other than zero.
std::set< storm::expressions::Variable > getAllExpressionVariables() const
Retrieves all expression variables used by this automaton.
Definition Automaton.cpp:67
void addEdge(Edge const &edge)
Adds an edge to the automaton.
storm::expressions::Expression const & getInitialStatesRestriction() const
Gets the expression restricting the legal initial values of the automaton's variables.
bool hasLocation(std::string const &name) const
Retrieves whether the automaton has a location with the given name.
Definition Automaton.cpp:94
void registerTemplateEdge(std::shared_ptr< TemplateEdge > const &)
Adds the template edge to the list of edges.
void finalize(Model const &containingModel)
Finalizes the building of this automaton.
bool hasVariable(std::string const &name) const
Definition Automaton.cpp:55
Automaton(std::string const &name, storm::expressions::Variable const &locationExpressionVariable)
Creates an empty automaton.
Definition Automaton.cpp:19
storm::expressions::Expression getInitialStatesExpression() const
Retrieves the expression defining the legal initial values of the automaton's variables.
storm::expressions::Variable const & getLocationExpressionVariable() const
Retrieves the expression variable that represents the location of this automaton.
Location const & getLocation(uint64_t index) const
Retrieves the location with the given index.
std::set< uint64_t > const & getInitialLocationIndices() const
Retrieves the indices of the initial locations.
std::vector< storm::expressions::Expression > getAllRangeExpressions() const
Retrieves a list of expressions that characterize the legal values of the variables in this automaton...
bool isLinear() const
Checks the automaton for linearity.
void setInitialStatesRestriction(storm::expressions::Expression const &initialStatesRestriction)
Sets the expression restricting the legal initial values of the automaton's variables.
Variable const & addVariable(Variable const &variable)
Adds the given variable to this automaton.
Definition Automaton.cpp:51
bool hasTrivialInitialStatesExpression() const
Retrieves whether the initial states expression is trivial in the sense that the automaton has no ini...
FunctionDefinition const & addFunctionDefinition(FunctionDefinition const &functionDefinition)
Adds the given function definition.
Definition Automaton.cpp:79
void addInitialLocation(std::string const &name)
Adds the location with the given name to the initial locations.
uint64_t getNumberOfEdges() const
Retrieves the number of edges.
bool hasRestrictedInitialStates() const
Retrieves whether the initial restriction is set and unequal to true.
uint64_t addLocation(Location const &location)
Adds the given location to the automaton.
void changeAssignmentVariables(std::map< Variable const *, std::reference_wrapper< Variable const > > const &remapping)
Changes all variables in assignments based on the given mapping.
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.
bool containsVariablesOnlyInProbabilitiesOrTransientAssignments(std::set< storm::expressions::Variable > const &variables) const
Checks whether the provided variables only appear in the probability expressions or the expressions b...
std::vector< Location > const & getLocations() const
Retrieves the locations of the automaton.
Definition Automaton.cpp:98
Edge const & getEdge(uint64_t index) const
Retrieves the edge with the given index in this automaton.
uint64_t getNumberOfLocations() const
Retrieves the number of locations.
Edges getEdgesFromLocation(std::string const &name)
Retrieves the edges of the location with the given name.
bool hasNonTrivialInitialStates() const
Retrieves whether this automaton has non-trivial initial states.
bool hasEdgeLabeledWithActionIndex(uint64_t actionIndex) const
Retrieves whether there is an edge labeled with the action with the given index in this automaton.
bool hasTransientVariable() const
Retrieves whether this automaton has a transient variable.
Definition Automaton.cpp:75
bool hasInitialStatesRestriction() const
Retrieves whether this automaton has an initial states restriction.
void pushTransientRealLocationAssignmentsToEdges()
Pushes the assignments to real-valued transient variables to the edges.
void writeDotToStream(std::ostream &outStream, std::vector< std::string > const &actionNames) const
std::unordered_map< std::string, FunctionDefinition > const & getFunctionDefinitions() const
Retrieves all function definitions of this automaton.
Definition Automaton.cpp:86
std::string const & getName() const
Retrieves the name of the automaton.
Definition Automaton.cpp:47
bool hasTransientEdgeDestinationAssignments() const
Retrieves whether there is any transient edge destination assignment in the automaton.
std::set< uint64_t > getActionIndices() const
Retrieves the set of action indices that are labels of edges of this automaton.
detail::Edges Edges
Definition Automaton.h:29
void liftTransientEdgeDestinationAssignments(int64_t maxLevel=0)
Lifts the common edge destination assignments to edge assignments.
std::vector< Edge > & getEdges()
Retrieves the edges of the automaton.
void pushEdgeAssignmentsToDestinations()
Pushes the edge assignments to the corresponding destinations.
uint64_t getLocationIndex(std::string const &name) const
EdgeContainer const & getEdgeContainer() const
Retrieves the container of all edges of this automaton.
void restrictToEdges(storm::storage::FlatSet< uint_fast64_t > const &edgeIndices)
Restricts the automaton to the edges given by the indices.
std::map< uint64_t, std::string > buildIdToLocationNameMap() const
Builds a map from ID to Location Name.
uint64_t getActionIndex() const
Retrieves the id of the action with which this edge is labeled.
Definition Edge.cpp:45
uint64_t getSourceLocationIndex() const
Retrieves the index of the source location.
Definition Edge.cpp:41
std::string const & getName() const
Retrieves the name of the function.
Jani Location:
Definition Location.h:15
void addTransientAssignment(storm::jani::Assignment const &assignment)
Adds the given transient assignment to this location.
Definition Location.cpp:31
std::string const & getName() const
Retrieves the name of the location.
Definition Location.cpp:19
void substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution, bool const substituteTranscendentalNumbers)
Applies the given substitution to all variables in this set.
bool hasTransientVariable() const
Retrieves whether this variable set contains a transient variable.
void substituteExpressionVariables(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution)
Substitutes the actual variables according to the given substitution.
iterator begin() const
Retrieves an iterator to the edges.
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:9
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:28
Expression iff(Expression const &first, Expression const &second)
storm::expressions::Variable cloneVariable(storm::expressions::ExpressionManager &manager, storm::expressions::Variable const &var, std::string const &variablePrefix)
Definition Automaton.cpp:25
storm::expressions::Expression substituteJaniExpression(storm::expressions::Expression const &expression, std::map< storm::expressions::Variable, storm::expressions::Expression > const &identifierToExpressionMap, bool const substituteTranscendentalNumbers)
boost::container::flat_set< Key, std::less< Key >, boost::container::new_allocator< Key > > FlatSet
Redefinition of flat_set was needed, because from Boost 1.70 on the default allocator is set to void.
Definition BoostTypes.h:13