Browse Source

made Prism to JANI conversion compile again

Former-commit-id: 7775fd4a18 [formerly f7a542bf3e]
Former-commit-id: 0c0f7cf70b
tempestpy_adaptions
dehnert 8 years ago
parent
commit
c0d1628466
  1. 9
      src/storage/prism/Program.cpp
  2. 4
      src/storage/prism/Program.h
  3. 8
      src/storage/prism/ToJaniConverter.cpp
  4. 2
      src/storage/prism/ToJaniConverter.h

9
src/storage/prism/Program.cpp

@ -20,6 +20,7 @@
#include "src/storage/prism/CompositionVisitor.h"
#include "src/storage/prism/Compositions.h"
#include "src/storage/prism/ToJaniConverter.h"
namespace storm {
namespace prism {
@ -1600,13 +1601,13 @@ namespace storm {
return Command(newCommandIndex, false, actionIndex, actionName, newGuard, newUpdates, this->getFilename(), 0);
}
uint_fast64_t Program::numberOfActions() const {
uint_fast64_t Program::getNumberOfActions() const {
return this->actions.size();
}
uint_fast64_t Program::largestActionIndex() const {
assert(numberOfActions() != 0);
return this->indexToActionMap.rbegin()->first;
storm::jani::Model Program::toJani(bool allVariablesGlobal) const {
ToJaniConverter converter;
return converter.convert(*this, allVariablesGlobal);
}
storm::expressions::ExpressionManager& Program::getManager() const {

4
src/storage/prism/Program.h

@ -574,9 +574,7 @@ namespace storm {
std::unordered_map<uint_fast64_t, std::string> buildActionIndexToActionNameMap() const;
uint_fast64_t numberOfActions() const;
uint_fast64_t largestActionIndex() const;
uint_fast64_t getNumberOfActions() const;
/*!
* Converts the PRISM model into an equivalent JANI model.

8
src/storage/prism/ToJaniConverter.cpp

@ -9,7 +9,7 @@
namespace storm {
namespace prism {
storm::jani::Model convert(storm::prism::Program const& program, bool allVariablesGlobal) {
storm::jani::Model ToJaniConverter::convert(storm::prism::Program const& program, bool allVariablesGlobal) const {
std::shared_ptr<storm::expressions::ExpressionManager> manager = program.getManager().getSharedPointer();
// Start by creating an empty JANI model.
@ -59,10 +59,10 @@ namespace storm {
}
// Add all actions of the PRISM program to the JANI model.
for (auto const& action : indexToActionMap) {
for (auto const& action : program.getActions()) {
// Ignore the empty action as every JANI program has predefined tau action.
if (!action.second.empty()) {
janiModel.addAction(storm::jani::Action(action.second));
if (!action.empty()) {
janiModel.addAction(storm::jani::Action(action));
}
}

2
src/storage/prism/ToJaniConverter.h

@ -11,8 +11,6 @@ namespace storm {
class ToJaniConverter {
public:
ToJaniConverter();
storm::jani::Model convert(storm::prism::Program const& program, bool allVariablesGlobal = false) const;
};

Loading…
Cancel
Save