Browse Source

Deadlocks reported as timelocks for PTAs model checked with digital clocks.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@2332 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 16 years ago
parent
commit
b81b80e877
  1. 15
      prism/src/prism/PrismCL.java
  2. 7
      prism/src/userinterface/properties/GUIExperiment.java
  3. 7
      prism/src/userinterface/properties/computation/ModelCheckThread.java

15
prism/src/prism/PrismCL.java

@ -244,7 +244,7 @@ public class PrismCL
if (doBuild) {
// build model
try {
buildModel(modulesFile);
buildModel(modulesFile, false);
} catch (PrismException e) {
// in case of error, report it, store as result for any properties, and go on to the next model
error(e.getMessage());
@ -361,7 +361,7 @@ public class PrismCL
modulesFileToCheck = dc.getNewModulesFile();
modulesFileToCheck.setUndefinedConstants(modulesFile.getConstantValues());
doPrismLangExports(modulesFileToCheck);
buildModel(modulesFileToCheck);
buildModel(modulesFileToCheck, true);
} else {
modulesFileToCheck = modulesFile;
}
@ -613,8 +613,10 @@ public class PrismCL
* Build a model, usually from the passed in modulesFileToBuild. However, if importtrans=true,
* then explicit model import is done and modulesFileToBuild can be null.
* This method also displays model info and checks/fixes deadlocks.
* If flag 'digital' is true, then this (MDP) model was constructed
* from digital clocks semantics of a PTA - might need for error reporting.
*/
private void buildModel(ModulesFile modulesFileToBuild) throws PrismException
private void buildModel(ModulesFile modulesFileToBuild, boolean digital) throws PrismException
{
StateList states;
int i;
@ -645,8 +647,13 @@ public class PrismCL
states = model.getDeadlockStates();
if (states != null) {
if (states.size() > 0) {
// for pta models (via digital clocks)
if (digital) {
// by construction, these can only occur from timelocks
throw new PrismException("Timelock in PTA, e.g. in state (" + states.getFirstAsValues() + ")");
}
// if requested, remove them
if (fixdl) {
else if (fixdl) {
mainLog.print("\nWarning: " + states.size() + " deadlock states detected; adding self-loops in these states...\n");
model.fixDeadlocks();
}

7
prism/src/userinterface/properties/GUIExperiment.java

@ -409,13 +409,10 @@ public class GUIExperiment
logln("\n-------------------------------------------");
model = prism.buildModel(modulesFileToCheck);
clear = false;
// remove any deadlocks (don't prompt - probably should)
// by construction, deadlocks can only occur from timelocks
StateList states = model.getDeadlockStates();
if (states != null) {
if (states.size() > 0) {
guiProp.log("\nWarning: " + states.size() + " deadlock states detected; adding self-loops in these states...\n");
model.fixDeadlocks();
}
throw new PrismException("Timelock in PTA, e.g. in state (" + states.getFirstAsValues() + ")");
}
// print some model info
guiProp.log("\n");

7
prism/src/userinterface/properties/computation/ModelCheckThread.java

@ -145,13 +145,10 @@ public class ModelCheckThread extends GUIComputationThread
logln("\n-------------------------------------------");
model = prism.buildModel(modulesFileToCheck);
clear = false;
// remove any deadlocks (don't prompt - probably should)
// by construction, deadlocks can only occur from timelocks
StateList states = model.getDeadlockStates();
if (states != null) {
if (states.size() > 0) {
log("\nWarning: " + states.size() + " deadlock states detected; adding self-loops in these states...\n");
model.fixDeadlocks();
}
throw new PrismException("Timelock in PTA, e.g. in state (" + states.getFirstAsValues() + ")");
}
// print some model info
log("\n");

Loading…
Cancel
Save