Browse Source

Fix for SCC export on MDPs (and new underlying methods for computing/storing transition relation).

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10604 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 11 years ago
parent
commit
b7f3871fd7
  1. 6
      prism/src/prism/Model.java
  2. 28
      prism/src/prism/NondetModel.java
  3. 6
      prism/src/prism/ProbModel.java
  4. 2
      prism/src/prism/SCCComputer.java

6
prism/src/prism/Model.java

@ -78,6 +78,12 @@ public interface Model
JDDNode getStart();
JDDNode getReach();
/**
* Get a BDD storing the underlying transition relation of the model.
* If it is not stored already, it will be computed.
*/
JDDNode getTransReln();
/**
* Get a BDD storing the set of states that are/were deadlocks.
* (Such states may have been fixed at build-time by adding self-loops)

28
prism/src/prism/NondetModel.java

@ -51,9 +51,21 @@ public class NondetModel extends ProbModel
protected JDDVars allDDNondetVars; // all nondet dd vars (union of two above)
protected JDDNode transInd; // BDD for independent part of trans
protected JDDNode transSynch[]; // BDD for parts of trans from each action
protected JDDNode transReln; // BDD for the transition relation (no action encoding)
// accessor methods
@Override
public JDDNode getTransReln()
{
// First, compute the transition relation if it is not there
if (transReln == null) {
JDD.Ref(trans01);
transReln = JDD.ThereExists(trans01, allDDNondetVars);
}
return transReln;
}
// type
public ModelType getModelType()
{
@ -181,6 +193,7 @@ public class NondetModel extends ProbModel
transInd = null;
transSynch = null;
transReln = null;
}
// do reachability
@ -221,7 +234,12 @@ public class NondetModel extends ProbModel
transSynch[i] = JDD.Apply(JDD.TIMES, reach, transSynch[i]);
}
}
// also filter transReln DD (if necessary)
if (transReln != null) {
JDD.Ref(reach);
transReln = JDD.Apply(JDD.TIMES, reach, transReln);
}
// build mask for nondeterminstic choices
// (and work out number of choices)
JDD.Ref(trans01);
@ -268,6 +286,12 @@ public class NondetModel extends ProbModel
transInd = JDD.Or(transInd, JDD.ThereExists(tmp, allDDColVars));
}
JDD.Deref(tmp);
// recompute transReln (if needed)
if (transReln != null) {
JDD.Deref(transReln);
JDD.Ref(trans01);
transReln = JDD.ThereExists(trans01, allDDNondetVars);
}
// update transition count
numTransitions = JDD.GetNumMinterms(trans01, getNumDDVarsInTrans());
// re-build mask for nondeterminstic choices
@ -425,6 +449,8 @@ public class NondetModel extends ProbModel
for (int i = 0; i < numSynchs; i++) {
JDD.Deref(transSynch[i]);
}
if (transReln != null)
JDD.Deref(transReln);
}
}

6
prism/src/prism/ProbModel.java

@ -244,6 +244,12 @@ public class ProbModel implements Model
return reach;
}
@Override
public JDDNode getTransReln()
{
return trans01;
}
@Override
public JDDNode getDeadlocks()
{

2
prism/src/prism/SCCComputer.java

@ -59,7 +59,7 @@ public abstract class SCCComputer extends PrismComponent
*/
public static SCCComputer createSCCComputer(PrismComponent parent, Model model) throws PrismException
{
return createSCCComputer(parent, model.getReach(), model.getTrans01(), model.getAllDDRowVars(), model.getAllDDColVars());
return createSCCComputer(parent, model.getReach(), model.getTransReln(), model.getAllDDRowVars(), model.getAllDDColVars());
}
/**

Loading…
Cancel
Save