Browse Source

imported patch rewardcounter-continous-time-bounds.patch

tud-infrastructure-2018-10-12
Joachim Klein 7 years ago
parent
commit
96b4668afd
  1. 25
      prism/src/explicit/ProbModelChecker.java

25
prism/src/explicit/ProbModelChecker.java

@ -635,11 +635,26 @@ public class ProbModelChecker extends NonProbModelChecker
boolean negated = false; boolean negated = false;
StateValues probs = null; StateValues probs = null;
if (Expression.containsTemporalRewardBounds(expr)) {
throw new PrismNotSupportedException("Can not handle reward bounds.");
}
expr = Expression.convertSimplePathFormulaToCanonicalForm(expr); expr = Expression.convertSimplePathFormulaToCanonicalForm(expr);
ExpressionTemporal exprTemp = Expression.getTemporalOperatorForSimplePathFormula(expr);
// Here, in the generic method, reward bounds and multiple bounds are not handled.
// If they can be handled, they will have been processed already by a checkProbPathFormulaSimple
// function in a derived model checker class.
if (exprTemp.getBounds().hasRewardBounds())
throw new PrismNotSupportedException("Reward bounds are not supported in this case for " + model.getModelType());
if (model.getModelType().continuousTime()) {
if (exprTemp.getBounds().hasStepBounds()) {
throw new PrismNotSupportedException("Step bounds are not supported for continuous time models");
}
if (exprTemp.getBounds().countTimeBoundsContinuous() > 1) {
throw new PrismNotSupportedException("Multiple time bounds are not supported for continuous time models");
}
} else {
if (exprTemp.getBounds().countStepBounds() > 1) {
throw new PrismNotSupportedException("Multiple step bounds are not supported by the generic calculator");
}
}
// Negation // Negation
if (expr instanceof ExpressionUnaryOp && if (expr instanceof ExpressionUnaryOp &&
@ -650,7 +665,7 @@ public class ProbModelChecker extends NonProbModelChecker
} }
if (expr instanceof ExpressionTemporal) { if (expr instanceof ExpressionTemporal) {
ExpressionTemporal exprTemp = (ExpressionTemporal) expr;
exprTemp = (ExpressionTemporal) expr;
// Next // Next
if (exprTemp.getOperator() == ExpressionTemporal.P_X) { if (exprTemp.getOperator() == ExpressionTemporal.P_X) {

Loading…
Cancel
Save