|
|
|
@ -49,6 +49,7 @@ import jltl2ba.LTLFragments; |
|
|
|
import jltl2dstar.LTL2Rabin; |
|
|
|
import parser.Values; |
|
|
|
import parser.ast.Expression; |
|
|
|
import parser.visitor.ExpandStepBoundsSyntactically; |
|
|
|
import parser.ast.ExpressionHOA; |
|
|
|
import parser.ast.ExpressionLabel; |
|
|
|
import parser.ast.ExpressionUnaryOp; |
|
|
|
@ -102,9 +103,6 @@ public class LTL2DA extends PrismComponent |
|
|
|
|
|
|
|
boolean useExternal = useExternal(); |
|
|
|
boolean containsTemporalBounds = Expression.containsTemporalTimeBounds(ltl); |
|
|
|
if (containsTemporalBounds) { |
|
|
|
useExternal = false; |
|
|
|
} |
|
|
|
|
|
|
|
if (!useExternal) { |
|
|
|
try { |
|
|
|
@ -114,21 +112,22 @@ public class LTL2DA extends PrismComponent |
|
|
|
getLog().println("Taking "+result.getAutomataType()+" from library..."); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
if (containsTemporalBounds) { |
|
|
|
// there is (currently) no other way to translate LTL with temporal bounds, |
|
|
|
// so treat an exception as a "real" one |
|
|
|
throw e; |
|
|
|
} else { |
|
|
|
// there is the possibility that we might be able to construct |
|
|
|
// an automaton below, just issue a warning |
|
|
|
getLog().println("Warning: Exception during attempt to construct DRA using the LTL2RabinLibrary:"); |
|
|
|
getLog().println(" " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (result == null) { |
|
|
|
if (!containsTemporalBounds) { |
|
|
|
if (containsTemporalBounds) { |
|
|
|
// remove time bounds syntactically |
|
|
|
ExpandStepBoundsSyntactically visitor = new ExpandStepBoundsSyntactically(constants); |
|
|
|
ltl = (Expression)ltl.deepCopy().accept(visitor); |
|
|
|
|
|
|
|
mainLog.println("LTL formula with syntactically expanded bounds: "+ltl); |
|
|
|
} |
|
|
|
|
|
|
|
if (useExternal) { |
|
|
|
result = convertLTLFormulaToDAWithExternalTool(ltl, constants, allowedAcceptance); |
|
|
|
} else { |
|
|
|
@ -137,6 +136,7 @@ public class LTL2DA extends PrismComponent |
|
|
|
// don't use LTL2WDBA translation yet |
|
|
|
boolean allowLTL2WDBA = false; |
|
|
|
if (allowLTL2WDBA) { |
|
|
|
|
|
|
|
LTLFragments fragments = LTLFragments.analyse(simpleLTL); |
|
|
|
mainLog.println(fragments); |
|
|
|
|
|
|
|
@ -157,9 +157,6 @@ public class LTL2DA extends PrismComponent |
|
|
|
result = LTL2Rabin.ltl2da(simpleLTL, allowedAcceptance); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new PrismNotSupportedException("Could not convert LTL formula to deterministic automaton, formula had time-bounds"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (result == null) { |
|
|
|
|