]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Updating CryptoMiniSat to r586. Need to call 'void needLibraryCNFFile(const char...
authormsoos <msoos@e59a4935-1847-0410-ae03-e826735625c1>
Tue, 8 Dec 2009 13:31:11 +0000 (13:31 +0000)
committermsoos <msoos@e59a4935-1847-0410-ae03-e826735625c1>
Tue, 8 Dec 2009 13:31:11 +0000 (13:31 +0000)
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@483 e59a4935-1847-0410-ae03-e826735625c1

18 files changed:
src/sat/cryptominisat2/Clause.h
src/sat/cryptominisat2/ClauseCleaner.cpp
src/sat/cryptominisat2/Conglomerate.cpp
src/sat/cryptominisat2/Conglomerate.h
src/sat/cryptominisat2/FindUndef.cpp
src/sat/cryptominisat2/FindUndef.h
src/sat/cryptominisat2/Gaussian.cpp
src/sat/cryptominisat2/Gaussian.h
src/sat/cryptominisat2/MatrixFinder.cpp
src/sat/cryptominisat2/PackedRow.cpp
src/sat/cryptominisat2/Solver.cpp
src/sat/cryptominisat2/Solver.h
src/sat/cryptominisat2/VERSION
src/sat/cryptominisat2/VarReplacer.cpp
src/sat/cryptominisat2/VarReplacer.h
src/sat/cryptominisat2/XorFinder.cpp
src/sat/cryptominisat2/constants.h
src/sat/cryptominisat2/time_mem.h

index 1c648361aa9c35a3d71b6cbed4b14cd823660598..a95ffade3f885f168962443f5abca173a9d3155e 100644 (file)
@@ -140,9 +140,9 @@ public:
     }
     void print() {
         printf("Clause   group: %d, size: %d, learnt:%d, lits: ", group, size(), learnt());
-        plain_print();
+        plainPrint();
     }
-    void plain_print(FILE* to = stdout) const {
+    void plainPrint(FILE* to = stdout) const {
         for (uint i = 0; i < size(); i++) {
             if (data[i].sign()) fprintf(to, "-");
             fprintf(to, "%d ", data[i].var() + 1);
@@ -189,10 +189,10 @@ public:
 
     void print() {
         printf("XOR Clause   group: %d, size: %d, learnt:%d, lits:\"", group, size(), learnt());
-        plain_print();
+        plainPrint();
     }
     
-    void plain_print(FILE* to = stdout) const {
+    void plainPrint(FILE* to = stdout) const {
         fprintf(to, "x");
         if (xor_clause_inverted())
             printf("-");
index e7e23cfd65a6b4ea7e7db08d6eb6bac8bfd504e3..114a3df9a869043c8cab115fc956ecf412f3a4e3 100644 (file)
@@ -1,3 +1,20 @@
+/***********************************************************************************
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**************************************************************************************************/
+
 #include "ClauseCleaner.h"
 
 namespace MINISAT
@@ -139,7 +156,7 @@ void ClauseCleaner::cleanClauses(vec<XorClause*>& cs, ClauseSetType type)
             vec<Lit> ps(2);
             ps[0] = c[0].unsign();
             ps[1] = c[1].unsign();
-            solver.toReplace->replace(ps, c.xor_clause_inverted(), c.group);
+            solver.varReplacer->replace(ps, c.xor_clause_inverted(), c.group);
             solver.removeClause(c);
             s++;
         } else
index e4454f6a00e6982b8a79099e4bca7cc617a8732c..f8ecf0cab14eeebf91a0d17a1f5437391b9015aa 100644 (file)
@@ -1,3 +1,20 @@
+/***********************************************************************************
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**************************************************************************************************/
+
 #include "Conglomerate.h"
 #include "Solver.h"
 #include "VarReplacer.h"
@@ -61,7 +78,7 @@ void Conglomerate::fillVarToXor()
     for (Lit* it = &(S->trail[0]), *end = it + S->trail.size(); it != end; it++)
         blocked[it->var()] = true;
     
-    const vec<Clause*>& clauses = S->toReplace->getClauses();
+    const vec<Clause*>& clauses = S->varReplacer->getClauses();
     for (Clause *const*it = clauses.getData(), *const*end = it + clauses.size(); it != end; it++) {
         const Clause& c = **it;
         for (const Lit* a = &c[0], *end = a + c.size(); a != end; a++) {
@@ -227,7 +244,7 @@ bool Conglomerate::dealWithNewClause(vec<Lit>& ps, const bool inverted, const ui
             free(newX);
             #endif
             
-            S->toReplace->replace(ps, inverted, old_group);
+            S->varReplacer->replace(ps, inverted, old_group);
             blocked[ps[0].var()] = true;
             blocked[ps[1].var()] = true;
             break;
index d0eeb7c9b08b32d3ebee14cc5b3d238e7322afed..6fe755666fda7290c6a4a5e60c76fbe3b4991bf0 100644 (file)
@@ -1,3 +1,20 @@
+/***********************************************************************************
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**************************************************************************************************/
+
 #ifndef CONGLOMERATE_H
 #define CONGLOMERATE_H
 
index 1fdff06ed834329a4b00be82b11290f7a41ed9d8..7d7b0a2806b712c8c84483b51ddc0cbdb8f702b8 100644 (file)
@@ -1,3 +1,20 @@
+/***********************************************************************************
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**************************************************************************************************/
+
 #include "FindUndef.h"
 
 #include "Solver.h"
@@ -43,7 +60,7 @@ void FindUndef::fillPotential()
         }
     }
     
-    vector<Var> replacingVars = S.toReplace->getReplacingVars();
+    vector<Var> replacingVars = S.varReplacer->getReplacingVars();
     for (Var *it = &replacingVars[0], *end = it + replacingVars.size(); it != end; it++) {
         if (isPotential[*it]) {
             isPotential[*it] = false;
index e47a90411580f1843db48ef6cab7586a20766fce..59835c22eb11c68ef694af8ff56ae2ec923d0703 100644 (file)
@@ -1,3 +1,20 @@
+/***********************************************************************************
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**************************************************************************************************/
+
 #ifndef FINDUNDEF_H
 #define FINDUNDEF_H
 
index a4c6798f311d2fde6973482209fb798d7b02faea..f589ee88a40fcd1544d946dab1f9000d681f8f13 100644 (file)
@@ -22,6 +22,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "Clause.h"
 #include <algorithm>
 #include "ClauseCleaner.h"
+
 using std::ostream;
 using std::cout;
 using std::endl;
@@ -908,6 +909,12 @@ void Gaussian::print_stats() const
         std::cout << " Gauss(" << matrix_no << ") not called.";
 }
 
+void Gaussian::print_matrix_stats() const
+{
+    cout << "matrix size: " << cur_matrixset.num_rows << "  x " << cur_matrixset.num_cols << endl;
+}
+
+
 void Gaussian::reset_stats()
 {
     useful_prop = 0;
index 1d692e799f21c87fe6b343b5adde569ec2a54187..00e9eb533f65a436ae8d2b0b5ca0f698bf5ee78e 100644 (file)
@@ -29,9 +29,11 @@ namespace MINISAT
 {
 using namespace MINISAT;
 
+#ifdef VERBOSE_DEBUG
 using std::vector;
 using std::cout;
 using std::endl;
+#endif
 
 class Clause;
 
@@ -196,11 +198,6 @@ inline void Gaussian::canceling(const int sublevel)
     }
 }
 
-inline void Gaussian::print_matrix_stats() const
-{
-    cout << "matrix size: " << cur_matrixset.num_rows << "  x " << cur_matrixset.num_cols << endl;
-}
-
 std::ostream& operator << (std::ostream& os, const vec<Lit>& v);
 };
 
index 19c8ad60e961f8a959baba2fd623771c9fcb07ab..f4acd1d5a84922d922e1ac0049211c7f62254f48 100644 (file)
@@ -34,10 +34,8 @@ using std::map;
 
 //#define VERBOSE_DEBUG
 
-#ifdef VERBOSE_DEBUG
 using std::cout;
 using std::endl;
-#endif
 
 //#define PART_FINDING
 
@@ -215,8 +213,8 @@ void MatrixFinder::findParts(vector<Var>& xorFingerprintInMatrix, vector<XorClau
             const Var fingerprint2 = xorFingerprintInMatrix[ai2];
             if (((fingerprint & fingerprint2) == fingerprint) && firstPartOfSecond(**a, **a2)) {
                 cout << "First part of second:" << endl;
-                (*a)->plain_print();
-                (*a2)->plain_print();
+                (*a)->plainPrint();
+                (*a2)->plainPrint();
                 cout << "END" << endl;
             }
         }
index 0689c0dd3735ab7b613f2ac12e4dbad90f87f504..25d2a321a6a0698b36479fe7b0f572073845c911 100644 (file)
@@ -1,3 +1,20 @@
+/***********************************************************************************
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**************************************************************************************************/
+
 #include "PackedRow.h"
 namespace MINISAT
 {
index a7acf2a8c0b86d729add58d4ddd569e9cd1df0ce..490d6c532857879feef5023b24195b9aeacddfbc 100644 (file)
@@ -38,14 +38,6 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
 #include "XorFinder.h"
 #include "ClauseCleaner.h"
 
-//#define DEBUG_LIB
-
-#ifdef DEBUG_LIB
-#include <sstream>
-FILE* myoutputfile;
-static uint numcalled = 0;
-#endif //DEBUG_LIB
-
 namespace MINISAT
 {
 using namespace MINISAT;
@@ -96,20 +88,14 @@ Solver::Solver() :
         , maxRestarts(UINT_MAX)
         , MYFLAG           (0)
         , learnt_clause_group(0)
+        , libraryCNFFile   (NULL)
 {
-    toReplace = new VarReplacer(this);
+    varReplacer = new VarReplacer(this);
     conglomerate = new Conglomerate(this);
     clauseCleaner = new ClauseCleaner(*this);
     logger.setSolver(this);
-    
-    #ifdef DEBUG_LIB
-    std::stringstream ss;
-    ss << "inputfile" << numcalled << ".cnf";
-    myoutputfile = fopen(ss.str().c_str(), "w");
-    #endif
 }
 
-
 Solver::~Solver()
 {
     for (int i = 0; i < learnts.size(); i++) free(learnts[i]);
@@ -117,13 +103,12 @@ Solver::~Solver()
     for (int i = 0; i < xorclauses.size(); i++) free(xorclauses[i]);
     for (uint i = 0; i < gauss_matrixes.size(); i++) delete gauss_matrixes[i];
     for (uint i = 0; i < freeLater.size(); i++) free(freeLater[i]);
-    delete toReplace;
+    delete varReplacer;
     delete conglomerate;
     delete clauseCleaner;
     
-    #ifdef DEBUG_LIB
-    fclose(myoutputfile);
-    #endif //DEBUG_LIB
+    if (libraryCNFFile)
+        fclose(libraryCNFFile);
 }
 
 //=================================================================================================
@@ -149,16 +134,15 @@ Var Solver::newVar(bool sign, bool dvar)
     polarity  .push_back((char)sign);
 
     decision_var.push_back(dvar);
-    toReplace->newVar();
+    varReplacer->newVar();
     conglomerate->newVar();
 
     insertVarOrder(v);
     if (dynamic_behaviour_analysis)
         logger.new_var(v);
     
-    #ifdef DEBUG_LIB
-    fprintf(myoutputfile, "c Solver::newVar() called\n");
-    #endif //DEBUG_LIB
+    if (libraryCNFFile)
+        fprintf(libraryCNFFile, "c Solver::newVar() called\n");
 
     return v;
 }
@@ -166,15 +150,13 @@ Var Solver::newVar(bool sign, bool dvar)
 bool Solver::addXorClause(vec<Lit>& ps, bool xor_clause_inverted, const uint group, char* group_name, const bool internal)
 {
     assert(decisionLevel() == 0);
-    #ifdef DEBUG_LIB
-    if (!internal) {
-        fprintf(myoutputfile, "x");
+    if (libraryCNFFile && !internal) {
+        fprintf(libraryCNFFile, "x");
         for (uint i = 0; i < ps.size(); i++) {
-            fprintf(myoutputfile, "%s%d ", ps[i].sign() ? "-" : "", ps[i].var()+1);
+            fprintf(libraryCNFFile, "%s%d ", ps[i].sign() ? "-" : "", ps[i].var()+1);
         }
-        fprintf(myoutputfile, "0\n");
+        fprintf(libraryCNFFile, "0\n");
     }
-    #endif //DEBUG_LIB
 
     if (dynamic_behaviour_analysis) logger.set_group_name(group, group_name);
 
@@ -182,9 +164,9 @@ bool Solver::addXorClause(vec<Lit>& ps, bool xor_clause_inverted, const uint gro
         return false;
 
     // Check if clause is satisfied and remove false/duplicate literals:
-    if (toReplace->getNumLastReplacedVars()) {
+    if (varReplacer->getNumLastReplacedVars()) {
         for (int i = 0; i != ps.size(); i++) {
-            ps[i] = toReplace->getReplaceTable()[ps[i].var()] ^ ps[i].sign();
+            ps[i] = varReplacer->getReplaceTable()[ps[i].var()] ^ ps[i].sign();
         }
     }
     
@@ -227,7 +209,7 @@ bool Solver::addXorClause(vec<Lit>& ps, bool xor_clause_inverted, const uint gro
         cout << "--> xor is 2-long, replacing var " << ps[0].var()+1 << " with " << (!xor_clause_inverted ? "-" : "") << ps[1].var()+1 << endl;
         #endif
         
-        toReplace->replace(ps, xor_clause_inverted, group);
+        varReplacer->replace(ps, xor_clause_inverted, group);
         break;
     }
     default: {
@@ -237,7 +219,7 @@ bool Solver::addXorClause(vec<Lit>& ps, bool xor_clause_inverted, const uint gro
         xorclauses.push(c);
         attachClause(*c);
         if (!internal)
-            toReplace->newClause();
+            varReplacer->newClause();
         break;
     }
     }
@@ -249,12 +231,12 @@ bool Solver::addClause(vec<Lit>& ps, const uint group, char* group_name)
 {
     assert(decisionLevel() == 0);
     
-    #ifdef DEBUG_LIB
-    for (int i = 0; i < ps.size(); i++) {
-        fprintf(myoutputfile, "%s%d ", ps[i].sign() ? "-" : "", ps[i].var()+1);
+    if (libraryCNFFile) {
+        for (int i = 0; i < ps.size(); i++) {
+            fprintf(libraryCNFFile, "%s%d ", ps[i].sign() ? "-" : "", ps[i].var()+1);
+        }
+        fprintf(libraryCNFFile, "0\n");
     }
-    fprintf(myoutputfile, "0\n");
-    #endif //DEBUG_LIB
 
     if (dynamic_behaviour_analysis)
         logger.set_group_name(group, group_name);
@@ -263,9 +245,9 @@ bool Solver::addClause(vec<Lit>& ps, const uint group, char* group_name)
         return false;
 
     // Check if clause is satisfied and remove false/duplicate literals:
-    if (toReplace->getNumLastReplacedVars()) {
+    if (varReplacer->getNumLastReplacedVars()) {
         for (int i = 0; i != ps.size(); i++) {
-            ps[i] = toReplace->getReplaceTable()[ps[i].var()] ^ ps[i].sign();
+            ps[i] = varReplacer->getReplaceTable()[ps[i].var()] ^ ps[i].sign();
         }
     }
     
@@ -296,7 +278,7 @@ bool Solver::addClause(vec<Lit>& ps, const uint group, char* group_name)
 
         clauses.push(c);
         attachClause(*c);
-        toReplace->newClause();
+        varReplacer->newClause();
     }
 
     return true;
@@ -441,26 +423,10 @@ void Solver::printLit(const Lit l) const
     printf("%s%d:%c", l.sign() ? "-" : "", l.var()+1, value(l) == l_True ? '1' : (value(l) == l_False ? '0' : 'X'));
 }
 
-
-void Solver::printClause(const Clause& c) const
+void Solver::needLibraryCNFFile(const char* fileName)
 {
-    printf("(group: %d) ", c.group);
-    for (uint i = 0; i < c.size();) {
-        printLit(c[i]);
-        i++;
-        if (i < c.size()) printf(" ");
-    }
-}
-
-void Solver::printClause(const XorClause& c) const
-{
-    printf("(group: %d) ", c.group);
-    if (c.xor_clause_inverted()) printf(" /inverted/ ");
-    for (uint i = 0; i < c.size();) {
-        printLit(c[i].unsign());
-        i++;
-        if (i < c.size()) printf(" + ");
-    }
+    libraryCNFFile = fopen(fileName, "w");
+    assert(libraryCNFFile != NULL);
 }
 
 void Solver::set_gaussian_decision_until(const uint to)
@@ -1061,7 +1027,7 @@ void Solver::dump_sorted_learnts(const char* file)
     
     sort(learnts, reduceDB_lt());
     for (int i = learnts.size()-1; i >= 0 ; i--) {
-        learnts[i]->plain_print(outfile);
+        learnts[i]->plainPrint(outfile);
     }
     fclose(outfile);
 }
@@ -1348,9 +1314,8 @@ void Solver::print_gauss_sum_stats() const
 
 lbool Solver::solve(const vec<Lit>& assumps)
 {
-    #ifdef DEBUG_LIB
-    fprintf(myoutputfile, "c Solver::solve() called\n");
-    #endif
+    if (libraryCNFFile)
+        fprintf(libraryCNFFile, "c Solver::solve() called\n");
     
     model.clear();
     conflict.clear();
@@ -1372,7 +1337,7 @@ lbool Solver::solve(const vec<Lit>& assumps)
     conglomerate->addRemovedClauses();
     
     if (performReplace) {
-        toReplace->performReplace();
+        varReplacer->performReplace();
         if (!ok) return l_False;
     }
 
@@ -1391,7 +1356,7 @@ lbool Solver::solve(const vec<Lit>& assumps)
                 printf("|  Finding XORs:        %5.2lf s (found: %7d, avg size: %3.1lf)               |\n", cpuTime()-time, foundXors, (double)sumLengths/(double)foundXors);
             
             if (performReplace) {
-                toReplace->performReplace();
+                varReplacer->performReplace();
                 if (!ok) return l_False;
             }
         }
@@ -1420,7 +1385,7 @@ lbool Solver::solve(const vec<Lit>& assumps)
             }
             
             if (performReplace) {
-                toReplace->performReplace();
+                varReplacer->performReplace();
                 if (!ok) return l_False;
             }
         }
@@ -1482,7 +1447,7 @@ lbool Solver::solve(const vec<Lit>& assumps)
 
     if (status == l_True) {
         conglomerate->doCalcAtFinish();
-        toReplace->extendModel();
+        varReplacer->extendModel();
         // Extend & copy model:
         model.growTo(nVars());
         for (int i = 0; i < nVars(); i++) model[i] = value(i);
@@ -1538,8 +1503,7 @@ bool Solver::verifyXorClauses(const vec<XorClause*>& cs) const
         }
         if (!final) {
             printf("unsatisfied clause: ");
-            printClause(*xorclauses[i]);
-            printf("\n");
+            xorclauses[i]->plainPrint();
             failed = true;
         }
     }
@@ -1557,8 +1521,7 @@ void Solver::verifyModel()
                 goto next;
 
         printf("unsatisfied clause: ");
-        printClause(*clauses[i]);
-        printf("\n");
+        clauses[i]->plainPrint();
         failed = true;
 next:
         ;
index d6ab797e0d5478cefe0af1dfa103e9dcec7cbf2c..9cba2cf990ad394f09c76cf19b6ab1ca79c72b32 100644 (file)
@@ -24,6 +24,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
 
 #include <cstdio>
 #include <string.h>
+#include <stdio.h>
 
 #include "mtl/Vec.h"
 #include "mtl/Heap.h"
@@ -157,10 +158,11 @@ public:
     void needProofGraph();         // Prepares the solver to output proof graphs during solving
     void setVariableName(int var, char* name); // Sets the name of the variable 'var' to 'name'. Useful for statistics and proof logs (i.e. used by 'logger')
     const vec<Clause*>& get_sorted_learnts(); //return the set of learned clauses, sorted according to the logic used in MiniSat to distinguish between 'good' and 'bad' clauses
-    const vec<Clause*>& get_learnts() const; //Get all learnt clauses
+    const vec<Clause*>& get_learnts() const; //Get all learnt clauses that are >1 long
     const vector<Lit> get_unitary_learnts() const; //return the set of unitary learnt clauses
     const uint get_unitary_learnts_num() const; //return the number of unitary learnt clauses
-    void dump_sorted_learnts(const char* file);
+    void dump_sorted_learnts(const char* file); // Dumps all learnt clauses (including unitary ones) into the file
+    void needLibraryCNFFile(const char* fileName); //creates file in current directory with the filename indicated, and puts all calls from the library into the file.
 
 protected:
     vector<Gaussian*> gauss_matrixes;
@@ -237,7 +239,8 @@ protected:
     unsigned long int   MYFLAG;
 
     //Logging
-    uint learnt_clause_group; //the group number of learnt clauses. Incremented at each added learnt clause
+    uint                learnt_clause_group; //the group number of learnt clauses. Incremented at each added learnt clause
+    FILE                *libraryCNFFile; //The file that all calls from the library are logged
 
     // Main internal methods:
     //
@@ -264,7 +267,6 @@ protected:
     void     varDecayActivity ();                      // Decay all variables with the specified factor. Implemented by increasing the 'bump' value instead.
     void     varBumpActivity  (Var v);                 // Increase a variable with the current 'bump' value.
     void     claDecayActivity ();                      // Decay all clauses with the specified factor. Implemented by increasing the 'bump' value instead.
-    void     claBumpActivity  (Clause& c);             // Increase a clause with the current 'bump' value.
 
     // Operations on clauses:
     //
@@ -292,13 +294,11 @@ protected:
     friend class VarReplacer;
     friend class ClauseCleaner;
     Conglomerate* conglomerate;
-    VarReplacer* toReplace;
+    VarReplacer* varReplacer;
     ClauseCleaner* clauseCleaner;
 
     // Debug:
     void     printLit         (const Lit l) const;
-    void     printClause      (const Clause& c) const;
-    void     printClause      (const XorClause& c) const;
     void     verifyModel      ();
     bool     verifyXorClauses (const vec<XorClause*>& cs) const;
     void     checkLiteralCount();
index 79378ebf45633ad612b5e4b246d942c632134785..7de8163fa9afc138a18e7a5fb68a948c64e720a0 100644 (file)
@@ -1,3 +1,3 @@
 CryptoMiniSat
-SVN revision: 579
-GIT revision: d7ef400c6dbb9bc0b6b3fd98a0c43b178916a849
+SVN revision: 586
+GIT revision: 8b5929ba71ceaf5bf6c905436cde96e640bee4b7
index b04f9e0c50201f4544bb59a2a8c583d39cd5cf2f..a8b937999054baf0d6d081c9f9bad2c132832188 100644 (file)
@@ -1,3 +1,20 @@
+/***********************************************************************************
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**************************************************************************************************/
+
 #include "VarReplacer.h"
 
 #include "Solver.h"
index 24d94d73746eae9629b806b3ca8d3d704489f47d..278baa421eb540a86a18f7cbcc2e29f1543f11fc 100644 (file)
@@ -1,3 +1,20 @@
+/***********************************************************************************
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**************************************************************************************************/
+
 #ifndef VARREPLACER_H
 #define VARREPLACER_H
 
index c61a12d24c53b71056d9c35f6d53db8da0668f37..1dabb10dbaaaa3b9a697faba2016f9a1031ff806 100644 (file)
@@ -105,7 +105,7 @@ uint XorFinder::findXors(uint& sumLengths)
         
         switch(lits.size()) {
         case 2: {
-            S->toReplace->replace(lits, impair, old_group);
+            S->varReplacer->replace(lits, impair, old_group);
             
             #ifdef VERBOSE_DEBUG
             XorClause* x = XorClause_new(lits, impair, old_group);
index f429650e9de3ca13e812ca16e0e95cdd090db783..0633f0fcdc1b4ec99afa9fab9dff81804f5590e2 100644 (file)
@@ -1,3 +1,23 @@
+/****************************************************************************************[Solver.h]
+MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
+glucose -- Gilles Audemard, Laurent Simon (2008)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or
+substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**************************************************************************************************/
+
 #define RATIOREMOVECLAUSES 2
 #define NBCLAUSESBEFOREREDUCE 20000
 #define DYNAMICNBLEVEL
index 1e098121a33f425392f3dfbf3f2df7593d0fe487..a4c65522c9392fe7f76143c4fc793418d3c0442a 100644 (file)
@@ -1,3 +1,23 @@
+/****************************************************************************************[Solver.h]
+MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
+CryptoMiniSat -- Copyright (c) 2009 Mate Soos
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or
+substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**************************************************************************************************/
+
 #ifndef TIME_MEM_H
 #define TIME_MEM_H