|
|
@ -58,12 +58,12 @@ public class Prism implements PrismSettingsListener |
|
|
/** Build number (e.g. "6667"). Defaults to "" (undefined), read from prism.Revision class if present. */ |
|
|
/** Build number (e.g. "6667"). Defaults to "" (undefined), read from prism.Revision class if present. */ |
|
|
private static String buildNumber = ""; |
|
|
private static String buildNumber = ""; |
|
|
static { |
|
|
static { |
|
|
try { |
|
|
|
|
|
buildNumber = Prism.class.getClassLoader().loadClass("prism.Revision").getField("svnRevision").get(null).toString(); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
// Any problems (e.g. class not created), ignore. |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
buildNumber = Prism.class.getClassLoader().loadClass("prism.Revision").getField("svnRevision").get(null).toString(); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
// Any problems (e.g. class not created), ignore. |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
// Constants |
|
|
// Constants |
|
|
@ -1741,7 +1741,8 @@ public class Prism implements PrismSettingsListener |
|
|
case EXPLICIT_FILES: |
|
|
case EXPLICIT_FILES: |
|
|
if (!getExplicit()) { |
|
|
if (!getExplicit()) { |
|
|
expf2mtbdd = new ExplicitFiles2MTBDD(this); |
|
|
expf2mtbdd = new ExplicitFiles2MTBDD(this); |
|
|
currentModel = expf2mtbdd.build(explicitFilesStatesFile, explicitFilesTransFile, explicitFilesLabelsFile, currentModulesFile, explicitFilesNumStates); |
|
|
|
|
|
|
|
|
currentModel = expf2mtbdd.build(explicitFilesStatesFile, explicitFilesTransFile, explicitFilesLabelsFile, currentModulesFile, |
|
|
|
|
|
explicitFilesNumStates); |
|
|
} else { |
|
|
} else { |
|
|
throw new PrismException("Explicit import not yet supported for explicit engine"); |
|
|
throw new PrismException("Explicit import not yet supported for explicit engine"); |
|
|
} |
|
|
} |
|
|
@ -2360,6 +2361,8 @@ public class Prism implements PrismSettingsListener |
|
|
{ |
|
|
{ |
|
|
Result res = null; |
|
|
Result res = null; |
|
|
Values definedPFConstants = propertiesFile.getConstantValues(); |
|
|
Values definedPFConstants = propertiesFile.getConstantValues(); |
|
|
|
|
|
boolean engineSwitch = false; |
|
|
|
|
|
int lastEngine = -1; |
|
|
|
|
|
|
|
|
if (!digital) |
|
|
if (!digital) |
|
|
mainLog.printSeparator(); |
|
|
mainLog.printSeparator(); |
|
|
@ -2377,19 +2380,36 @@ public class Prism implements PrismSettingsListener |
|
|
return modelCheckPTA(propertiesFile, prop.getExpression(), definedPFConstants); |
|
|
return modelCheckPTA(propertiesFile, prop.getExpression(), definedPFConstants); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Build model, if necessary |
|
|
|
|
|
buildModelIfRequired(); |
|
|
|
|
|
|
|
|
// Auto-switch engine if required |
|
|
|
|
|
if (currentModelType == ModelType.MDP) { |
|
|
|
|
|
if (getMDPSolnMethod() != Prism.MDP_VALITER && !getExplicit()) { |
|
|
|
|
|
mainLog.printWarning("Switching to explicit engine to allow use of chosen MDP solution method."); |
|
|
|
|
|
engineSwitch = true; |
|
|
|
|
|
lastEngine = getEngine(); |
|
|
|
|
|
setEngine(Prism.EXPLICIT); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Create new model checker object and do model checking |
|
|
|
|
|
if (!getExplicit()) { |
|
|
|
|
|
ModelChecker mc = StateModelChecker.createModelChecker(currentModelType, this, currentModel, propertiesFile); |
|
|
|
|
|
res = mc.check(prop.getExpression()); |
|
|
|
|
|
} else { |
|
|
|
|
|
explicit.StateModelChecker mc = explicit.StateModelChecker.createModelChecker(currentModelType); |
|
|
|
|
|
mc.setLog(mainLog); |
|
|
|
|
|
mc.setSettings(settings); |
|
|
|
|
|
mc.setModulesFileAndPropertiesFile(currentModulesFile, propertiesFile); |
|
|
|
|
|
res = mc.check(currentModelExpl, prop.getExpression()); |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
// Build model, if necessary |
|
|
|
|
|
buildModelIfRequired(); |
|
|
|
|
|
|
|
|
|
|
|
// Create new model checker object and do model checking |
|
|
|
|
|
if (!getExplicit()) { |
|
|
|
|
|
ModelChecker mc = StateModelChecker.createModelChecker(currentModelType, this, currentModel, propertiesFile); |
|
|
|
|
|
res = mc.check(prop.getExpression()); |
|
|
|
|
|
} else { |
|
|
|
|
|
explicit.StateModelChecker mc = explicit.StateModelChecker.createModelChecker(currentModelType); |
|
|
|
|
|
mc.setLog(mainLog); |
|
|
|
|
|
mc.setSettings(settings); |
|
|
|
|
|
mc.setModulesFileAndPropertiesFile(currentModulesFile, propertiesFile); |
|
|
|
|
|
res = mc.check(currentModelExpl, prop.getExpression()); |
|
|
|
|
|
} |
|
|
|
|
|
} finally { |
|
|
|
|
|
// Undo auto-switch (if any) |
|
|
|
|
|
if (engineSwitch) { |
|
|
|
|
|
setEngine(lastEngine); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Return result |
|
|
// Return result |
|
|
|