|
|
|
@ -1116,8 +1116,7 @@ public class NondetModelChecker extends NonProbModelChecker |
|
|
|
{ |
|
|
|
LTLModelChecker mcLtl; |
|
|
|
StateValues probsProduct = null, probs = null; |
|
|
|
Expression ltl; |
|
|
|
Vector<JDDNode> labelDDs; |
|
|
|
Vector<JDDNode> labelDDs = new Vector<JDDNode>(); |
|
|
|
DA<BitSet, ? extends AcceptanceOmega> da; |
|
|
|
NondetModel modelProduct; |
|
|
|
NondetModelChecker mcProduct; |
|
|
|
@ -1133,25 +1132,6 @@ public class NondetModelChecker extends NonProbModelChecker |
|
|
|
expr = Expression.Not(Expression.Parenth(expr)); |
|
|
|
} |
|
|
|
|
|
|
|
if (Expression.containsTemporalTimeBounds(expr)) { |
|
|
|
if (model.getModelType().continuousTime()) { |
|
|
|
throw new PrismException("DA construction for time-bounded operators not supported for " + model.getModelType()+"."); |
|
|
|
} |
|
|
|
|
|
|
|
if (expr.isSimplePathFormula()) { |
|
|
|
// Convert simple path formula to canonical form, |
|
|
|
// DA is then generated by LTL2RabinLibrary. |
|
|
|
// |
|
|
|
// The conversion to canonical form has to happen here, because once |
|
|
|
// checkMaximalStateFormulas has been called, the formula should not be modified |
|
|
|
// anymore, as converters may expect that the generated labels for maximal state |
|
|
|
// formulas only appear positively |
|
|
|
expr = Expression.convertSimplePathFormulaToCanonicalForm(expr); |
|
|
|
} else { |
|
|
|
throw new PrismException("Time-bounded operators not supported in LTL: " + expr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Can't do "dfa" properties yet |
|
|
|
if (expr instanceof ExpressionFunc && ((ExpressionFunc) expr).getName().equals("dfa")) { |
|
|
|
throw new PrismException("Model checking for \"dfa\" specifications not supported yet"); |
|
|
|
@ -1159,34 +1139,17 @@ public class NondetModelChecker extends NonProbModelChecker |
|
|
|
|
|
|
|
// For LTL model checking routines |
|
|
|
mcLtl = new LTLModelChecker(prism); |
|
|
|
|
|
|
|
// Model check maximal state formulas |
|
|
|
labelDDs = new Vector<JDDNode>(); |
|
|
|
ltl = mcLtl.checkMaximalStateFormulas(this, model, expr.deepCopy(), labelDDs); |
|
|
|
|
|
|
|
|
|
|
|
// Convert LTL formula to deterministic automaton (DA) |
|
|
|
mainLog.println("\nBuilding deterministic automaton (for " + ltl + ")..."); |
|
|
|
l = System.currentTimeMillis(); |
|
|
|
LTL2DA ltl2da = new LTL2DA(prism); |
|
|
|
AcceptanceType[] allowedAcceptance = { |
|
|
|
AcceptanceType.RABIN, |
|
|
|
AcceptanceType.GENERALIZED_RABIN, |
|
|
|
AcceptanceType.REACH |
|
|
|
}; |
|
|
|
da = ltl2da.convertLTLFormulaToDA(ltl, constantValues, allowedAcceptance); |
|
|
|
da.checkForCanonicalAPs(labelDDs.size()); |
|
|
|
mainLog.println(da.getAutomataType()+" has " + da.size() + " states, " + da.getAcceptance().getSizeStatistics()+"."); |
|
|
|
l = System.currentTimeMillis() - l; |
|
|
|
mainLog.println("Time for deterministic automaton translation: " + l / 1000.0 + " seconds."); |
|
|
|
// If required, export DA |
|
|
|
if (prism.getSettings().getExportPropAut()) { |
|
|
|
mainLog.println("Exporting DA to file \"" + prism.getSettings().getExportPropAutFilename() + "\"..."); |
|
|
|
PrintStream out = PrismUtils.newPrintStream(prism.getSettings().getExportPropAutFilename()); |
|
|
|
da.print(out, prism.getSettings().getExportPropAutType()); |
|
|
|
out.close(); |
|
|
|
} |
|
|
|
da = mcLtl.constructDAForLTLFormula(this, model, expr, labelDDs, allowedAcceptance); |
|
|
|
|
|
|
|
// Build product of MDP and automaton |
|
|
|
l = System.currentTimeMillis(); |
|
|
|
mainLog.println("\nConstructing MDP-"+da.getAutomataType()+" product..."); |
|
|
|
daDDRowVars = new JDDVars(); |
|
|
|
daDDColVars = new JDDVars(); |
|
|
|
|