Browse Source

symred is now an option

Former-commit-id: 5725991656
tempestpy_adaptions
sjunges 9 years ago
parent
commit
2dbcd260e4
  1. 18
      src/storm-dyftee.cpp

18
src/storm-dyftee.cpp

@ -4,6 +4,7 @@
#include "builder/ExplicitDFTModelBuilder.h" #include "builder/ExplicitDFTModelBuilder.h"
#include "modelchecker/results/CheckResult.h" #include "modelchecker/results/CheckResult.h"
#include "utility/storm.h" #include "utility/storm.h"
#include "storage/dft/DFTIsomorphism.h"
/*! /*!
* Load DFT from filename, build corresponding Model and check against given property. * Load DFT from filename, build corresponding Model and check against given property.
@ -12,13 +13,19 @@
* @param property PCTC formula capturing the property to check. * @param property PCTC formula capturing the property to check.
*/ */
template <typename ValueType> template <typename ValueType>
void analyzeDFT(std::string filename, std::string property) {
void analyzeDFT(std::string filename, std::string property, bool symred = false) {
// Parsing DFT // Parsing DFT
std::cout << "Parsing DFT file..." << std::endl; std::cout << "Parsing DFT file..." << std::endl;
storm::parser::DFTGalileoParser<ValueType> parser; storm::parser::DFTGalileoParser<ValueType> parser;
storm::storage::DFT<ValueType> dft = parser.parseDFT(filename); storm::storage::DFT<ValueType> dft = parser.parseDFT(filename);
std::cout << "Built data structure" << std::endl; std::cout << "Built data structure" << std::endl;
if(symred) {
std::cout << dft.getElementsString() << std::endl;
auto colouring = dft.colourDFT();
dft.findSymmetries(colouring);
}
// Building Markov Automaton // Building Markov Automaton
std::cout << "Building Model..." << std::endl; std::cout << "Building Model..." << std::endl;
storm::builder::ExplicitDFTModelBuilder<ValueType> builder(dft); storm::builder::ExplicitDFTModelBuilder<ValueType> builder(dft);
@ -52,6 +59,7 @@ int main(int argc, char** argv) {
// Parse cli arguments // Parse cli arguments
bool parametric = false; bool parametric = false;
bool symred = false;
log4cplus::LogLevel level = log4cplus::WARN_LOG_LEVEL; log4cplus::LogLevel level = log4cplus::WARN_LOG_LEVEL;
std::string filename = argv[1]; std::string filename = argv[1];
std::string pctlFormula = ""; std::string pctlFormula = "";
@ -74,6 +82,8 @@ int main(int argc, char** argv) {
++i; ++i;
assert(i < argc); assert(i < argc);
pctlFormula = argv[i]; pctlFormula = argv[i];
} else if (option == "--symred") {
symred = true;
} else { } else {
std::cout << "Option '" << option << "' not recognized." << std::endl; std::cout << "Option '" << option << "' not recognized." << std::endl;
return 1; return 1;
@ -88,8 +98,8 @@ int main(int argc, char** argv) {
std::cout << "Running " << (parametric ? "parametric " : "") << "DFT analysis on file " << filename << " with property " << pctlFormula << std::endl; std::cout << "Running " << (parametric ? "parametric " : "") << "DFT analysis on file " << filename << " with property " << pctlFormula << std::endl;
if (parametric) { if (parametric) {
analyzeDFT<storm::RationalFunction>(filename, pctlFormula);
analyzeDFT<storm::RationalFunction>(filename, pctlFormula, symred);
} else { } else {
analyzeDFT<double>(filename, pctlFormula);
analyzeDFT<double>(filename, pctlFormula, symred);
} }
} }
Loading…
Cancel
Save