Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Location.cpp
Go to the documentation of this file.
2
7
8namespace storm {
9namespace jani {
10
11Location::Location(std::string const& name, std::vector<Assignment> const& transientAssignments) : name(name), assignments(transientAssignments) {
12 // Intentionally left empty.
13}
14
15Location::Location(std::string const& name, OrderedAssignments const& assignments) : name(name), assignments(assignments) {
16 // Intentionally left empty.
17}
18
19std::string const& Location::getName() const {
20 return name;
21}
22
24 return assignments;
25}
26
28 return assignments;
29}
30
32 STORM_LOG_THROW(assignment.isTransient(), storm::exceptions::InvalidArgumentException, "Must not add non-transient assignment to location.");
33 assignments.add(assignment);
34}
35
37 return timeProgressInvariant.isInitialized();
38}
39
41 return timeProgressInvariant;
42}
43
45 timeProgressInvariant = expression;
46}
47
48void Location::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution,
49 bool const substituteTranscendentalNumbers) {
50 for (auto& assignment : assignments) {
51 assignment.substitute(substitution, substituteTranscendentalNumbers);
52 }
54 setTimeProgressInvariant(substituteJaniExpression(getTimeProgressInvariant(), substitution, substituteTranscendentalNumbers));
55 }
56}
57
58void Location::changeAssignmentVariables(std::map<Variable const*, std::reference_wrapper<Variable const>> const& remapping) {
59 assignments.changeAssignmentVariables(remapping);
60}
61
63 // Intentionally left empty.
64}
65
66bool Location::isLinear() const {
67 return assignments.areLinear();
68}
69
70} // namespace jani
71} // namespace storm
Expression substitute(std::map< Variable, Expression > const &variableToExpressionMap) const
Substitutes all occurrences of the variables according to the given map.
bool isInitialized() const
Checks whether the object encapsulates a base-expression.
bool isTransient() const
Retrieves whether the assignment assigns to a transient variable.
bool isLinear() const
Checks the automaton for linearity.
Definition Location.cpp:66
Location(std::string const &name, std::vector< Assignment > const &transientAssignments={})
Creates a new location.
Definition Location.cpp:11
void addTransientAssignment(storm::jani::Assignment const &assignment)
Adds the given transient assignment to this location.
Definition Location.cpp:31
OrderedAssignments const & getAssignments() const
Retrieves the assignments of this location.
Definition Location.cpp:23
void setTimeProgressInvariant(storm::expressions::Expression const &expression)
Sets the time progress invariant of this location.
Definition Location.cpp:44
void checkValid() const
Checks whether the location is valid, that is, whether the assignments are indeed all transient assig...
Definition Location.cpp:62
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.
Definition Location.cpp:48
std::string const & getName() const
Retrieves the name of the location.
Definition Location.cpp:19
void changeAssignmentVariables(std::map< Variable const *, std::reference_wrapper< Variable const > > const &remapping)
Changes all variables in assignments based on the given mapping.
Definition Location.cpp:58
storm::expressions::Expression const & getTimeProgressInvariant() const
Retrieves the time progress invariant.
Definition Location.cpp:40
bool hasTimeProgressInvariant() const
Retrieves whether a time progress invariant is attached to this location.
Definition Location.cpp:36
void changeAssignmentVariables(std::map< Variable const *, std::reference_wrapper< Variable const > > const &remapping)
Changes all variables in assignments based on the given mapping.
bool areLinear() const
Checks the assignments for linearity.
bool add(Assignment const &assignment, bool addToExisting=false)
Adds the given assignment to the set of assignments.
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
storm::expressions::Expression substituteJaniExpression(storm::expressions::Expression const &expression, std::map< storm::expressions::Variable, storm::expressions::Expression > const &identifierToExpressionMap, bool const substituteTranscendentalNumbers)
LabParser.cpp.
Definition cli.cpp:18