Browse Source

Split validate into two methods

tempestpy_adaptions
Jip Spel 6 years ago
parent
commit
9375709381
  1. 22
      src/storm-pars/analysis/AssumptionChecker.cpp
  2. 1
      src/storm-pars/analysis/AssumptionChecker.h

22
src/storm-pars/analysis/AssumptionChecker.cpp

@ -133,6 +133,20 @@ namespace storm {
// Only implemented for two successors
if (row1.getNumberOfEntries() == 2 && row2.getNumberOfEntries() == 2) {
result = validateAssumptionOnFunction(lattice, row1, row2);
}
}
if (result) {
validatedAssumptions.insert(assumption);
} else {
STORM_LOG_DEBUG("Could not validate: " << *assumption << std::endl);
}
return result;
}
template <typename ValueType>
bool AssumptionChecker<ValueType>::validateAssumptionOnFunction(storm::analysis::Lattice* lattice, typename storm::storage::SparseMatrix<ValueType>::rows row1, typename storm::storage::SparseMatrix<ValueType>::rows row2) {
bool result = false;
auto succ1State1 = row1.begin();
auto succ2State1 = (++row1.begin());
auto succ1State2 = row2.begin();
@ -168,14 +182,6 @@ namespace storm {
}
result = prob.evaluate(substitutions) >= 0;
}
if (result) {
validatedAssumptions.insert(assumption);
} else {
STORM_LOG_DEBUG("Could not validate: " << *assumption << std::endl);
}
}
}
return result;
}

1
src/storm-pars/analysis/AssumptionChecker.h

@ -69,6 +69,7 @@ namespace storm {
std::set<std::shared_ptr<storm::expressions::BinaryRelationExpression>> validatedAssumptions;
bool validateAssumptionOnFunction(storm::analysis::Lattice* lattice, typename storm::storage::SparseMatrix<ValueType>::rows row1, typename storm::storage::SparseMatrix<ValueType>::rows row2);
};
}
}

Loading…
Cancel
Save