@ -60,7 +60,8 @@ import acceptance.AcceptanceType;
public class LTL2DA extends PrismComponent
{
public LTL2DA ( PrismComponent parent ) throws PrismException {
public LTL2DA ( PrismComponent parent ) throws PrismException
{
super ( parent ) ;
}
@ -85,7 +86,8 @@ public class LTL2DA extends PrismComponent
* @param constants the values of constants , may be { @code null }
* @param allowedAcceptance the AcceptanceTypes that are allowed to be returned
* /
public DA < BitSet , ? extends AcceptanceOmega > convertLTLFormulaToDA ( Expression ltl , Values constants , AcceptanceType . . . allowedAcceptance ) throws PrismException
public DA < BitSet , ? extends AcceptanceOmega > convertLTLFormulaToDA ( Expression ltl , Values constants , AcceptanceType . . . allowedAcceptance )
throws PrismException
{
DA < BitSet , ? extends AcceptanceOmega > result = null ;
@ -95,8 +97,7 @@ public class LTL2DA extends PrismComponent
useExternal = false ;
}
if ( AcceptanceType . contains ( allowedAcceptance , AcceptanceType . RABIN ) & &
! useExternal ) {
if ( AcceptanceType . contains ( allowedAcceptance , AcceptanceType . RABIN ) & & ! useExternal ) {
/ / If we may construct a Rabin automaton , check the library first
try {
result = LTL2RabinLibrary . getDRAforLTL ( ltl , constants ) ;
@ -136,7 +137,8 @@ public class LTL2DA extends PrismComponent
return result ;
}
public DA < BitSet , ? extends AcceptanceOmega > convertLTLFormulaToDAWithExternalTool ( Expression ltl , Values constants , AcceptanceType . . . allowedAcceptance ) throws PrismException
public DA < BitSet , ? extends AcceptanceOmega > convertLTLFormulaToDAWithExternalTool ( Expression ltl , Values constants , AcceptanceType . . . allowedAcceptance )
throws PrismException
{
String ltl2daTool = getSettings ( ) . getString ( PrismSettings . PRISM_LTL2DA_TOOL ) ;
@ -198,7 +200,6 @@ public class LTL2DA extends PrismComponent
arguments . add ( ltl_file . getAbsolutePath ( ) ) ;
arguments . add ( da_file . getAbsolutePath ( ) ) ;
ProcessBuilder builder = new ProcessBuilder ( arguments ) ;
builder . redirectOutput ( tool_output ) ;
builder . redirectErrorStream ( true ) ;
@ -216,16 +217,13 @@ public class LTL2DA extends PrismComponent
}
if ( rv ! = 0 ) {
throw new PrismException ( "Call to external LTL->DA tool failed, return value = " + rv + ".\n"
+ "To investigate, please consult the following files:"
+ "\n LTL formula: " + ltl_file . getAbsolutePath ( )
+ "\n Automaton output: " + da_file . getAbsolutePath ( )
+ "\n Tool output (stdout and stderr): " + tool_output . getAbsolutePath ( )
+ "\n" ) ;
+ "To investigate, please consult the following files:" + "\n LTL formula: " + ltl_file . getAbsolutePath ( )
+ "\n Automaton output: " + da_file . getAbsolutePath ( ) + "\n Tool output (stdout and stderr): "
+ tool_output . getAbsolutePath ( ) + "\n" ) ;
}
tool_output . delete ( ) ;
try {
try {
HOAF2DA consumerDA = new HOAF2DA ( ) ;
@ -258,17 +256,11 @@ public class LTL2DA extends PrismComponent
}
}
} catch ( ParseException e ) {
throw new PrismException ( "Parse error: " + e . getMessage ( ) + ".\n"
+ "To investigate, please consult the following files:\n"
+ " LTL formula: " + ltl_file . getAbsolutePath ( )
+ "\n Automaton output: " + da_file . getAbsolutePath ( )
+ "\n" ) ;
throw new PrismException ( "Parse error: " + e . getMessage ( ) + ".\n" + "To investigate, please consult the following files:\n"
+ " LTL formula: " + ltl_file . getAbsolutePath ( ) + "\n Automaton output: " + da_file . getAbsolutePath ( ) + "\n" ) ;
} catch ( PrismException e ) {
throw new PrismException ( e . getMessage ( ) + ".\n"
+ "To investigate, please consult the following files:"
+ "\n LTL formula: " + ltl_file . getAbsolutePath ( )
+ "\n Automaton output: " + da_file . getAbsolutePath ( )
+ "\n" ) ;
throw new PrismException ( e . getMessage ( ) + ".\n" + "To investigate, please consult the following files:" + "\n LTL formula: "
+ ltl_file . getAbsolutePath ( ) + "\n Automaton output: " + da_file . getAbsolutePath ( ) + "\n" ) ;
}
da_file . delete ( ) ;
@ -286,7 +278,8 @@ public class LTL2DA extends PrismComponent
DA . switchAcceptance ( result , acceptance . toAcceptanceGeneric ( ) ) ;
return result ;
} else {
throw new PrismException ( "The external LTL->DA tool returned an automaton with " + acceptance . getTypeName ( ) + " acceptance, which is not yet supported for model checking this model / property" ) ;
throw new PrismException ( "The external LTL->DA tool returned an automaton with " + acceptance . getTypeName ( )
+ " acceptance, which is not yet supported for model checking this model / property" ) ;
}
}