Commit 52531b36 authored by Jonathan Shahen's avatar Jonathan Shahen

intermediate commit: pipeline works for converting to NuSMV, progress made on...

intermediate commit: pipeline works for converting to NuSMV, progress made on the template but more work still needed
parent 6b72b2d9
<NotepadPlus>
<UserLang name="Mohawk+T" ext=".mohawkt" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="yes" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="yes" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00// 01 02 03/* 04*/</Keywords>
<Keywords name="Numbers, prefix1">t</Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<Keywords name="Numbers, extras1"></Keywords>
<Keywords name="Numbers, extras2"></Keywords>
<Keywords name="Numbers, suffix1"></Keywords>
<Keywords name="Numbers, suffix2"></Keywords>
<Keywords name="Numbers, range"></Keywords>
<Keywords name="Operators1">~ &amp; &lt; &gt; , { }</Keywords>
<Keywords name="Operators2">NOT TRUE</Keywords>
<Keywords name="Folders in code1, open">{</Keywords>
<Keywords name="Folders in code1, middle"></Keywords>
<Keywords name="Folders in code1, close">}</Keywords>
<Keywords name="Folders in code2, open"></Keywords>
<Keywords name="Folders in code2, middle"></Keywords>
<Keywords name="Folders in code2, close"></Keywords>
<Keywords name="Folders in comment, open"></Keywords>
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">CanAssign CanRevoke CanDisable CanEnable Query Expected</Keywords>
<Keywords name="Keywords2">UNKNOWN GOAL_REACHABLE REACHABLE</Keywords>
<Keywords name="Keywords3">GOAL_UNREACHABLE UNREACHABLE</Keywords>
<Keywords name="Keywords4"></Keywords>
<Keywords name="Keywords5"></Keywords>
<Keywords name="Keywords6"></Keywords>
<Keywords name="Keywords7"></Keywords>
<Keywords name="Keywords8"></Keywords>
<Keywords name="Delimiters">00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" fgColor="00A600" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="256" />
<WordsStyle name="LINE COMMENTS" fgColor="00A600" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" />
<WordsStyle name="NUMBERS" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS1" fgColor="C8002A" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS2" fgColor="2A00FF" bgColor="FFFFFF" fontName="" fontStyle="4" nesting="0" />
<WordsStyle name="KEYWORDS3" fgColor="D75D00" bgColor="FFFFFF" fontName="" fontStyle="4" nesting="0" />
<WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="OPERATORS" fgColor="7F0055" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>
...@@ -54,7 +54,7 @@ public class ConverterCUI { ...@@ -54,7 +54,7 @@ public class ConverterCUI {
break; break;
} }
if (cmd.equals("!prev")) { if (cmd.equals("!p")) {
argv.clear(); argv.clear();
argv.addAll(Arrays.asList(previousCmd.split(" "))); argv.addAll(Arrays.asList(previousCmd.split(" ")));
break; break;
...@@ -67,7 +67,7 @@ public class ConverterCUI { ...@@ -67,7 +67,7 @@ public class ConverterCUI {
System.out.println("Commands: " + argv); System.out.println("Commands: " + argv);
try { try {
if (!cmd.equals("!prev")) { if (!cmd.equals("!p")) {
FileWriter fw; FileWriter fw;
fw = new FileWriter(previousCommandFilename, false); fw = new FileWriter(previousCommandFilename, false);
fw.write(fullCommand.toString()); fw.write(fullCommand.toString());
...@@ -147,13 +147,15 @@ public class ConverterCUI { ...@@ -147,13 +147,15 @@ public class ConverterCUI {
+ OptionString.LOGLEVEL.c("quiet") + "!exit"); + OptionString.LOGLEVEL.c("quiet") + "!exit");
System.out.println(OptionString.TO_MOHAWK.c() + OptionString.SPECFILE.c("data/bug/11-CA-no-role3.mohawk.T") System.out.println(OptionString.TO_MOHAWK.c() + OptionString.SPECFILE.c("data/bug/11-CA-no-role3.mohawk.T")
+ OptionString.LOGLEVEL.c("quiet") + "!exit"); + OptionString.LOGLEVEL.c("quiet") + "!exit");
System.out.println("");
System.out.println(OptionString.TO_NUSMV.c() + OptionString.SPECFILE.c("data/nusmv/test01.mohawkt") + "!exit");
System.out.println(""); System.out.println("");
try { try {
BufferedReader bfr = new BufferedReader(new FileReader(previousCommandFilename)); BufferedReader bfr = new BufferedReader(new FileReader(previousCommandFilename));
previousCmd = bfr.readLine(); previousCmd = bfr.readLine();
bfr.close(); bfr.close();
System.out.println("Previous Command ('!prev' to use the previous command): " + previousCmd); System.out.println("Previous Command ('!p' to use the previous command): " + previousCmd);
} catch (IOException e) { } catch (IOException e) {
System.out.println("[ERROR] Unable to load previous command!"); System.out.println("[ERROR] Unable to load previous command!");
} }
......
package mohawk.converter; package mohawk.converter;
import java.io.File; import java.io.*;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.ConsoleHandler; import java.util.logging.*;
import java.util.logging.FileHandler;
import java.util.logging.Handler; import org.apache.commons.cli.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import mohawk.converter.helper.SpecHelper; import mohawk.converter.helper.SpecHelper;
...@@ -28,8 +14,6 @@ import mohawk.converter.to.asaptime.ConvertToASAPTimeNSA; ...@@ -28,8 +14,6 @@ import mohawk.converter.to.asaptime.ConvertToASAPTimeNSA;
import mohawk.converter.to.asaptime.ConvertToASAPTimeSA; import mohawk.converter.to.asaptime.ConvertToASAPTimeSA;
import mohawk.converter.to.mohawk.ConvertToMohawk; import mohawk.converter.to.mohawk.ConvertToMohawk;
import mohawk.converter.to.nusmv.ConvertToNuSMV; import mohawk.converter.to.nusmv.ConvertToNuSMV;
import mohawk.converter.to.nusmv.ConvertToNuSMVReduction2;
import mohawk.converter.to.nusmv.ConvertToNuSMVReduction3;
import mohawk.converter.to.tred.ConvertToTRole; import mohawk.converter.to.tred.ConvertToTRole;
import mohawk.global.FileExtensions; import mohawk.global.FileExtensions;
import mohawk.global.helper.RoleHelper; import mohawk.global.helper.RoleHelper;
...@@ -39,639 +23,581 @@ import mohawk.global.pieces.Rule; ...@@ -39,639 +23,581 @@ import mohawk.global.pieces.Rule;
import mohawk.global.timing.MohawkTiming; import mohawk.global.timing.MohawkTiming;
public class ConverterInstance { public class ConverterInstance {
private static final String VERSION = "v1.3.1"; private static final String VERSION = "v1.3.1";
private static final String AUTHORS = "Jonathan Shahen <jmshahen@uwaterloo.ca>"; private static final String AUTHORS = "Jonathan Shahen <jmshahen@uwaterloo.ca>";
// Logger Fields /*Logger Fields*/
public static final Logger logger = Logger.getLogger("mohawk"); public static final Logger logger = Logger.getLogger("mohawk");
private String Logger_filepath = "mohawk-converter.log.csv"; private String Logger_filepath = "mohawk-converter.log.csv";
private String Logger_folderpath = "logs"; private String Logger_folderpath = "logs";
private ConsoleHandler consoleHandler = new ConsoleHandler(); private ConsoleHandler consoleHandler = new ConsoleHandler();
private Level LoggerLevel; private Level LoggerLevel;
private FileHandler fileHandler; private FileHandler fileHandler;
private Boolean WriteCSVFileHeader = true; private Boolean WriteCSVFileHeader = true;
private String resultsFile = "latest_Mohawk-T_Converter_Results.csv"; private String resultsFile = "latest_Mohawk-T_Converter_Results.csv";
// Helpers /* Helpers*/
public SpecHelper specHelper = new SpecHelper(); public SpecHelper specHelper = new SpecHelper();
public MohawkTiming timing = new MohawkTiming(); public MohawkTiming timing = new MohawkTiming();
public FileExtensions fileExt = new FileExtensions(); public FileExtensions fileExt = new FileExtensions();
private CommandLine init(String[] args) throws Exception { private CommandLine init(String[] args) throws Exception {
Options options = new Options(); Options options = new Options();
setupOptions(options); setupOptions(options);
CommandLineParser cmdParser = new BasicParser(); CommandLineParser cmdParser = new BasicParser();
CommandLine cmd = cmdParser.parse(options, args); CommandLine cmd = cmdParser.parse(options, args);
setupLoggerOptions(cmd, options); setupLoggerOptions(cmd, options);
if (setupReturnImmediatelyOptions(cmd, options)) { if (setupReturnImmediatelyOptions(cmd, options)) { return null; }
return null;
} /* Timing */timing.startTimer("totalTime");
/* Timing */timing.startTimer("totalTime"); setupUserPreferenceOptions(cmd, options);
setupSpecOptions(cmd, options);
setupUserPreferenceOptions(cmd, options); setupResultOptions(cmd, options);
setupSpecOptions(cmd, options);
setupResultOptions(cmd, options); return cmd;
}
return cmd;
} public int run(String[] args) {
try {
public int run(String[] args) { CommandLine cmd = init(args);
try {
CommandLine cmd = init(args); if (cmd == null) { return 0; }
if (cmd == null) { /* Timing */timing.startTimer("loadFile");
return 0; specHelper.loadSpecFiles();
} /* Timing */timing.stopTimer("loadFile");
/* Timing */timing.startTimer("loadFile"); logger.info("Spec File(s) to Convert: " + specHelper.specFiles);
specHelper.loadSpecFiles(); for (Integer i = 1; i <= specHelper.specFiles.size(); i++) {
/* Timing */timing.stopTimer("loadFile"); File specFile = specHelper.specFiles.get(i - 1);
logger.info("Spec File(s) to Convert: " + specHelper.specFiles); /* Timing */timing.startTimer("parseFile (" + i + ")");
for (Integer i = 1; i <= specHelper.specFiles.size(); i++) { logger.info("Processing File (" + i + "/" + specHelper.specFiles.size() + "): "
File specFile = specHelper.specFiles.get(i - 1); + specFile.getAbsolutePath());
/* Timing */timing.startTimer("parseFile (" + i + ")"); MohawkTARBACParser parser = specHelper.parseMohawkTFile(specFile);
logger.info("Processing File (" + i + "/" /* Timing */timing.stopTimer("parseFile (" + i + ")");
+ specHelper.specFiles.size() + "): "
+ specFile.getAbsolutePath()); MohawkT m = parser.mohawkT;
MohawkTARBACParser parser = specHelper if (specHelper.error.errorFound) {
.parseMohawkTFile(specFile); logger.warning("[PARSING ERROR] Skipping this file due to a parsing error");
/* Timing */timing.stopTimer("parseFile (" + i + ")"); continue;
} else {
MohawkT m = parser.mohawkT; logger.info("No errors found while parsing file, continuing on to converting");
}
if (specHelper.error.errorFound) {
logger.warning( /*ONLY reductions instead of full reductions up here*/
"[PARSING ERROR] Skipping this file due to a parsing error"); if (cmd.hasOption(OptionString.ONLYREDUCTION.toString())) {
continue; String onlyOpt = cmd.getOptionValue(OptionString.ONLYREDUCTION.toString());
} else {
logger.info( ArrayList<Rule> workableRules = null;
"No errors found while parsing file, continuing on to converting"); RoleHelper roleHelper = new RoleHelper(m.roleHelper);
} MohawkT m2 = new MohawkT();
if (onlyOpt.equals("enable1")) {
// ONLY reductions instead of full reductions up here workableRules = roleHelper.removeEnableDisableRules(m.getAllRules());
if (cmd.hasOption(OptionString.ONLYREDUCTION.toString())) {
String onlyOpt = cmd.getOptionValue( m2.generatorName = "Remove CanEnable v1";
OptionString.ONLYREDUCTION.toString()); } else if (onlyOpt.equals("enable2")) {
workableRules = roleHelper.removeEnableDisableRulesv2(m.getAllRules());
ArrayList<Rule> workableRules = null;
RoleHelper roleHelper = new RoleHelper(m.roleHelper); m2.generatorName = "Remove CanEnable v2";
MohawkT m2 = new MohawkT(); }
if (onlyOpt.equals("enable1")) {
workableRules = roleHelper if (workableRules != null) {
.removeEnableDisableRules(m.getAllRules()); m2.query = m.query;
m2.roleHelper = m.roleHelper;
m2.generatorName = "Remove CanEnable v1"; m2.timeIntervalHelper = m.timeIntervalHelper;
} else if (onlyOpt.equals("enable2")) { m2.expectedResult = m.expectedResult;
workableRules = roleHelper
.removeEnableDisableRulesv2(m.getAllRules()); m2.addRules(workableRules);
m2.generatorName = "Remove CanEnable v2"; FileWriter fw = new FileWriter(specFile.getAbsolutePath() + "_ONLY_" + onlyOpt);
} fw.write(m2.getString(null, true, true));
fw.close();
if (workableRules != null) { }
m2.query = m.query; } else {
m2.roleHelper = m.roleHelper; if (cmd.hasOption(OptionString.TO_ASAPTIME_NSA.toString())
m2.timeIntervalHelper = m.timeIntervalHelper; || cmd.hasOption(OptionString.TO_ALL.toString())) {
m2.expectedResult = m.expectedResult; logger.info("[CONVERTING] Converting to ASAPTime NSA... " + specFile.getName());
/* Timing */timing.startTimer("convertToASAPTimeNSA (" + i + ")");
m2.addRules(workableRules);
ConvertToASAPTimeNSA toASAPTimeNSA = new ConvertToASAPTimeNSA(timing);
FileWriter fw = new FileWriter( toASAPTimeNSA.convert(m, specFile, true);
specFile.getAbsolutePath() + "_ONLY_"
+ onlyOpt); if (toASAPTimeNSA.lastError == null) {
fw.write(m2.getString(null, true, true)); logger.info("[SUCCESS] Successfully converted to ASAPTimeNSA's Input Format");
fw.close(); } else {
} logger.warning("[FAILURE] Failed to convert to ASAPTimeNSA's Input Format; Error code "
} else { + toASAPTimeNSA.lastError);
if (cmd.hasOption(OptionString.TO_ASAPTIME_NSA.toString()) }
|| cmd.hasOption(OptionString.TO_ALL.toString())) {
logger.info( /* Timing */timing.stopTimer("convertToASAPTimeNSA (" + i + ")");
"[CONVERTING] Converting to ASAPTime NSA... " logger.info("[CONVERTING] ...Done Converting to ASAPTime NSA");
+ specFile.getName()); }
/* Timing */timing
.startTimer("convertToASAPTimeNSA (" + i + ")"); if (cmd.hasOption(OptionString.TO_ASAPTIME_SA.toString())
|| cmd.hasOption(OptionString.TO_ALL.toString())) {
ConvertToASAPTimeNSA toASAPTimeNSA = new ConvertToASAPTimeNSA( logger.info("[CONVERTING] Converting to ASAPTime SA... " + specFile.getName());
timing); /* Timing */timing.startTimer("convertToASAPTimeSA (" + i + ")");
toASAPTimeNSA.convert(m, specFile, true);
ConvertToASAPTimeSA toASAPTimeSA = new ConvertToASAPTimeSA(timing);
if (toASAPTimeNSA.lastError == null) { toASAPTimeSA.convert(m, specFile, true);
logger.info(
"[SUCCESS] Successfully converted to ASAPTimeNSA's Input Format"); if (toASAPTimeSA.lastError == null) {
} else { logger.info("[SUCCESS] Successfully converted to ASAPTimeSA's Input Format");
logger.warning( } else {
"[FAILURE] Failed to convert to ASAPTimeNSA's Input Format; Error code " logger.warning("[FAILURE] Failed to convert to ASAPTimeSA's Input Format; Error code "
+ toASAPTimeNSA.lastError); + toASAPTimeSA.lastError);
} }
/* Timing */timing /* Timing */timing.stopTimer("convertToASAPTimeSA (" + i + ")");
.stopTimer("convertToASAPTimeNSA (" + i + ")"); logger.info("[CONVERTING] ...Done Converting to ASAPTime SA");
logger.info( }
"[CONVERTING] ...Done Converting to ASAPTime NSA");
} if (cmd.hasOption(OptionString.TO_TROLE.toString())
|| cmd.hasOption(OptionString.TO_ALL.toString())) {
if (cmd.hasOption(OptionString.TO_ASAPTIME_SA.toString()) logger.info("[CONVERTING] Converting to TRole... "
|| cmd.hasOption(OptionString.TO_ALL.toString())) { + specFile.getName());
logger.info("[CONVERTING] Converting to ASAPTime SA... " /* Timing */timing
+ specFile.getName()); .startTimer("convertToTRole (" + i + ")");
/* Timing */timing
.startTimer("convertToASAPTimeSA (" + i + ")"); ConvertToTRole toTRole = new ConvertToTRole(timing);
toTRole.convert(m, specFile, true);
ConvertToASAPTimeSA toASAPTimeSA = new ConvertToASAPTimeSA(
timing); if (toTRole.lastError == null) {
toASAPTimeSA.convert(m, specFile, true); logger.info(
"[SUCCESS] Successfully converted to TRole Input Format");
if (toASAPTimeSA.lastError == null) { } else {
logger.info( logger.warning(
"[SUCCESS] Successfully converted to ASAPTimeSA's Input Format"); "[FAILURE] Failed to convert to TRole Input Format; Error code "
} else { + toTRole.lastError);
logger.warning( }
"[FAILURE] Failed to convert to ASAPTimeSA's Input Format; Error code "
+ toASAPTimeSA.lastError); /* Timing */timing
} .stopTimer("convertToTRole (" + i + ")");
logger.info("[CONVERTING] ...Done Converting to TRole");
/* Timing */timing }
.stopTimer("convertToASAPTimeSA (" + i + ")");
logger.info( if (cmd.hasOption(OptionString.TO_MOHAWK.toString())
"[CONVERTING] ...Done Converting to ASAPTime SA"); || cmd.hasOption(OptionString.TO_ALL.toString())) {
} logger.info("[CONVERTING] Converting to Mohawk... "
+ specFile.getName());
if (cmd.hasOption(OptionString.TO_TROLE.toString()) /* Timing */timing
|| cmd.hasOption(OptionString.TO_ALL.toString())) { .startTimer("convertToMohawk (" + i + ")");
logger.info("[CONVERTING] Converting to TRole... "
+ specFile.getName()); ConvertToMohawk toMohawk = new ConvertToMohawk(timing);
/* Timing */timing
.startTimer("convertToTRole (" + i + ")"); if (cmd.hasOption(
OptionString.SHORT_ROLENAMES.toString())) {
ConvertToTRole toTRole = new ConvertToTRole(timing); logger.fine("[OPTION] Short Rolenames: Enabled");
toTRole.convert(m, specFile, true); toMohawk.shortRolenames = true;
} else {
if (toTRole.lastError == null) { logger.fine("[OPTION] Short Rolenames: Disabled");
logger.info( }
"[SUCCESS] Successfully converted to TRole Input Format");
} else { toMohawk.convert(m, specFile, true);
logger.warning(
"[FAILURE] Failed to convert to TRole Input Format; Error code " if (toMohawk.lastError == null) {
+ toTRole.lastError); logger.info(
} "[SUCCESS] Successfully converted to Mohawk's Input Format");
} else {
/* Timing */timing logger.warning(
.stopTimer("convertToTRole (" + i + ")"); "[FAILURE] Failed to convert to Mohawk's Input Format; Error code "
logger.info("[CONVERTING] ...Done Converting to TRole"); + toMohawk.lastError);
} }
if (cmd.hasOption(OptionString.TO_MOHAWK.toString()) /* Timing */timing
|| cmd.hasOption(OptionString.TO_ALL.toString())) { .stopTimer("convertToMohawk (" + i + ")");
logger.info("[CONVERTING] Converting to Mohawk... " logger.info(
+ specFile.getName()); "[CONVERTING] ...Done Converting to Mohawk");
/* Timing */timing }
.startTimer("convertToMohawk (" + i + ")");
if (cmd.hasOption(OptionString.TO_MOHAWK_T.toString())) {
ConvertToMohawk toMohawk = new ConvertToMohawk(timing); logger.info("[CONVERTING] Converting to Mohawk-T... "
+ specFile.getName());
if (cmd.hasOption( /* Timing */timing
OptionString.SHORT_ROLENAMES.toString())) { .startTimer("convertToMohawkT (" + i + ")");
logger.fine("[OPTION] Short Rolenames: Enabled");
toMohawk.shortRolenames = true; FileWriter fw = new FileWriter(
} else { specFile.getAbsolutePath() + "_2");
logger.fine("[OPTION] Short Rolenames: Disabled"); fw.write(m.getString("\n\n", true, true));
} fw.close();
toMohawk.convert(m, specFile, true); /* Timing */timing
.stopTimer("convertToMohawkT (" + i + ")");
if (toMohawk.lastError == null) { logger.info(
logger.info( "[CONVERTING] ...Done Converting to Mohawk-T");
"[SUCCESS] Successfully converted to Mohawk's Input Format"); }
} else {
logger.warning( if (cmd.hasOption(OptionString.TO_NUSMV.toString())
"[FAILURE] Failed to convert to Mohawk's Input Format; Error code " || cmd.hasOption(OptionString.TO_ALL.toString())) {
+ toMohawk.lastError); logger.info("[CONVERTING] Converting to NuSMV... "
} + specFile.getName());
/* Timing */timing
/* Timing */timing .startTimer("convertToNuSMV (" + i + ")");
.stopTimer("convertToMohawk (" + i + ")");
logger.info( ConvertToNuSMV toNuSMV = new ConvertToNuSMV(timing);
"[CONVERTING] ...Done Converting to Mohawk");
} toNuSMV.convert(m, specFile, true);
if (cmd.hasOption(OptionString.TO_MOHAWK_T.toString())) { if (toNuSMV.lastError == null) {
logger.info("[CONVERTING] Converting to Mohawk-T... " logger.info("[SUCCESS] Successfully converted to Mohawk's Input Format");
+ specFile.getName()); } else {
/* Timing */timing logger.warning("[FAILURE] Failed to convert to Mohawk's Input Format; Error code "
.startTimer("convertToMohawkT (" + i + ")"); + toNuSMV.lastError);
}
FileWriter fw = new FileWriter(
specFile.getAbsolutePath() + "_2"); /* Timing */timing.stopTimer("convertToNuSMV (" + i + ")");
fw.write(m.getString("\n\n", true, true)); logger.info("[CONVERTING] ...Done Converting to Mohawk");
fw.close(); }
}
/* Timing */timing }
.stopTimer("convertToMohawkT (" + i + ")"); /* Timing */timing.stopTimer("totalTime");
logger.info(
"[CONVERTING] ...Done Converting to Mohawk-T"); logger.info(timing.toString());
}
} catch (Exception e) {
if (cmd.hasOption(OptionString.TO_NUSMV.toString()) StringWriter errors = new StringWriter();
|| cmd.hasOption(OptionString.TO_ALL.toString())) { e.printStackTrace(new PrintWriter(errors));
logger.info("[CONVERTING] Converting to NuSMV... " logger.severe(errors.toString());
+ specFile.getName()); logger.severe(e.getMessage());
/* Timing */timing }
.startTimer("convertToNuSMV (" + i + ")");
logger.info("[EOF] Converter Instance done running");
ConvertToNuSMV toNuSMV = null;
for (Handler h : logger.getHandlers()) {