Browse Source

substitute jani-functions during preprocessing (analogous to prism program preprocessing)

tempestpy_adaptions
TimQu 6 years ago
parent
commit
4453eb4134
  1. 2
      src/storm/storage/SymbolicModelDescription.cpp
  2. 6
      src/storm/storage/jani/Model.cpp
  3. 6
      src/storm/storage/jani/Model.h

2
src/storm/storage/SymbolicModelDescription.cpp

@ -149,7 +149,7 @@ namespace storm {
SymbolicModelDescription SymbolicModelDescription::preprocess(std::map<storm::expressions::Variable, storm::expressions::Expression> const& constantDefinitions) const {
if (this->isJaniModel()) {
storm::jani::Model preparedModel = this->asJaniModel().defineUndefinedConstants(constantDefinitions).substituteConstants();
storm::jani::Model preparedModel = this->asJaniModel().defineUndefinedConstants(constantDefinitions).substituteConstantsFunctions();
return SymbolicModelDescription(preparedModel);
} else if (this->isPrismProgram()) {
return SymbolicModelDescription(this->asPrismProgram().defineUndefinedConstants(constantDefinitions).substituteConstantsFormulas());

6
src/storm/storage/jani/Model.cpp

@ -951,6 +951,12 @@ namespace storm {
return result;
}
Model Model::substituteConstantsFunctions() const {
auto result = substituteConstants();
result.substituteFunctions();
return result;
}
std::map<storm::expressions::Variable, storm::expressions::Expression> Model::getConstantsSubstitution() const {
std::map<storm::expressions::Variable, storm::expressions::Expression> result;

6
src/storm/storage/jani/Model.h

@ -399,6 +399,12 @@ namespace storm {
void substituteFunctions();
void substituteFunctions(std::vector<Property>& properties);
/*!
* Substitutes all constants in all expressions of the model. The original model is not modified, but
* instead a new model is created. Afterwards, all function calls are substituted with the defining expression.
*/
Model substituteConstantsFunctions() const;
/*!
* Returns true if at least one array variable occurs in the model.
*/

Loading…
Cancel
Save