Storm
A Modern Probabilistic Model Checker
|
#include <Automaton.h>
Public Types | |
typedef detail::Edges | Edges |
typedef detail::ConstEdges | ConstEdges |
Public Member Functions | |
Automaton (std::string const &name, storm::expressions::Variable const &locationExpressionVariable) | |
Creates an empty automaton. | |
Automaton (Automaton const &other)=default | |
Automaton & | operator= (Automaton const &other)=default |
Automaton (Automaton &&other)=default | |
Automaton & | operator= (Automaton &&other)=default |
Automaton | clone (storm::expressions::ExpressionManager &manager, std::string const &nameOfClone, std::string const &variablePrefix) const |
std::string const & | getName () const |
Retrieves the name of the automaton. | |
Variable const & | addVariable (Variable const &variable) |
Adds the given variable to this automaton. | |
VariableSet & | getVariables () |
Retrieves the variables of this automaton. | |
VariableSet const & | getVariables () const |
Retrieves the variables of this automaton. | |
bool | hasVariable (std::string const &name) const |
std::set< storm::expressions::Variable > | getAllExpressionVariables () const |
Retrieves all expression variables used by this automaton. | |
bool | hasTransientVariable () const |
Retrieves whether this automaton has a transient variable. | |
FunctionDefinition const & | addFunctionDefinition (FunctionDefinition const &functionDefinition) |
Adds the given function definition. | |
std::unordered_map< std::string, FunctionDefinition > const & | getFunctionDefinitions () const |
Retrieves all function definitions of this automaton. | |
std::unordered_map< std::string, FunctionDefinition > & | getFunctionDefinitions () |
Retrieves all function definitions of this automaton. | |
bool | hasLocation (std::string const &name) const |
Retrieves whether the automaton has a location with the given name. | |
Friends | |
class | detail::Edges |
class | detail::ConstEdges |
the name of the location | |
Get location id for a location with a given name. Yields undefined behaviour if no such location exists; | |
uint64_t | getLocationIndex (std::string const &name) const |
std::vector< Location > const & | getLocations () const |
Retrieves the locations of the automaton. | |
std::vector< Location > & | getLocations () |
Retrieves the locations of the automaton. | |
Location const & | getLocation (uint64_t index) const |
Retrieves the location with the given index. | |
Location & | getLocation (uint64_t index) |
Retrieves the location with the given index. | |
uint64_t | addLocation (Location const &location) |
Adds the given location to the automaton. | |
void | addInitialLocation (std::string const &name) |
Adds the location with the given name to the initial locations. | |
void | addInitialLocation (uint64_t index) |
Adds the location with the given index to the initial locations. | |
std::set< uint64_t > const & | getInitialLocationIndices () const |
Retrieves the indices of the initial locations. | |
std::map< uint64_t, std::string > | buildIdToLocationNameMap () const |
Builds a map from ID to Location Name. | |
storm::expressions::Variable const & | getLocationExpressionVariable () const |
Retrieves the expression variable that represents the location of this automaton. | |
Edge const & | getEdge (uint64_t index) const |
Retrieves the edge with the given index in this automaton. | |
Edges | getEdgesFromLocation (std::string const &name) |
Retrieves the edges of the location with the given name. | |
Edges | getEdgesFromLocation (uint64_t index) |
Retrieves the edges of the location with the given index. | |
ConstEdges | getEdgesFromLocation (std::string const &name) const |
Retrieves the edges of the location with the given name. | |
ConstEdges | getEdgesFromLocation (uint64_t index) const |
Retrieves the edges of the location with the given index. | |
Edges | getEdgesFromLocation (uint64_t locationIndex, uint64_t actionIndex) |
Retrieves the edges of the location with the given index labeled with the given action index. | |
ConstEdges | getEdgesFromLocation (uint64_t locationIndex, uint64_t actionIndex) const |
Retrieves the edges of the location with the given index. | |
EdgeContainer const & | getEdgeContainer () const |
Retrieves the container of all edges of this automaton. | |
EdgeContainer & | getEdgeContainer () |
Retrieves the container of all edges of this automaton. | |
void | registerTemplateEdge (std::shared_ptr< TemplateEdge > const &) |
Adds the template edge to the list of edges. | |
void | addEdge (Edge const &edge) |
Adds an edge to the automaton. | |
bool | validate () const |
std::vector< Edge > & | getEdges () |
Retrieves the edges of the automaton. | |
std::vector< Edge > const & | getEdges () const |
Retrieves the edges of the automaton. | |
std::set< uint64_t > | getActionIndices () const |
Retrieves the set of action indices that are labels of edges of this automaton. | |
uint64_t | getNumberOfLocations () const |
Retrieves the number of locations. | |
uint64_t | getNumberOfEdges () const |
Retrieves the number of edges. | |
bool | hasRestrictedInitialStates () const |
Retrieves whether the initial restriction is set and unequal to true. | |
bool | hasInitialStatesRestriction () const |
Retrieves whether this automaton has an initial states restriction. | |
bool | hasNonTrivialInitialStates () const |
Retrieves whether this automaton has non-trivial initial states. | |
storm::expressions::Expression const & | getInitialStatesRestriction () const |
Gets the expression restricting the legal initial values of the automaton's variables. | |
void | setInitialStatesRestriction (storm::expressions::Expression const &initialStatesRestriction) |
Sets the expression restricting the legal initial values of the automaton's variables. | |
storm::expressions::Expression | getInitialStatesExpression () const |
Retrieves the expression defining the legal initial values of the automaton's variables. | |
bool | hasTrivialInitialStatesExpression () const |
Retrieves whether the initial states expression is trivial in the sense that the automaton has no initial states restriction and all non-transient variables have initial values. | |
bool | hasEdgeLabeledWithActionIndex (uint64_t actionIndex) const |
Retrieves whether there is an edge labeled with the action with the given index in this automaton. | |
std::vector< storm::expressions::Expression > | getAllRangeExpressions () const |
Retrieves a list of expressions that characterize the legal values of the variables in this automaton. | |
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. | |
void | finalize (Model const &containingModel) |
Finalizes the building of this automaton. | |
std::set< uint64_t > | getUsedActionIndices () const |
Retrieves the action indices appearing at some edge of the automaton. | |
bool | containsVariablesOnlyInProbabilitiesOrTransientAssignments (std::set< storm::expressions::Variable > const &variables) const |
Checks whether the provided variables only appear in the probability expressions or the expressions being assigned in transient assignments. | |
void | pushEdgeAssignmentsToDestinations () |
Pushes the edge assignments to the corresponding destinations. | |
void | pushTransientRealLocationAssignmentsToEdges () |
Pushes the assignments to real-valued transient variables to the edges. | |
bool | hasTransientEdgeDestinationAssignments () const |
Retrieves whether there is any transient edge destination assignment in the automaton. | |
void | liftTransientEdgeDestinationAssignments (int64_t maxLevel=0) |
Lifts the common edge destination assignments to edge assignments. | |
bool | usesAssignmentLevels (bool onlyTransient=false) const |
Retrieves whether the automaton uses an assignment level other than zero. | |
void | simplifyIndexedAssignments () |
bool | isLinear () const |
Checks the automaton for linearity. | |
void | writeDotToStream (std::ostream &outStream, std::vector< std::string > const &actionNames) const |
void | restrictToEdges (storm::storage::FlatSet< uint_fast64_t > const &edgeIndices) |
Restricts the automaton to the edges given by the indices. | |
Definition at line 24 of file Automaton.h.
Definition at line 30 of file Automaton.h.
Definition at line 29 of file Automaton.h.
storm::jani::Automaton::Automaton | ( | std::string const & | name, |
storm::expressions::Variable const & | locationExpressionVariable | ||
) |
Creates an empty automaton.
Definition at line 19 of file Automaton.cpp.
|
default |
|
default |
void storm::jani::Automaton::addEdge | ( | Edge const & | edge | ) |
Adds an edge to the automaton.
Definition at line 297 of file Automaton.cpp.
FunctionDefinition const & storm::jani::Automaton::addFunctionDefinition | ( | FunctionDefinition const & | functionDefinition | ) |
Adds the given function definition.
Definition at line 79 of file Automaton.cpp.
void storm::jani::Automaton::addInitialLocation | ( | std::string const & | name | ) |
Adds the location with the given name to the initial locations.
Definition at line 128 of file Automaton.cpp.
void storm::jani::Automaton::addInitialLocation | ( | uint64_t | index | ) |
Adds the location with the given index to the initial locations.
Definition at line 135 of file Automaton.cpp.
uint64_t storm::jani::Automaton::addLocation | ( | Location const & | location | ) |
Adds the given location to the automaton.
Definition at line 114 of file Automaton.cpp.
Adds the given variable to this automaton.
Definition at line 51 of file Automaton.cpp.
std::map< uint64_t, std::string > storm::jani::Automaton::buildIdToLocationNameMap | ( | ) | const |
Builds a map from ID to Location Name.
Definition at line 145 of file Automaton.cpp.
void storm::jani::Automaton::changeAssignmentVariables | ( | std::map< Variable const *, std::reference_wrapper< Variable const > > const & | remapping | ) |
Changes all variables in assignments based on the given mapping.
Definition at line 456 of file Automaton.cpp.
Automaton storm::jani::Automaton::clone | ( | storm::expressions::ExpressionManager & | manager, |
std::string const & | nameOfClone, | ||
std::string const & | variablePrefix | ||
) | const |
Definition at line 31 of file Automaton.cpp.
bool storm::jani::Automaton::containsVariablesOnlyInProbabilitiesOrTransientAssignments | ( | std::set< storm::expressions::Variable > const & | variables | ) | const |
Checks whether the provided variables only appear in the probability expressions or the expressions being assigned in transient assignments.
Definition at line 468 of file Automaton.cpp.
void storm::jani::Automaton::finalize | ( | Model const & | containingModel | ) |
Finalizes the building of this automaton.
Subsequent changes to the automaton require another call to this method. Note that this method is invoked by a call to finalize
to the containing model.
Definition at line 463 of file Automaton.cpp.
std::set< uint64_t > storm::jani::Automaton::getActionIndices | ( | ) | const |
Retrieves the set of action indices that are labels of edges of this automaton.
Definition at line 320 of file Automaton.cpp.
std::set< storm::expressions::Variable > storm::jani::Automaton::getAllExpressionVariables | ( | ) | const |
Retrieves all expression variables used by this automaton.
Definition at line 67 of file Automaton.cpp.
std::vector< storm::expressions::Expression > storm::jani::Automaton::getAllRangeExpressions | ( | ) | const |
Retrieves a list of expressions that characterize the legal values of the variables in this automaton.
Definition at line 426 of file Automaton.cpp.
Edge const & storm::jani::Automaton::getEdge | ( | uint64_t | index | ) | const |
Retrieves the edge with the given index in this automaton.
Definition at line 159 of file Automaton.cpp.
EdgeContainer & storm::jani::Automaton::getEdgeContainer | ( | ) |
Retrieves the container of all edges of this automaton.
Definition at line 293 of file Automaton.cpp.
EdgeContainer const & storm::jani::Automaton::getEdgeContainer | ( | ) | const |
Retrieves the container of all edges of this automaton.
Definition at line 289 of file Automaton.cpp.
std::vector< Edge > & storm::jani::Automaton::getEdges | ( | ) |
Retrieves the edges of the automaton.
Definition at line 312 of file Automaton.cpp.
std::vector< Edge > const & storm::jani::Automaton::getEdges | ( | ) | const |
Retrieves the edges of the automaton.
Definition at line 316 of file Automaton.cpp.
Automaton::Edges storm::jani::Automaton::getEdgesFromLocation | ( | std::string const & | name | ) |
Retrieves the edges of the location with the given name.
Definition at line 163 of file Automaton.cpp.
Automaton::ConstEdges storm::jani::Automaton::getEdgesFromLocation | ( | std::string const & | name | ) | const |
Retrieves the edges of the location with the given name.
Definition at line 177 of file Automaton.cpp.
Automaton::Edges storm::jani::Automaton::getEdgesFromLocation | ( | uint64_t | index | ) |
Retrieves the edges of the location with the given index.
Definition at line 169 of file Automaton.cpp.
Automaton::ConstEdges storm::jani::Automaton::getEdgesFromLocation | ( | uint64_t | index | ) | const |
Retrieves the edges of the location with the given index.
Definition at line 183 of file Automaton.cpp.
Automaton::Edges storm::jani::Automaton::getEdgesFromLocation | ( | uint64_t | locationIndex, |
uint64_t | actionIndex | ||
) |
Retrieves the edges of the location with the given index labeled with the given action index.
Definition at line 191 of file Automaton.cpp.
Automaton::ConstEdges storm::jani::Automaton::getEdgesFromLocation | ( | uint64_t | locationIndex, |
uint64_t | actionIndex | ||
) | const |
Retrieves the edges of the location with the given index.
Definition at line 240 of file Automaton.cpp.
std::unordered_map< std::string, FunctionDefinition > & storm::jani::Automaton::getFunctionDefinitions | ( | ) |
Retrieves all function definitions of this automaton.
Definition at line 90 of file Automaton.cpp.
std::unordered_map< std::string, FunctionDefinition > const & storm::jani::Automaton::getFunctionDefinitions | ( | ) | const |
Retrieves all function definitions of this automaton.
Definition at line 86 of file Automaton.cpp.
std::set< uint64_t > const & storm::jani::Automaton::getInitialLocationIndices | ( | ) | const |
Retrieves the indices of the initial locations.
Definition at line 141 of file Automaton.cpp.
storm::expressions::Expression storm::jani::Automaton::getInitialStatesExpression | ( | ) | const |
Retrieves the expression defining the legal initial values of the automaton's variables.
Definition at line 369 of file Automaton.cpp.
storm::expressions::Expression const & storm::jani::Automaton::getInitialStatesRestriction | ( | ) | const |
Gets the expression restricting the legal initial values of the automaton's variables.
Definition at line 361 of file Automaton.cpp.
Location & storm::jani::Automaton::getLocation | ( | uint64_t | index | ) |
Retrieves the location with the given index.
Definition at line 110 of file Automaton.cpp.
Location const & storm::jani::Automaton::getLocation | ( | uint64_t | index | ) | const |
Retrieves the location with the given index.
Definition at line 106 of file Automaton.cpp.
storm::expressions::Variable const & storm::jani::Automaton::getLocationExpressionVariable | ( | ) | const |
Retrieves the expression variable that represents the location of this automaton.
Definition at line 155 of file Automaton.cpp.
uint64_t storm::jani::Automaton::getLocationIndex | ( | std::string const & | name | ) | const |
Definition at line 123 of file Automaton.cpp.
std::vector< Location > & storm::jani::Automaton::getLocations | ( | ) |
Retrieves the locations of the automaton.
Definition at line 102 of file Automaton.cpp.
std::vector< Location > const & storm::jani::Automaton::getLocations | ( | ) | const |
Retrieves the locations of the automaton.
Definition at line 98 of file Automaton.cpp.
std::string const & storm::jani::Automaton::getName | ( | ) | const |
Retrieves the name of the automaton.
Definition at line 47 of file Automaton.cpp.
uint64_t storm::jani::Automaton::getNumberOfEdges | ( | ) | const |
Retrieves the number of edges.
Definition at line 328 of file Automaton.cpp.
uint64_t storm::jani::Automaton::getNumberOfLocations | ( | ) | const |
Retrieves the number of locations.
Definition at line 324 of file Automaton.cpp.
std::set< uint64_t > storm::jani::Automaton::getUsedActionIndices | ( | ) | const |
Retrieves the action indices appearing at some edge of the automaton.
VariableSet & storm::jani::Automaton::getVariables | ( | ) |
Retrieves the variables of this automaton.
Definition at line 59 of file Automaton.cpp.
VariableSet const & storm::jani::Automaton::getVariables | ( | ) | const |
Retrieves the variables of this automaton.
Definition at line 63 of file Automaton.cpp.
bool storm::jani::Automaton::hasEdgeLabeledWithActionIndex | ( | uint64_t | actionIndex | ) | const |
Retrieves whether there is an edge labeled with the action with the given index in this automaton.
Definition at line 422 of file Automaton.cpp.
bool storm::jani::Automaton::hasInitialStatesRestriction | ( | ) | const |
Retrieves whether this automaton has an initial states restriction.
Definition at line 343 of file Automaton.cpp.
bool storm::jani::Automaton::hasLocation | ( | std::string const & | name | ) | const |
Retrieves whether the automaton has a location with the given name.
Definition at line 94 of file Automaton.cpp.
bool storm::jani::Automaton::hasNonTrivialInitialStates | ( | ) | const |
Retrieves whether this automaton has non-trivial initial states.
Definition at line 347 of file Automaton.cpp.
bool storm::jani::Automaton::hasRestrictedInitialStates | ( | ) | const |
Retrieves whether the initial restriction is set and unequal to true.
Definition at line 332 of file Automaton.cpp.
bool storm::jani::Automaton::hasTransientEdgeDestinationAssignments | ( | ) | const |
Retrieves whether there is any transient edge destination assignment in the automaton.
Definition at line 529 of file Automaton.cpp.
bool storm::jani::Automaton::hasTransientVariable | ( | ) | const |
Retrieves whether this automaton has a transient variable.
Definition at line 75 of file Automaton.cpp.
bool storm::jani::Automaton::hasTrivialInitialStatesExpression | ( | ) | const |
Retrieves whether the initial states expression is trivial in the sense that the automaton has no initial states restriction and all non-transient variables have initial values.
Definition at line 401 of file Automaton.cpp.
bool storm::jani::Automaton::hasVariable | ( | std::string const & | name | ) | const |
Definition at line 55 of file Automaton.cpp.
bool storm::jani::Automaton::isLinear | ( | ) | const |
Checks the automaton for linearity.
Definition at line 554 of file Automaton.cpp.
void storm::jani::Automaton::liftTransientEdgeDestinationAssignments | ( | int64_t | maxLevel = 0 | ) |
Lifts the common edge destination assignments to edge assignments.
Definition at line 538 of file Automaton.cpp.
void storm::jani::Automaton::pushEdgeAssignmentsToDestinations | ( | ) |
Pushes the edge assignments to the corresponding destinations.
Definition at line 491 of file Automaton.cpp.
void storm::jani::Automaton::pushTransientRealLocationAssignmentsToEdges | ( | ) |
Pushes the assignments to real-valued transient variables to the edges.
Note: This is currently only supported if the template edges are uniquely coupled with one source location.
Definition at line 495 of file Automaton.cpp.
void storm::jani::Automaton::registerTemplateEdge | ( | std::shared_ptr< TemplateEdge > const & | te | ) |
Adds the template edge to the list of edges.
Definition at line 452 of file Automaton.cpp.
void storm::jani::Automaton::restrictToEdges | ( | storm::storage::FlatSet< uint_fast64_t > const & | edgeIndices | ) |
Restricts the automaton to the edges given by the indices.
All other edges are deleted.
Definition at line 566 of file Automaton.cpp.
void storm::jani::Automaton::setInitialStatesRestriction | ( | storm::expressions::Expression const & | initialStatesRestriction | ) |
Sets the expression restricting the legal initial values of the automaton's variables.
Definition at line 365 of file Automaton.cpp.
void storm::jani::Automaton::simplifyIndexedAssignments | ( | ) |
void storm::jani::Automaton::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 at line 434 of file Automaton.cpp.
bool storm::jani::Automaton::usesAssignmentLevels | ( | bool | onlyTransient = false | ) | const |
Retrieves whether the automaton uses an assignment level other than zero.
Definition at line 550 of file Automaton.cpp.
bool storm::jani::Automaton::validate | ( | ) | const |
Definition at line 542 of file Automaton.cpp.
void storm::jani::Automaton::writeDotToStream | ( | std::ostream & | outStream, |
std::vector< std::string > const & | actionNames | ||
) | const |
Definition at line 580 of file Automaton.cpp.
|
friend |
Definition at line 27 of file Automaton.h.
|
friend |
Definition at line 26 of file Automaton.h.