Storm
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 assert(hasLocation(name));
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 it2 = first;
236
237 return Edges(it1, it2);
238}
239
240Automaton::ConstEdges Automaton::getEdgesFromLocation(uint64_t locationIndex, uint64_t actionIndex) const {
241 typedef std::vector<Edge>::const_iterator ForwardIt;
242
243 // Perform binary search for start of edges with the given action index.
244 auto first = edges.begin();
245 std::advance(first, locationToStartingIndex[locationIndex]);
246 auto last = edges.begin();
247 std::advance(last, locationToStartingIndex[locationIndex + 1]);
248 typename std::iterator_traits<ForwardIt>::difference_type count, step;
249 count = std::distance(first, last);
250
251 ForwardIt it1;
252 while (count > 0) {
253 it1 = first;
254 step = count / 2;
255 std::advance(it1, step);
256 if (it1->getActionIndex() < actionIndex) {
257 first = ++it1;
258 count -= step + 1;
259 } else {
260 count = step;
261 }
262 }
263 it1 = first;
264
265 // If there is no such edge, we can return now.
266 if (it1 != last && it1->getActionIndex() > actionIndex) {
267 return ConstEdges(last, last);
268 }
269
270 // Otherwise, perform a binary search for the end of the edges with the given action index.
271 count = std::distance(it1, last);
272
273 ForwardIt it2;
274 while (count > 0) {
275 it2 = first;
276 step = count / 2;
277 std::advance(it2, step);
278 if (!(actionIndex < it2->getActionIndex())) {
279 first = ++it2;
280 count -= step + 1;
281 } else
282 count = step;
283 }
284 it2 = first;
285
286 return ConstEdges(it1, it2);
287}
288
290 return edges;
291}
292
294 return edges;
295}
296
297void Automaton::addEdge(Edge const& edge) {
298 STORM_LOG_THROW(edge.getSourceLocationIndex() < locations.size(), storm::exceptions::InvalidArgumentException,
299 "Cannot add edge with unknown source location index '" << edge.getSourceLocationIndex() << "'.");
300 assert(validate());
301
302 edges.insertEdge(edge, locationToStartingIndex[edge.getSourceLocationIndex()], locationToStartingIndex[edge.getSourceLocationIndex() + 1]);
303 // Update the set of action indices of this automaton.
304 actionIndices.insert(edge.getActionIndex());
305
306 // Now update the starting indices of all subsequent locations.
307 for (uint64_t locationIndex = edge.getSourceLocationIndex() + 1; locationIndex < locationToStartingIndex.size(); ++locationIndex) {
308 ++locationToStartingIndex[locationIndex];
309 }
310}
311
312std::vector<Edge>& Automaton::getEdges() {
313 return edges.getConcreteEdges();
314}
315
316std::vector<Edge> const& Automaton::getEdges() const {
317 return edges.getConcreteEdges();
318}
319
320std::set<uint64_t> Automaton::getActionIndices() const {
321 return edges.getActionIndices();
322}
323
325 return locations.size();
326}
327
329 return edges.size();
330}
331
334 return false;
335 }
336 if (getInitialStatesRestriction().containsVariables()) {
337 return true;
338 } else {
340 }
341}
342
344 return initialStatesRestriction.isInitialized();
345}
346
348 if (this->hasInitialStatesRestriction() && !this->getInitialStatesRestriction().isTrue()) {
349 return true;
350 }
351
352 for (auto const& variable : this->getVariables()) {
353 if (variable.hasInitExpression() && !variable.isTransient()) {
354 return true;
355 }
356 }
357
358 return false;
359}
360
362 return initialStatesRestriction;
363}
364
366 this->initialStatesRestriction = initialStatesRestriction;
367}
368
371
372 // Add initial state restriction if there is one.
373 if (this->hasInitialStatesRestriction() && !this->getInitialStatesRestriction().isTrue()) {
374 result = this->getInitialStatesRestriction();
375 }
376
377 // Add the expressions for all non-transient variables that have initial expressions.
378 for (auto const& variable : this->getVariables()) {
379 if (variable.isTransient()) {
380 continue;
381 }
382
383 if (variable.hasInitExpression()) {
384 storm::expressions::Expression newInitExpression;
385 if (variable.getType().isBasicType() && variable.getType().asBasicType().isBooleanType()) {
386 newInitExpression = storm::expressions::iff(variable.getExpressionVariable(), variable.getInitExpression());
387 } else {
388 newInitExpression = variable.getExpressionVariable() == variable.getInitExpression();
389 }
390 if (result.isInitialized()) {
391 result = result && newInitExpression;
392 } else {
393 result = newInitExpression;
394 }
395 }
396 }
397
398 return result;
399}
400
402 if (this->hasInitialStatesRestriction()) {
403 return false;
404 }
405
406 bool result = true;
407 for (auto const& variable : this->getVariables()) {
408 if (variable.isTransient()) {
409 continue;
410 }
411
412 result &= variable.hasInitExpression();
413
414 if (!result) {
415 break;
416 }
417 }
418
419 return result;
420}
421
422bool Automaton::hasEdgeLabeledWithActionIndex(uint64_t actionIndex) const {
423 return actionIndices.find(actionIndex) != actionIndices.end();
424}
425
426std::vector<storm::expressions::Expression> Automaton::getAllRangeExpressions() const {
427 std::vector<storm::expressions::Expression> result;
428 for (auto const& variable : this->getVariables().getBoundedIntegerVariables()) {
429 result.push_back(variable.getRangeExpression());
430 }
431 return result;
432}
433
434void Automaton::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution,
435 bool const substituteTranscendentalNumbers) {
436 for (auto& functionDefinition : this->getFunctionDefinitions()) {
437 functionDefinition.second.substitute(substitution, substituteTranscendentalNumbers);
438 }
439
440 this->getVariables().substitute(substitution, substituteTranscendentalNumbers);
441
442 for (auto& location : this->getLocations()) {
443 location.substitute(substitution, substituteTranscendentalNumbers);
444 }
445
447 this->setInitialStatesRestriction(substituteJaniExpression(this->getInitialStatesRestriction(), substitution, substituteTranscendentalNumbers));
448 }
449
450 edges.substitute(substitution, substituteTranscendentalNumbers);
451}
452void Automaton::registerTemplateEdge(std::shared_ptr<TemplateEdge> const& te) {
453 edges.insertTemplateEdge(te);
454}
455
456void Automaton::changeAssignmentVariables(std::map<Variable const*, std::reference_wrapper<Variable const>> const& remapping) {
457 for (auto& location : locations) {
458 location.changeAssignmentVariables(remapping);
459 }
460 edges.changeAssignmentVariables(remapping);
461}
462
463void Automaton::finalize(Model const& containingModel) {
464 // simplifyIndexedAssignments();
465 edges.finalize(containingModel);
466}
467
468bool Automaton::containsVariablesOnlyInProbabilitiesOrTransientAssignments(std::set<storm::expressions::Variable> const& variables) const {
469 // Check initial states restriction expression.
470 if (this->hasInitialStatesRestriction()) {
471 if (this->getInitialStatesRestriction().containsVariable(variables)) {
472 return false;
473 }
474 }
475
476 // Check global variable definitions.
477 if (this->getVariables().containsVariablesInBoundExpressionsOrInitialValues(variables)) {
478 return false;
479 }
480
481 // Check edges.
482 for (auto const& edge : edges) {
483 if (edge.usesVariablesInNonTransientAssignments(variables)) {
484 return false;
485 }
486 }
487
488 return true;
489}
490
494
496 std::set<std::shared_ptr<storm::jani::TemplateEdge>> encounteredTemplateEdges;
497
498 for (uint64_t locationIndex = 0; locationIndex < locations.size(); ++locationIndex) {
499 auto& location = locations[locationIndex];
500 auto edges = this->getEdgesFromLocation(locationIndex);
501
502 storm::jani::Location newLocation(location.getName());
503 bool createNewLocation = true;
504 for (auto& edge : edges) {
505 STORM_LOG_THROW(encounteredTemplateEdges.find(edge.getTemplateEdge()) == encounteredTemplateEdges.end(), storm::exceptions::NotSupportedException,
506 "Pushing location assignments to edges is only supported for automata with unique template edges.");
507
508 auto& templateEdge = edge.getTemplateEdge();
509 encounteredTemplateEdges.insert(templateEdge);
510
511 for (auto const& assignment : location.getAssignments().getTransientAssignments()) {
512 auto const& var = assignment.getVariable();
513 if (var.isTransient() && var.getType().isBasicType() && var.getType().asBasicType().isRealType()) {
514 templateEdge->addTransientAssignment(assignment, true);
515 } else if (createNewLocation) {
516 newLocation.addTransientAssignment(assignment);
517 }
518 }
519
520 if (createNewLocation) {
521 createNewLocation = false;
522 }
523 }
524
525 location = std::move(newLocation);
526 }
527}
528
530 for (auto const& edge : this->getEdges()) {
531 if (edge.hasTransientEdgeDestinationAssignments()) {
532 return true;
533 }
534 }
535 return false;
536}
537
541
543 assert(locationToStartingIndex.size() == locations.size() + 1);
544 for (uint64_t i = 0; i < locations.size(); i++) {
545 assert(locationToStartingIndex[i] <= locationToStartingIndex[i + 1]);
546 }
547 return true;
548}
549
550bool Automaton::usesAssignmentLevels(bool onlyTransient) const {
551 return edges.usesAssignmentLevels(onlyTransient);
552}
553
555 bool result = true;
556
557 for (auto const& location : this->getLocations()) {
558 result &= location.isLinear();
559 }
560 if (result) {
561 result &= edges.isLinear();
562 }
563 return result;
564}
565
567 std::vector<Edge> oldEdges = this->edges.getConcreteEdges();
568
569 this->edges.clearConcreteEdges();
570 actionIndices.clear();
571 for (auto& e : locationToStartingIndex) {
572 e = 0;
573 }
574
575 for (auto const& index : edgeIndices) {
576 this->addEdge(oldEdges[index]);
577 }
578}
579
580void Automaton::writeDotToStream(std::ostream& outStream, std::vector<std::string> const& actionNames) const {
581 outStream << "\tsubgraph " << name << " {\n";
582
583 // Write all locations to the stream.
584 uint64_t locIndex = 0;
585 for (auto const& loc : locations) {
586 outStream << "\t" << name << "_s" << locIndex << "[ label=\"" << loc.getName() << "\"];\n";
587 ++locIndex;
588 }
589 // Write for each edge an node to the stream;
590 uint64_t edgeIndex = 0;
591 for (auto const& edge : edges) {
592 outStream << "\t" << name << "_e" << edgeIndex << "[ label=\"\" , shape=circle, width=.2, style=filled, fillcolor=\"black\"];\n";
593 ++edgeIndex;
594
595 // Silencing unused variable warning.
596 (void)edge;
597 }
598
599 // Connect edges
600 edgeIndex = 0;
601 for (auto const& edge : edges) {
602 outStream << "\t" << name << "_s" << edge.getSourceLocationIndex() << " -> " << name << "_e" << edgeIndex << " [label=\""
603 << actionNames.at(edge.getActionIndex()) << "\"];\n";
604 for (auto const& edgeDest : edge.getDestinations()) {
605 outStream << "\t" << name << "_e" << edgeIndex << " -> " << name << "_s" << edgeDest.getLocationIndex() << ";\n";
606 }
607 ++edgeIndex;
608 }
609
610 outStream << "\t}\n";
611}
612} // namespace jani
613} // 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.
void changeAssignmentVariables(std::map< Variable const *, std::reference_wrapper< Variable const > > const &remapping)
std::set< uint64_t > getActionIndices() const
void insertEdge(Edge const &e, uint64_t locStart, uint64_t locEnd)
Insert an edge, then sort the range between locstart and locend according to the action index.
void finalize(Model const &containingModel)
std::vector< Edge > const & getConcreteEdges() const
void insertTemplateEdge(std::shared_ptr< TemplateEdge > const &te)
bool usesAssignmentLevels(bool onlyTransient=false) const
void liftTransientDestinationAssignments(int64_t maxLevel=0)
void substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution, bool const substituteTranscendentalNumbers)
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
detail::Variables< Variable > getBoundedIntegerVariables()
Retrieves the bounded integer variables in this set.
Variable const & addVariable(Variable const &variable)
Adds the given variable to this set.
bool hasVariable(std::string const &name) const
Retrieves whether this variable set contains a variable with the given name.
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.
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
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
LabParser.cpp.
Definition cli.cpp:18