Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::jani::Automaton Class Reference

#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
 
Automatonoperator= (Automaton const &other)=default
 
 Automaton (Automaton &&other)=default
 
Automatonoperator= (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.
 
VariableSetgetVariables ()
 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::VariablegetAllExpressionVariables () 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.
 
LocationgetLocation (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.
 
EdgeContainergetEdgeContainer ()
 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::ExpressiongetAllRangeExpressions () 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.
 

Detailed Description

Definition at line 24 of file Automaton.h.

Member Typedef Documentation

◆ ConstEdges

◆ Edges

Definition at line 29 of file Automaton.h.

Constructor & Destructor Documentation

◆ Automaton() [1/3]

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.

◆ Automaton() [2/3]

storm::jani::Automaton::Automaton ( Automaton const &  other)
default

◆ Automaton() [3/3]

storm::jani::Automaton::Automaton ( Automaton &&  other)
default

Member Function Documentation

◆ addEdge()

void storm::jani::Automaton::addEdge ( Edge const &  edge)

Adds an edge to the automaton.

Definition at line 297 of file Automaton.cpp.

◆ addFunctionDefinition()

FunctionDefinition const & storm::jani::Automaton::addFunctionDefinition ( FunctionDefinition const &  functionDefinition)

Adds the given function definition.

Definition at line 79 of file Automaton.cpp.

◆ addInitialLocation() [1/2]

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.

◆ addInitialLocation() [2/2]

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.

◆ addLocation()

uint64_t storm::jani::Automaton::addLocation ( Location const &  location)

Adds the given location to the automaton.

Definition at line 114 of file Automaton.cpp.

◆ addVariable()

Variable const & storm::jani::Automaton::addVariable ( Variable const &  variable)

Adds the given variable to this automaton.

Definition at line 51 of file Automaton.cpp.

◆ buildIdToLocationNameMap()

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.

◆ changeAssignmentVariables()

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.

◆ clone()

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.

◆ containsVariablesOnlyInProbabilitiesOrTransientAssignments()

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.

◆ finalize()

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.

◆ getActionIndices()

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.

◆ getAllExpressionVariables()

std::set< storm::expressions::Variable > storm::jani::Automaton::getAllExpressionVariables ( ) const

Retrieves all expression variables used by this automaton.

Returns
The set of expression variables used by this automaton.

Definition at line 67 of file Automaton.cpp.

◆ getAllRangeExpressions()

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.

◆ getEdge()

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.

◆ getEdgeContainer() [1/2]

EdgeContainer & storm::jani::Automaton::getEdgeContainer ( )

Retrieves the container of all edges of this automaton.

Definition at line 293 of file Automaton.cpp.

◆ getEdgeContainer() [2/2]

EdgeContainer const & storm::jani::Automaton::getEdgeContainer ( ) const

Retrieves the container of all edges of this automaton.

Definition at line 289 of file Automaton.cpp.

◆ getEdges() [1/2]

std::vector< Edge > & storm::jani::Automaton::getEdges ( )

Retrieves the edges of the automaton.

Definition at line 312 of file Automaton.cpp.

◆ getEdges() [2/2]

std::vector< Edge > const & storm::jani::Automaton::getEdges ( ) const

Retrieves the edges of the automaton.

Definition at line 316 of file Automaton.cpp.

◆ getEdgesFromLocation() [1/6]

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.

◆ getEdgesFromLocation() [2/6]

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.

◆ getEdgesFromLocation() [3/6]

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.

◆ getEdgesFromLocation() [4/6]

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.

◆ getEdgesFromLocation() [5/6]

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.

◆ getEdgesFromLocation() [6/6]

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.

◆ getFunctionDefinitions() [1/2]

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.

◆ getFunctionDefinitions() [2/2]

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.

◆ getInitialLocationIndices()

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.

◆ getInitialStatesExpression()

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.

◆ getInitialStatesRestriction()

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.

◆ getLocation() [1/2]

Location & storm::jani::Automaton::getLocation ( uint64_t  index)

Retrieves the location with the given index.

Definition at line 110 of file Automaton.cpp.

◆ getLocation() [2/2]

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.

◆ getLocationExpressionVariable()

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.

◆ getLocationIndex()

uint64_t storm::jani::Automaton::getLocationIndex ( std::string const &  name) const

Definition at line 123 of file Automaton.cpp.

◆ getLocations() [1/2]

std::vector< Location > & storm::jani::Automaton::getLocations ( )

Retrieves the locations of the automaton.

Definition at line 102 of file Automaton.cpp.

◆ getLocations() [2/2]

std::vector< Location > const & storm::jani::Automaton::getLocations ( ) const

Retrieves the locations of the automaton.

Definition at line 98 of file Automaton.cpp.

◆ getName()

std::string const & storm::jani::Automaton::getName ( ) const

Retrieves the name of the automaton.

Definition at line 47 of file Automaton.cpp.

◆ getNumberOfEdges()

uint64_t storm::jani::Automaton::getNumberOfEdges ( ) const

Retrieves the number of edges.

Definition at line 328 of file Automaton.cpp.

◆ getNumberOfLocations()

uint64_t storm::jani::Automaton::getNumberOfLocations ( ) const

Retrieves the number of locations.

Definition at line 324 of file Automaton.cpp.

◆ getUsedActionIndices()

std::set< uint64_t > storm::jani::Automaton::getUsedActionIndices ( ) const

Retrieves the action indices appearing at some edge of the automaton.

◆ getVariables() [1/2]

VariableSet & storm::jani::Automaton::getVariables ( )

Retrieves the variables of this automaton.

Definition at line 59 of file Automaton.cpp.

◆ getVariables() [2/2]

VariableSet const & storm::jani::Automaton::getVariables ( ) const

Retrieves the variables of this automaton.

Definition at line 63 of file Automaton.cpp.

◆ hasEdgeLabeledWithActionIndex()

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.

◆ hasInitialStatesRestriction()

bool storm::jani::Automaton::hasInitialStatesRestriction ( ) const

Retrieves whether this automaton has an initial states restriction.

Definition at line 343 of file Automaton.cpp.

◆ hasLocation()

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.

◆ hasNonTrivialInitialStates()

bool storm::jani::Automaton::hasNonTrivialInitialStates ( ) const

Retrieves whether this automaton has non-trivial initial states.

Definition at line 347 of file Automaton.cpp.

◆ hasRestrictedInitialStates()

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.

◆ hasTransientEdgeDestinationAssignments()

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.

◆ hasTransientVariable()

bool storm::jani::Automaton::hasTransientVariable ( ) const

Retrieves whether this automaton has a transient variable.

Definition at line 75 of file Automaton.cpp.

◆ hasTrivialInitialStatesExpression()

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.

◆ hasVariable()

bool storm::jani::Automaton::hasVariable ( std::string const &  name) const

Definition at line 55 of file Automaton.cpp.

◆ isLinear()

bool storm::jani::Automaton::isLinear ( ) const

Checks the automaton for linearity.

Definition at line 554 of file Automaton.cpp.

◆ liftTransientEdgeDestinationAssignments()

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.

◆ operator=() [1/2]

Automaton & storm::jani::Automaton::operator= ( Automaton &&  other)
default

◆ operator=() [2/2]

Automaton & storm::jani::Automaton::operator= ( Automaton const &  other)
default

◆ pushEdgeAssignmentsToDestinations()

void storm::jani::Automaton::pushEdgeAssignmentsToDestinations ( )

Pushes the edge assignments to the corresponding destinations.

Definition at line 491 of file Automaton.cpp.

◆ pushTransientRealLocationAssignmentsToEdges()

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.

◆ registerTemplateEdge()

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.

◆ restrictToEdges()

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.

◆ setInitialStatesRestriction()

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.

◆ simplifyIndexedAssignments()

void storm::jani::Automaton::simplifyIndexedAssignments ( )

◆ substitute()

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.

◆ usesAssignmentLevels()

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.

◆ validate()

bool storm::jani::Automaton::validate ( ) const

Definition at line 542 of file Automaton.cpp.

◆ writeDotToStream()

void storm::jani::Automaton::writeDotToStream ( std::ostream &  outStream,
std::vector< std::string > const &  actionNames 
) const

Definition at line 580 of file Automaton.cpp.

Friends And Related Symbol Documentation

◆ detail::ConstEdges

friend class detail::ConstEdges
friend

Definition at line 27 of file Automaton.h.

◆ detail::Edges

friend class detail::Edges
friend

Definition at line 26 of file Automaton.h.


The documentation for this class was generated from the following files: