Browse Source

Check if derivative is constant in validation of assumption

tempestpy_adaptions
Jip Spel 6 years ago
parent
commit
4999ac5440
  1. 8
      src/storm-pars/analysis/AssumptionChecker.cpp

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

@ -171,6 +171,7 @@ namespace storm {
typename storm::storage::SparseMatrix<ValueType>::iterator state1succ2,
typename storm::storage::SparseMatrix<ValueType>::iterator state2succ1,
typename storm::storage::SparseMatrix<ValueType>::iterator state2succ2) {
bool result = true;
ValueType prob;
auto comp = lattice->compare(state1succ1->getColumn(), state1succ2->getColumn());
@ -185,14 +186,17 @@ namespace storm {
std::map<storm::RationalFunctionVariable, typename ValueType::CoeffType> substitutions;
for (auto var : vars) {
auto derivative = prob.derivative(var);
assert(derivative.isConstant());
if(derivative.isConstant()) {
if (derivative.constantPart() >= 0) {
substitutions[var] = 0;
} else if (derivative.constantPart() <= 0) {
substitutions[var] = 1;
}
} else {
result = false;
}
}
return prob.evaluate(substitutions) >= 0;
return result && prob.evaluate(substitutions) >= 0;
}
template <typename ValueType>

Loading…
Cancel
Save