Browse Source

Bugfix (and typo fix) in results testing for parametric mode.

If the result is a single parameter (p in the included test case),
findAllConstants returns a new Expression, not a modified one.
accumulation-v4.7
Dave Parker 6 years ago
parent
commit
6525146264
  1. 16
      prism-tests/functionality/verify/param/param-simple.prism
  2. 5
      prism-tests/functionality/verify/param/param-simple.prism.props
  3. 1
      prism-tests/functionality/verify/param/param-simple.prism.props.args
  4. 2
      prism/src/param/ParamResult.java

16
prism-tests/functionality/verify/param/param-simple.prism

@ -0,0 +1,16 @@
// Trivial test of parametric model checking
// (also tests a bugfix in the results testing when the result is just a lone parameter)
dtmc
const double p;
module M
// local state
s : [0..7] init 0;
[] s=0 -> p : (s'=1) + 1-p : (s'=2);
[] s>0 -> true;
endmodule

5
prism-tests/functionality/verify/param/param-simple.prism.props

@ -0,0 +1,5 @@
// RESULT: p
P=? [ F s=1 ];
// RESULT: 1-p
P=? [ F s=2 ];

1
prism-tests/functionality/verify/param/param-simple.prism.props.args

@ -0,0 +1 @@
-param p

2
prism/src/param/ParamResult.java

@ -148,7 +148,7 @@ public class ParamResult
for (String p : modelBuilder.getParameterNames()) {
constantList.addConstant(new ExpressionIdent(p), null, TypeDouble.getInstance());
}
exprExpected.findAllConstants(constantList);
exprExpected = (Expression) exprExpected.findAllConstants(constantList);
exprExpected.typeCheck();
// replace constants in the expression that have a value

Loading…
Cancel
Save