Browse Source

Add check acyclic

tempestpy_adaptions
Jip Spel 6 years ago
parent
commit
581410c54b
  1. 12
      src/storm-pars-cli/storm-pars.cpp

12
src/storm-pars-cli/storm-pars.cpp

@ -527,17 +527,25 @@ namespace storm {
if (parSettings.isMonotonicityAnalysisSet()) {
std::cout << "Hello, Jip2" << std::endl;
std::vector<std::shared_ptr<storm::logic::Formula const>> formulas = storm::api::extractFormulasFromProperties(input.properties);
std::shared_ptr<storm::models::sparse::Model<ValueType>> sparseModel = model->as<storm::models::sparse::Model<ValueType>>();
// Check if MC is acyclic
auto decomposition = storm::storage::StronglyConnectedComponentDecomposition<ValueType>(sparseModel->getTransitionMatrix(), false, false);
for (auto i = 0; i < decomposition.size(); ++i) {
auto scc = decomposition.getBlock(i);
STORM_LOG_THROW(scc.size() <= 1, storm::exceptions::NotSupportedException, "Cycle found, not supporting cyclic MCs");
}
// Transform to Lattices
storm::utility::Stopwatch latticeWatch(true);
storm::analysis::LatticeExtender<ValueType> *extender = new storm::analysis::LatticeExtender<ValueType>(sparseModel);
std::tuple<storm::analysis::Lattice*, uint_fast64_t, uint_fast64_t> criticalPair = extender->toLattice(formulas);
auto assumptionMaker = storm::analysis::AssumptionMaker<ValueType>(extender, sparseModel->getNumberOfStates());
std::map<storm::analysis::Lattice*, std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>>> result = assumptionMaker.startMakingAssumptions(std::get<0>(criticalPair), std::get<1>(criticalPair), std::get<2>(criticalPair));
latticeWatch.stop();
STORM_PRINT(std::endl << "Time for lattice creation: " << latticeWatch << "." << std::endl << std::endl);

Loading…
Cancel
Save