Browse Source

primes in dft element names are replaced now

tempestpy_adaptions
Sebastian Junges 8 years ago
parent
commit
474eaa950a
  1. 10
      src/storm-dft/parser/DFTGalileoParser.cpp
  2. 1
      src/storm-dft/parser/DFTGalileoParser.h

10
src/storm-dft/parser/DFTGalileoParser.cpp

@ -4,6 +4,7 @@
#include <fstream>
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/replace.hpp>
#include "storm/storage/expressions/ExpressionManager.h"
#include "storm/exceptions/NotImplementedException.h"
#include "storm/exceptions/FileIoException.h"
@ -34,6 +35,11 @@ namespace storm {
return name.substr(firstQuots+1,secondQuots-1);
}
}
template<typename ValueType>
std::string DFTGalileoParser<ValueType>::parseNodeIdentifier(std::string const& name) {
return boost::replace_all_copy(name, "'", "__prime__");
}
template<typename ValueType>
void DFTGalileoParser<ValueType>::readFile(const std::string& filename) {
@ -84,11 +90,11 @@ namespace storm {
} else {
std::vector<std::string> tokens;
boost::split(tokens, line, boost::is_any_of(" "));
std::string name(stripQuotsFromName(tokens[0]));
std::string name(parseNodeIdentifier(stripQuotsFromName(tokens[0])));
std::vector<std::string> childNames;
for(unsigned i = 2; i < tokens.size(); ++i) {
childNames.push_back(stripQuotsFromName(tokens[i]));
childNames.push_back(parseNodeIdentifier(stripQuotsFromName(tokens[i])));
}
if(tokens[1] == "and") {
success = builder.addAndElement(name, childNames);

1
src/storm-dft/parser/DFTGalileoParser.h

@ -35,6 +35,7 @@ namespace storm {
void readFile(std::string const& filename);
std::string stripQuotsFromName(std::string const& name);
std::string parseNodeIdentifier(std::string const& name);
ValueType parseRationalExpression(std::string const& expr);
};

Loading…
Cancel
Save