Browse Source

refactored a bit, plus bisimulation is now done

Former-commit-id: 42877cdb29
tempestpy_adaptions
sjunges 9 years ago
parent
commit
b93f5c2f62
  1. 1
      src/builder/ExplicitDFTModelBuilder.cpp
  2. 23
      src/storm-dyftee.cpp

1
src/builder/ExplicitDFTModelBuilder.cpp

@ -145,7 +145,6 @@ namespace storm {
} }
} }
model->printModelInformationToStream(std::cout);
return model; return model;
} }

23
src/storm-dyftee.cpp

@ -16,12 +16,19 @@
*/ */
template <typename ValueType> template <typename ValueType>
void analyzeDFT(std::string filename, std::string property, bool symred = false) { void analyzeDFT(std::string filename, std::string property, bool symred = false) {
storm::settings::SettingsManager& manager = storm::settings::mutableManager();
manager.setFromString("");
// 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;
std::cout << "Parse formula..." << std::endl;
std::vector<std::shared_ptr<storm::logic::Formula>> parsedFormulas = storm::parseFormulasForExplicit(property);
std::vector<std::shared_ptr<const storm::logic::Formula>> formulas(parsedFormulas.begin(), parsedFormulas.end());
assert(formulas.size() == 1);
std::cout << "parsed formula." << std::endl;
if(symred) { if(symred) {
std::cout << dft.getElementsString() << std::endl; std::cout << dft.getElementsString() << std::endl;
auto colouring = dft.colourDFT(); auto colouring = dft.colourDFT();
@ -36,10 +43,20 @@ void analyzeDFT(std::string filename, std::string property, bool symred = false)
std::shared_ptr<storm::models::sparse::Model<ValueType>> model = builder.buildModel(labeloptions); std::shared_ptr<storm::models::sparse::Model<ValueType>> model = builder.buildModel(labeloptions);
std::cout << "Built Model" << std::endl; std::cout << "Built Model" << std::endl;
model->printModelInformationToStream(std::cout);
std::cout << "Bisimulation..." << std::endl;
if (model->isOfType(storm::models::ModelType::Ctmc)) {
model = storm::performDeterministicSparseBisimulationMinimization<storm::models::sparse::Ctmc<ValueType>>(model->template as<storm::models::sparse::Ctmc<ValueType>>(), formulas, storm::storage::BisimulationType::Weak)->template as<storm::models::sparse::Ctmc<ValueType>>();
}
model->printModelInformationToStream(std::cout);
// Model checking // Model checking
std::cout << "Model checking..." << std::endl; std::cout << "Model checking..." << std::endl;
std::vector<std::shared_ptr<storm::logic::Formula>> formulas = storm::parseFormulasForExplicit(property);
assert(formulas.size() == 1);
std::unique_ptr<storm::modelchecker::CheckResult> result(storm::verifySparseModel(model, formulas[0])); std::unique_ptr<storm::modelchecker::CheckResult> result(storm::verifySparseModel(model, formulas[0]));
assert(result); assert(result);
std::cout << "Result: "; std::cout << "Result: ";

Loading…
Cancel
Save