if (commandLine.hasOption(FIND_HSS_ROUTE_OPTION))
{
String hssPath = commandLine.getOptionValue(FIND_HSS_ROUTE_OPTION);
stopWatch.start("Load HSS from " + hssPath);
ObjectArrayList hss = Helper.loadHSS(hssPath);
stopWatch.stop();
stopWatch.printElapsed();
findHSSRoute(commandLine, formulaFile, statistics, stopWatch, formula, null, null, hss, hssPath);
return;
}
if (commandLine.hasOption(EVALUATE_OPTION))
{
String resultsFilename = commandLine.getOptionValue(EVALUATE_OPTION);
boolean satisfiable = evaluateFormula(stopWatch, formula, resultsFilename);
if (satisfiable)
{
System.out.println("Formula evaluated as SAT");
}
else
{
System.out.println("Formula evaluated as UNSAT");
}
// Only evaluate formula value
return;
}
// Find if formula is SAT
// Clone initial formula to verify formula satisfiability later
ITabularFormula formulaClone = null;
if (Helper.EnableAssertions)
{
stopWatch.start("Clone initial formula");
formulaClone = formula.clone();
stopWatch.stop();
stopWatch.printElapsed();
}
stopWatch.start("Create CTF");
ObjectArrayList ct = Helper.createCTF(formula);
timeElapsed = stopWatch.stop();
printFormulas(ct);
stopWatch.printElapsed();
statistics.put(Helper.CTF_CREATION_TIME, String.valueOf(timeElapsed));
statistics.put(Helper.CTF_COUNT, String.valueOf(ct.size()));
LOGGER.info("CTF count: {}", ct.size());
if (Helper.EnableAssertions)
{
assertNoTripletsLost(formula, ct);
}
// Clone CTF to verify formula satisfiability against it later
ObjectArrayList ctfClone = null;
if (Helper.EnableAssertions)
{
ctfClone = Helper.cloneStructures(ct);
}
stopWatch.start("Create CTS");
Helper.completeToCTS(ct, formula.getPermutation());
timeElapsed = stopWatch.stop();
printFormulas(ct);
stopWatch.printElapsed();
statistics.put(Helper.CTS_CREATION_TIME, String.valueOf(timeElapsed));
if (commandLine.hasOption(CREATE_SKT_OPTION))
{
String sktFilename = formulaFile + ".skt";
stopWatch.start("Convert CTS to " + sktFilename);
Helper.convertCTStructuresToRomanovSKTFileFormat(ct, sktFilename);
stopWatch.stop();
stopWatch.printElapsed();
return;
}
ObjectArrayList hss = unifyAndCreateHSS(statistics, stopWatch, ct);
String hssPath = formulaFile + "-hss";
stopWatch.start("Save HSS to " + hssPath + "...");
Helper.saveHSS(hssPath, hss);
stopWatch.stop();