Dear Prism Model Checking Group:
I am having some problems invoking Prism's parametric model-checking functionality through Eclipse.
I have Prism 4.7 installed and can invoke standard model checking to obtain e.g. probability values etc by adding the appropriate JAR file dependencies to the Eclipse project.
However, when I try parametric model checking, (via the main method below), it returns the exception
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "parser.Values.removeValue(String)" because "<local7>" is null
at prism.Prism.modelCheckParametric(Prism.java:3448)
at parametric.ParametricTestClient.main(ParametricTestClient.java:60)
But when I run parametric model checking by the command line, it returns the expected output (below)
Thank you for your help!
Best regards
Ken
prism simple.pm simple.pctl -param 'p1=0.0:1.0,p2=0.0:1.0'
--------
Parametric model checking: P=? [ F (state=3) ]
Building model (parametric engine)...
Computing reachable states...
Reachable states exploration and model construction done in 0.007 secs.
States: 4 (1 initial)
Transitions: 6
Time for model construction: 0.008 seconds.
Time for model checking: 0.023 seconds.
Result (probability): ([0.0,1.0],[0.0,1.0]): { ( -1 ) p2 * p1 + 1 }
public static void main(String[] args)
{
Prism prism = null;
PrismLog prismMainLog;
prismMainLog = new PrismFileLog("prismLogFile.txt");
prism = new Prism(prismMainLog);
String fileContents = "dtmc\n"
+ "const double p1;\n"
+ "const double p2;\n"
+ "module simple\n"
+ " state : [0..3] init 0;\n"
+ " [action1] (state=0) -> p1:(state'=1) + (1-p1):(state'=3);\n"
+ " [action2] (state=1) -> p2:(state'=2) + (1-p2):(state'=3);\n"
+ " [fail] (state=3) -> true;\n"
+ "endmodule\n";
try {
prism.initialise();
String[] paramNames = new String[]{"p1","p2"};
String[] paramLowerBounds = new String[]{"0","0"};
String[] paramUpperBounds = new String[]{"1","1"};
ModulesFile modulesFile = prism.parseModelString(fileContents);
prism.loadPRISMModel(modulesFile);
PropertiesFile propertiesFile = prism.parsePropertiesString(modulesFile,"P=?[F(state=3)]");
prism.Result fromPrismResult = prism.modelCheckParametric(propertiesFile,propertiesFile.getPropertyObject(0),
paramNames, paramLowerBounds, paramUpperBounds);
System.out.println(fromPrismResult);
} catch (PrismException e)
{
e.printStackTrace();
}
}