Skip to content

Commit 0b86a93

Browse files
committed
Separate clause counting and clause checking.
1 parent 690e34f commit 0b86a93

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/main/java/nl/uu/cs/ape/solver/minisat/SATSynthesisEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public boolean synthesisEncoding() throws IOException {
278278
* counted again.
279279
*/
280280
int variables = mappings.getSize();
281-
int clauses = APEUtils.countCNFClauses(new FileInputStream(cnfEncoding), false);
281+
int clauses = APEUtils.countCNFClauses(new FileInputStream(cnfEncoding));
282282
String satInputHeader = "p cnf " + variables + " " + clauses + "\n";
283283
APEUtils.timerRestartAndPrint(currLengthTimer, "Reading rows");
284284
satInputFile = APEFiles.prependToFile(satInputHeader, cnfEncoding);

src/main/java/nl/uu/cs/ape/utils/APEUtils.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -471,17 +471,11 @@ public static void timerPrintText(String timerID, String text) {
471471

472472
/**
473473
* This function counts the CNF clauses in a stream, assuming correct CNF syntax.
474-
* If verifyClauseSyntax is true, the syntax of the file is checked.
475474
*
476475
* @param cnfEncoding the CNF encoding
477-
* @param verifyClauseSyntax if the clause syntax shall be verified
478476
* @return the count of non-empty clauses
479477
*/
480-
public static int countCNFClauses(InputStream cnfEncoding, boolean verifyClauseSyntax) {
481-
482-
if (verifyClauseSyntax) {
483-
return countCNFClauses(cnfEncoding);
484-
}
478+
public static int countCNFClauses(InputStream cnfEncoding) {
485479

486480
int count = 0;
487481
try (BufferedReader b = new BufferedReader(new InputStreamReader(cnfEncoding))) {
@@ -503,7 +497,7 @@ public static int countCNFClauses(InputStream cnfEncoding, boolean verifyClauseS
503497
* @param cnfEncoding the CNF encoding
504498
* @return the count of non-empty clauses
505499
*/
506-
public static int countCNFClauses(InputStream cnfEncoding) {
500+
public static int checkCNFClauses(InputStream cnfEncoding) {
507501

508502
int clauseCount = 0;
509503
int litCount = 0;

0 commit comments

Comments
 (0)