|
|
@ -1034,18 +1034,7 @@ public class Prism implements PrismSettingsListener |
|
|
*/ |
|
|
*/ |
|
|
public static List<String> getListOfKeyords() |
|
|
public static List<String> getListOfKeyords() |
|
|
{ |
|
|
{ |
|
|
try { |
|
|
|
|
|
// obtain exclusive access to the prism parser |
|
|
|
|
|
// (don't forget to release it afterwards) |
|
|
|
|
|
try { |
|
|
|
|
|
return getPrismParser().getListOfKeywords(); |
|
|
|
|
|
} finally { |
|
|
|
|
|
// release prism parser |
|
|
|
|
|
releasePrismParser(); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (InterruptedException ie) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return PrismParser.getListOfKeywords(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
@ -2679,6 +2668,41 @@ public class Prism implements PrismSettingsListener |
|
|
tmpLog.close(); |
|
|
tmpLog.close(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void explicitBuildTest() throws PrismException |
|
|
|
|
|
{ |
|
|
|
|
|
/* old code... |
|
|
|
|
|
String tmpFile = ""; |
|
|
|
|
|
try { |
|
|
|
|
|
explicit.ConstructModel constructModel = new explicit.ConstructModel(getSimulator(), mainLog); |
|
|
|
|
|
mainLog.println("\nConstructing model explicitly..."); |
|
|
|
|
|
explicit.Model modelExplicit = constructModel.constructModel(currentModulesFile); |
|
|
|
|
|
tmpFile = File.createTempFile("explicitbuildtest", ".tra").getAbsolutePath(); |
|
|
|
|
|
tmpFile = "explicitbuildtest.tra"; |
|
|
|
|
|
mainLog.println("\nExporting (explicit) model to \"" + tmpFile + "1\"..."); |
|
|
|
|
|
modelExplicit.exportToPrismExplicitTra(tmpFile + "1"); |
|
|
|
|
|
mainLog.println("\nExporting (normal) model to \"" + tmpFile + "2\"..."); |
|
|
|
|
|
exportTransToFile(true, Prism.EXPORT_PLAIN, new File(tmpFile + "2")); |
|
|
|
|
|
explicit.ModelSimple modelExplicit2 = null; |
|
|
|
|
|
switch (currentModelType) { |
|
|
|
|
|
case DTMC: |
|
|
|
|
|
modelExplicit2 = new explicit.DTMCSimple(); |
|
|
|
|
|
break; |
|
|
|
|
|
case CTMC: |
|
|
|
|
|
modelExplicit2 = new explicit.CTMCSimple(); |
|
|
|
|
|
break; |
|
|
|
|
|
case MDP: |
|
|
|
|
|
modelExplicit2 = new explicit.MDPSimple(); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
modelExplicit2.buildFromPrismExplicit(tmpFile + "2"); |
|
|
|
|
|
if (!modelExplicit.equals(modelExplicit2)) { |
|
|
|
|
|
throw new PrismException("Explicit models differ"); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
throw new PrismException("Could not create temporary file \"" + tmpFile + "\""); |
|
|
|
|
|
}*/ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Clear the built model if needed (free/deallocate memory etc) |
|
|
* Clear the built model if needed (free/deallocate memory etc) |
|
|
*/ |
|
|
*/ |
|
|
|