Browse Source

Handling of min and max for non-determinism

Former-commit-id: 1a3a38c511
tempestpy_adaptions
Mavo 9 years ago
parent
commit
c05e671111
  1. 37
      src/storm-dyftee.cpp

37
src/storm-dyftee.cpp

@ -47,13 +47,11 @@ void analyzeDFT(std::string filename, std::string property, bool symred = false)
model->printModelInformationToStream(std::cout); model->printModelInformationToStream(std::cout);
std::cout << "Bisimulation..." << std::endl;
if (model->getNumberOfStates() > 500 && model->isOfType(storm::models::ModelType::Ctmc)) { if (model->getNumberOfStates() > 500 && model->isOfType(storm::models::ModelType::Ctmc)) {
std::cout << "Bisimulation..." << std::endl;
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 = 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->printModelInformationToStream(std::cout);
}
// Model checking // Model checking
std::cout << "Model checking..." << std::endl; std::cout << "Model checking..." << std::endl;
@ -81,20 +79,25 @@ int main(int argc, char** argv) {
// Parse cli arguments // Parse cli arguments
bool parametric = false; bool parametric = false;
bool symred = false; bool symred = false;
bool minimal = true;
std::string filename = argv[1]; std::string filename = argv[1];
std::string operatorType = "";
std::string targetFormula = "";
std::string pctlFormula = ""; std::string pctlFormula = "";
for (int i = 2; i < argc; ++i) { for (int i = 2; i < argc; ++i) {
std::string option = argv[i]; std::string option = argv[i];
if (option == "--parametric") { if (option == "--parametric") {
parametric = true; parametric = true;
} else if (option == "--expectedtime") { } else if (option == "--expectedtime") {
assert(pctlFormula.empty());
pctlFormula = "ET=?[F \"failed\"]";
assert(targetFormula.empty());
operatorType = "ET";
targetFormula = "F \"failed\"";
} else if (option == "--probability") { } else if (option == "--probability") {
assert(pctlFormula.empty());
pctlFormula = "P=? [F \"failed\"]";
assert(targetFormula.empty());
operatorType = "P";;
targetFormula = "F \"failed\"";
} else if (option == "--timebound") { } else if (option == "--timebound") {
assert(pctlFormula.empty());
assert(targetFormula.empty());
++i; ++i;
assert(i < argc); assert(i < argc);
double timeBound; double timeBound;
@ -105,8 +108,9 @@ int main(int argc, char** argv) {
return 2; return 2;
} }
std::stringstream stream; std::stringstream stream;
stream << "P=? [F<=" << timeBound << " \"failed\"]";
pctlFormula = stream.str();
stream << "F<=" << timeBound << " \"failed\"";
operatorType = "P";
targetFormula = stream.str();
} else if (option == "--trace") { } else if (option == "--trace") {
STORM_GLOBAL_LOGLEVEL_TRACE(); STORM_GLOBAL_LOGLEVEL_TRACE();
} else if (option == "--debug") { } else if (option == "--debug") {
@ -118,11 +122,22 @@ int main(int argc, char** argv) {
pctlFormula = argv[i]; pctlFormula = argv[i];
} else if (option == "--symred") { } else if (option == "--symred") {
symred = true; symred = true;
} else if (option == "--min") {
minimal = true;
} else if (option == "--max") {
minimal = false;
} else { } else {
std::cout << "Option '" << option << "' not recognized." << std::endl; std::cout << "Option '" << option << "' not recognized." << std::endl;
return 1; return 1;
} }
} }
// Construct pctlFormula
if (!targetFormula.empty()) {
assert(pctlFormula.empty());
pctlFormula = operatorType + (minimal ? "min" : "max") + "=?[" + targetFormula + "]";
}
assert(!pctlFormula.empty()); assert(!pctlFormula.empty());
storm::utility::setUp(); storm::utility::setUp();
Loading…
Cancel
Save