27 this->modelDescription = model;
32 this->modelDescription = program;
37 return static_cast<bool>(modelDescription);
41 return modelDescription.get().which() == 0;
45 return modelDescription.get().which() == 1;
61 STORM_LOG_THROW(
false, storm::exceptions::InvalidTypeException,
"Expected other JANI model type.");
79 STORM_LOG_THROW(
false, storm::exceptions::InvalidTypeException,
"Expected other PRISM model type.");
93 modelDescription = model;
97 modelDescription = program;
102 "Cannot retrieve JANI model, because the symbolic description has a different type.");
103 return boost::get<storm::jani::Model>(modelDescription.get());
108 "Cannot retrieve JANI model, because the symbolic description has a different type.");
109 return boost::get<storm::jani::Model>(modelDescription.get());
114 "Cannot retrieve JANI model, because the symbolic description has a different type.");
115 return boost::get<storm::prism::Program>(modelDescription.get());
120 "Cannot retrieve JANI model, because the symbolic description has a different type.");
121 return boost::get<storm::prism::Program>(modelDescription.get());
125 std::vector<std::string> result;
128 result.push_back(c.get().getName());
132 result.push_back(c.get().getName());
145 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot transform model description to the JANI format.");
150 bool makeVariablesGlobal)
const {
152 return std::make_pair(*
this, std::vector<storm::jani::Property>());
158 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Cannot transform model description to the JANI format.");
163 std::map<storm::expressions::Variable, storm::expressions::Expression> substitution =
parseConstantDefinitions(constantDefinitionString);
168 std::map<storm::expressions::Variable, storm::expressions::Expression>
const& constantDefinitions)
const {
176 this->
asPrismProgram().defineUndefinedConstants(constantDefinitions).substituteConstantsFormulas().substituteNonStandardPredicates());
182 std::string
const& constantDefinitionString)
const {
207 std::vector<storm::expressions::Variable> result;
210 for (
auto const& constant : constants) {
211 result.emplace_back(constant.get().getExpressionVariable());
215 for (
auto const& constant : constants) {
216 result.emplace_back(constant.get().getExpressionVariable());
228 out <<
"unkown symbolic model description";
This class is responsible for managing a set of typed variables and all expressions using these varia...
bool hasUndefinedConstants() const
Retrieves whether the model still has undefined constants.
storm::expressions::ExpressionManager & getManager() const
Retrieves the expression manager responsible for the expressions in the model.
ModelType const & getModelType() const
Retrieves the type of the model.
Model substituteConstants() const
Substitutes all constants in all expressions of the model.
Model defineUndefinedConstants(std::map< storm::expressions::Variable, storm::expressions::Expression > const &constantDefinitions) const
Defines the undefined constants of the model by the given expressions.
std::vector< std::reference_wrapper< Constant const > > getUndefinedConstants() const
Retrieves all undefined constants of the model.
ModelType getModelType() const
Retrieves the model type of the model.
std::vector< std::reference_wrapper< Constant const > > getUndefinedConstants() const
Retrieves the undefined constants in the program.
storm::expressions::ExpressionManager & getManager() const
Retrieves the manager responsible for the expressions of this program.
bool hasUndefinedConstants() const
Retrieves whether there are undefined constants of any type in the program.
storm::jani::Model toJani(bool allVariablesGlobal=true, std::string suffix="") const
Converts the PRISM model into an equivalent JANI model.
std::map< storm::expressions::Variable, storm::expressions::Expression > parseConstantDefinitions(std::string const &constantDefinitionString) const
SymbolicModelDescription & operator=(storm::jani::Model const &model)
storm::prism::Program const & asPrismProgram() const
std::vector< storm::expressions::Variable > getUndefinedConstants() const
bool hasUndefinedConstants() const
void requireNoUndefinedConstants() const
ModelType getModelType() const
storm::expressions::ExpressionManager & getManager() const
SymbolicModelDescription()=default
std::vector< std::string > getParameterNames() const
SymbolicModelDescription toJani(bool makeVariablesGlobal=true) const
void setModel(storm::jani::Model const &model)
bool isPrismProgram() const
storm::jani::Model const & asJaniModel() const
SymbolicModelDescription preprocess(std::string const &constantDefinitionString="") const
#define STORM_LOG_THROW(cond, exception, message)
std::ostream & operator<<(std::ostream &out, ParameterRegion< ParametricType > const ®ion)
std::map< storm::expressions::Variable, storm::expressions::Expression > parseConstantDefinitionString(storm::expressions::ExpressionManager const &manager, std::string const &constantDefinitionString)
void requireNoUndefinedConstants(storm::jani::Model const &model)
void requireNoUndefinedConstants(storm::prism::Program const &program)