1#ifndef STORM_STORAGE_PRISM_MODULE_H_
2#define STORM_STORAGE_PRISM_MODULE_H_
34 Module(std::string
const& moduleName, std::vector<storm::prism::BooleanVariable>
const& booleanVariables,
35 std::vector<storm::prism::IntegerVariable>
const& integerVariables, std::vector<storm::prism::ClockVariable>
const& clockVariables,
37 uint_fast64_t lineNumber = 0);
54 Module(std::string
const& moduleName, std::vector<storm::prism::BooleanVariable>
const& booleanVariables,
55 std::vector<storm::prism::IntegerVariable>
const& integerVariables, std::vector<storm::prism::ClockVariable>
const& clockVariables,
179 std::vector<storm::prism::Command>
const&
getCommands()
const;
193 std::string
const&
getName()
const;
231 std::map<std::string, std::string>
const&
getRenaming()
const;
263 Module substitute(std::map<storm::expressions::Variable, storm::expressions::Expression>
const& substitution)
const;
279 Module labelUnlabelledCommands(std::map<uint64_t, std::string>
const& suggestions, uint64_t& newId, std::map<std::string, uint64_t>& nameToIdMapping)
const;
315 friend std::ostream&
operator<<(std::ostream& stream,
Module const& module);
321 void createMappings();
324 std::string moduleName;
327 std::vector<storm::prism::BooleanVariable> booleanVariables;
330 std::map<std::string, uint_fast64_t> booleanVariableToIndexMap;
333 std::vector<storm::prism::IntegerVariable> integerVariables;
336 std::map<std::string, uint_fast64_t> integerVariableToIndexMap;
339 std::vector<storm::prism::ClockVariable> clockVariables;
342 std::map<std::string, uint_fast64_t> clockVariableToIndexMap;
348 std::vector<storm::prism::Command> commands;
351 std::set<uint_fast64_t> synchronizingActionIndices;
354 std::map<uint_fast64_t, std::set<uint_fast64_t>> actionIndicesToCommandIndexMap;
357 std::string renamedFromModule;
Module substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all variables in the module according to the given map.
std::size_t getNumberOfBooleanVariables() const
Retrieves the number of boolean variables in the module.
uint64_t getNumberOfUnlabeledCommands() const
void createMissingInitialValues()
Equips all of the modules' variables without initial values with initial values based on their type.
bool containsVariablesOnlyInUpdateProbabilities(std::set< storm::expressions::Variable > const &undefinedConstantVariables) const
Checks whether the given variables only appear in the update probabilities of the module and nowhere ...
Module(Module &&other)=default
Module(Module const &other)=default
std::vector< storm::prism::Command > const & getCommands() const
Retrieves the commands of the module.
std::map< std::string, std::string > const & getRenaming() const
If the module was created via renaming, this method returns the applied renaming of identifiers used ...
storm::prism::Command const & getCommand(uint_fast64_t index) const
Retrieves a reference to the command with the given index.
Module & operator=(Module const &other)=default
storm::prism::ClockVariable const & getClockVariable(std::string const &variableName) const
Retrieves a reference to the clock variable with the given name.
std::string const & getBaseModule() const
If the module was created via renaming, this method retrieves the name of the module that was used as...
bool hasActionIndex(uint_fast64_t actionIndex) const
Retrieves whether or not this module contains a command labeled with the given action index.
Module substituteNonStandardPredicates() const
Nonstandard predicates such as ExacltyOneOff etc can be substituted.
void removeVariableInitialization()
Auxiliary function for Program::replaceVariableInitializationByInitExpression Effect: All of the modu...
std::vector< storm::prism::IntegerVariable > const & getIntegerVariables() const
Retrieves the integer variables of the module.
storm::prism::IntegerVariable const & getIntegerVariable(std::string const &variableName) const
Retrieves a reference to the integer variable with the given name.
friend std::ostream & operator<<(std::ostream &stream, Module const &module)
std::set< uint_fast64_t > const & getCommandIndicesByActionIndex(uint_fast64_t actionIndex) const
Retrieves the indices of all commands within this module that are labelled by the given action.
Module restrictCommands(storm::storage::FlatSet< uint_fast64_t > const &indexSet) const
Creates a new module that drops all commands whose indices are not in the given set.
std::vector< storm::prism::BooleanVariable > const & getBooleanVariables() const
Retrieves the boolean variables of the module.
std::size_t getNumberOfClockVariables() const
Retrieves the number of clock variables in the module.
storm::expressions::Expression const & getInvariant() const
Returns the specified invariant (only relevant for PTA models)
bool isRenamedFromModule() const
Retrieves whether this module was created from another module via renaming.
bool hasInvariant() const
Returns true, if an invariant was specified (only relevant for PTA models)
Module labelUnlabelledCommands(std::map< uint64_t, std::string > const &suggestions, uint64_t &newId, std::map< std::string, uint64_t > &nameToIdMapping) const
Label unlabelled commands.
Module & operator=(Module &&other)=default
bool hasUnboundedVariables() const
std::string const & getName() const
Retrieves the name of the module.
std::set< storm::expressions::Variable > getAllExpressionVariables() const
Retrieves all expression variables used by this module.
std::size_t getNumberOfUpdates() const
Retrieves the total number of updates of this module.
std::set< uint_fast64_t > const & getSynchronizingActionIndices() const
Retrieves the set of synchronizing action indices present in this module.
std::vector< storm::prism::ClockVariable > const & getClockVariables() const
Retrieves the clock variables of the module.
Module restrictActionIndices(storm::storage::FlatSet< uint_fast64_t > const &actionIndices) const
Creates a new module that drops all commands whose action indices are not in the given set.
std::size_t getNumberOfIntegerVariables() const
Retrieves the number of integer variables in the module.
std::size_t getNumberOfCommands() const
Retrieves the number of commands of this module.
storm::prism::BooleanVariable const & getBooleanVariable(std::string const &variableName) const
Retrieves a reference to the boolean variable with the given name.
std::vector< storm::expressions::Expression > getAllRangeExpressions() const
Retrieves a list of expressions that characterize the legal ranges of all variables declared by this ...
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.