/*********************************************************************************** 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 . **************************************************************************************************/ #ifndef PARTHANDLER_H #define PARTHANDLER_H #include "Solver.h" #include "PartFinder.h" #include "Vec.h" #include "SolverTypes.h" #include #include using std::map; using std::vector; using std::pair; class PartHandler { public: PartHandler(Solver& solver); const bool handle(); const vec& getSavedState(); void newVar(); void addSavedState(); void readdRemovedClauses(); private: struct sort_pred { bool operator()(const std::pair &left, const std::pair &right) { return left.second < right.second; } }; //For moving clauses void moveClauses(vec& cs, Solver& newSolver, const uint32_t part, PartFinder& partFinder); void moveClauses(vec& cs, Solver& newSolver, const uint32_t part, PartFinder& partFinder); void moveLearntClauses(vec& cs, Solver& newSolver, const uint32_t part, PartFinder& partFinder); //Checking moved clauses const bool checkClauseMovement(const Solver& thisSolver, const uint32_t part, const PartFinder& partFinder) const; template const bool checkOnlyThisPart(const vec& cs, const uint32_t part, const PartFinder& partFinder) const; Solver& solver; vec savedState; vec decisionVarRemoved; //variables whose decision-ness has been removed vec clausesRemoved; vec xorClausesRemoved; }; inline const vec& PartHandler::getSavedState() { return savedState; } inline void PartHandler::newVar() { savedState.push(l_Undef); } #endif //PARTHANDLER_H