Browse Source

Actions preserved in LTL (MDP) product for adversary export.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@1754 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 16 years ago
parent
commit
ee2fa09c49
  1. 13
      prism/src/prism/LTLModelChecker.java
  2. 2
      prism/src/prism/Model.java
  3. 6
      prism/src/prism/ProbModel.java

13
prism/src/prism/LTLModelChecker.java

@ -480,6 +480,16 @@ public class LTLModelChecker
// Constants (no change) // Constants (no change)
model.getConstantValues()); model.getConstantValues());
// Copy action info MTBDD across directly
// If present, just needs filtering to reachable states,
// which will get done below.
if (model.getTransActions() != null) {
JDD.Ref(model.getTransActions());
modelProd.setTransActions(model.getTransActions());
}
// Also need to copy set of action label strings
modelProd.setSynchs(new Vector<String>(model.getSynchs()));
// Do reachability/etc. for the new model // Do reachability/etc. for the new model
modelProd.doReachability(prism.getExtraReachInfo()); modelProd.doReachability(prism.getExtraReachInfo());
modelProd.filterReachableStates(); modelProd.filterReachableStates();
@ -488,6 +498,9 @@ public class LTLModelChecker
throw new PrismException("Model-DRA product has deadlock states"); throw new PrismException("Model-DRA product has deadlock states");
} }
//try { prism.exportStatesToFile(modelProd, Prism.EXPORT_PLAIN, new java.io.File("prod.sta")); }
//catch (java.io.FileNotFoundException e) {}
// Reference DRA DD vars (if being returned) // Reference DRA DD vars (if being returned)
if (draDDRowVarsCopy != null) if (draDDRowVarsCopy != null)
draDDRowVarsCopy.refAll(); draDDRowVarsCopy.refAll();

2
prism/src/prism/Model.java

@ -98,7 +98,7 @@ public interface Model
ODDNode getODD(); ODDNode getODD();
void setSynchs(Vector<String> synchs);
void setSynchs(List<String> synchs);
void resetTrans(JDDNode trans); void resetTrans(JDDNode trans);
void resetTransRewards(int i, JDDNode transRewards); void resetTransRewards(int i, JDDNode transRewards);
void doReachability(); void doReachability();

6
prism/src/prism/ProbModel.java

@ -52,7 +52,7 @@ public class ProbModel implements Model
protected Values constantValues; // values of constants protected Values constantValues; // values of constants
// actions // actions
protected int numSynchs; // number of synchronising actions protected int numSynchs; // number of synchronising actions
protected Vector<String> synchs; // synchronising action labels
protected List<String> synchs; // synchronising action labels
// rewards // rewards
protected int numRewardStructs; // number of reward structs protected int numRewardStructs; // number of reward structs
protected String[] rewardStructNames; // reward struct names protected String[] rewardStructNames; // reward struct names
@ -161,7 +161,7 @@ public class ProbModel implements Model
} }
/** /**
* Get vector of action label names.
* Get list of action label names.
*/ */
public List<String> getSynchs() public List<String> getSynchs()
{ {
@ -439,7 +439,7 @@ public class ProbModel implements Model
/** /**
* Set vector of action label names. * Set vector of action label names.
*/ */
public void setSynchs(Vector<String> synchs)
public void setSynchs(List<String> synchs)
{ {
this.synchs = synchs; this.synchs = synchs;
this.numSynchs = synchs.size(); this.numSynchs = synchs.size();

Loading…
Cancel
Save