Browse Source

Jani: Correctly parse the input-enable field. Throw an error in the sparse model builder, as these are not supported right now.

tempestpy_adaptions
Tim Quatmann 4 years ago
parent
commit
3184ba1611
  1. 8
      src/storm-parsers/parser/JaniParser.cpp
  2. 2
      src/storm/generator/JaniNextStateGenerator.cpp

8
src/storm-parsers/parser/JaniParser.cpp

@ -1573,7 +1573,13 @@ namespace storm {
template <typename ValueType>
std::shared_ptr<storm::jani::Composition> JaniParser<ValueType>::parseComposition(Json const &compositionStructure) {
if(compositionStructure.count("automaton")) {
return std::shared_ptr<storm::jani::AutomatonComposition>(new storm::jani::AutomatonComposition(compositionStructure.at("automaton").template get<std::string>()));
std::set<std::string> inputEnabledActions;
if (compositionStructure.count("input-enable")) {
for (auto const& actionDecl : compositionStructure.at("input-enable")) {
inputEnabledActions.insert(actionDecl.template get<std::string>());
}
}
return std::shared_ptr<storm::jani::AutomatonComposition>(new storm::jani::AutomatonComposition(compositionStructure.at("automaton").template get<std::string>(), inputEnabledActions));
}
STORM_LOG_THROW(compositionStructure.count("elements") == 1, storm::exceptions::InvalidJaniException, "Elements of a composition must be given, got " << compositionStructure.dump());

2
src/storm/generator/JaniNextStateGenerator.cpp

@ -1183,6 +1183,8 @@ namespace storm {
uint64_t automatonIndex = 0;
for (auto const& composition : parallelComposition.getSubcompositions()) {
STORM_LOG_THROW(composition->isAutomatonComposition(), storm::exceptions::WrongFormatException, "Expected flat parallel composition.");
STORM_LOG_THROW(composition->asAutomatonComposition().getInputEnabledActions().empty(), storm::exceptions::NotSupportedException, "Input-enabled actions are not supported right now.");
this->parallelAutomata.push_back(this->model.getAutomaton(composition->asAutomatonComposition().getAutomatonName()));
// Add edges with silent action.

Loading…
Cancel
Save