summaryrefslogtreecommitdiff
path: root/src/prop/minisat
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2011-09-02 20:41:08 +0000
committerMorgan Deters <mdeters@gmail.com>2011-09-02 20:41:08 +0000
commit1d18e5ebed9a5b20ed6a8fe21d11842acf6fa7ea (patch)
tree7074f04453914bc377ff6aeb307dd17b82b76ff3 /src/prop/minisat
parent74770f1071e6102795393cf65dd0c651038db6b4 (diff)
Merge from my post-smtcomp branch. Includes:
Dumping infrastructure. Can dump preprocessed queries and clauses. Can also dump queries (for testing with another solver) to see if any conflicts are missed, T-propagations are missed, all lemmas are T-valid, etc. For a full list of options see --dump=help. CUDD building much cleaner. Documentation and assertion fixes. Printer improvements, printing of commands in language-defined way, etc. Typechecker stuff in expr package now autogenerated, no need to manually edit the expr package when adding a new theory. CVC3 compatibility layer (builds as libcompat). SWIG detection and language binding support (infrastructure). Support for some Z3 extended commands (like datatypes) in SMT-LIBv2 mode (when not in compliance mode). Copyright and file headers regenerated.
Diffstat (limited to 'src/prop/minisat')
-rw-r--r--src/prop/minisat/Makefile.am2
-rw-r--r--src/prop/minisat/core/Solver.cc13
-rw-r--r--src/prop/minisat/core/Solver.h12
3 files changed, 21 insertions, 6 deletions
diff --git a/src/prop/minisat/Makefile.am b/src/prop/minisat/Makefile.am
index 3e844ef79..6e003c248 100644
--- a/src/prop/minisat/Makefile.am
+++ b/src/prop/minisat/Makefile.am
@@ -1,7 +1,7 @@
AM_CPPFLAGS = \
-D__BUILDING_CVC4LIB \
-D __STDC_LIMIT_MACROS \
- -D __STDC_FORMAT_MACROS \
+ -D __STDC_FORMAT_MACROS \
-I@srcdir@/ -I@srcdir@/../.. -I@builddir@/../.. -I@srcdir@/../../include
AM_CXXFLAGS = -Wall -Wno-parentheses -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN)
diff --git a/src/prop/minisat/core/Solver.cc b/src/prop/minisat/core/Solver.cc
index 711379519..e160e1ef5 100644
--- a/src/prop/minisat/core/Solver.cc
+++ b/src/prop/minisat/core/Solver.cc
@@ -20,9 +20,14 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#include <math.h>
+#include <iostream>
+
#include "mtl/Sort.h"
#include "core/Solver.h"
+
#include "prop/sat.h"
+#include "util/output.h"
+#include "expr/command.h"
using namespace Minisat;
using namespace CVC4;
@@ -287,10 +292,16 @@ bool Solver::satisfied(const Clause& c) const {
// Revert to the state at given level (keeping all assignment at 'level' but not beyond).
//
void Solver::cancelUntil(int level) {
+ Debug("minisat") << "minisat::cancelUntil(" << level << std::endl;
+
if (decisionLevel() > level){
// Pop the SMT context
- for (int l = trail_lim.size() - level; l > 0; --l)
+ for (int l = trail_lim.size() - level; l > 0; --l) {
context->pop();
+ if(Dump.isOn("state")) {
+ Dump("state") << PopCommand() << std::endl;
+ }
+ }
for (int c = trail.size()-1; c >= trail_lim[level]; c--){
Var x = var(trail[c]);
assigns [x] = l_Undef;
diff --git a/src/prop/minisat/core/Solver.h b/src/prop/minisat/core/Solver.h
index 4c6e98a2e..8e5e05b1c 100644
--- a/src/prop/minisat/core/Solver.h
+++ b/src/prop/minisat/core/Solver.h
@@ -23,6 +23,8 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#include "cvc4_private.h"
+#include <iostream>
+
#include "mtl/Vec.h"
#include "mtl/Heap.h"
#include "mtl/Alg.h"
@@ -31,12 +33,14 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#include "context/context.h"
#include "theory/theory.h"
+#include "util/output.h"
+#include "expr/command.h"
namespace CVC4 {
namespace prop {
class SatSolver;
-}
-}
+}/* CVC4::prop namespace */
+}/* CVC4 namespace */
namespace Minisat {
@@ -441,7 +445,7 @@ inline bool Solver::addClause (Lit p, bool removable)
inline bool Solver::addClause (Lit p, Lit q, bool removable) { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); return addClause_(add_tmp, removable); }
inline bool Solver::addClause (Lit p, Lit q, Lit r, bool removable) { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); add_tmp.push(r); return addClause_(add_tmp, removable); }
inline bool Solver::locked (const Clause& c) const { return value(c[0]) == l_True && isPropagatedBy(var(c[0]), c); }
-inline void Solver::newDecisionLevel() { trail_lim.push(trail.size()); context->push(); }
+inline void Solver::newDecisionLevel() { trail_lim.push(trail.size()); context->push(); if(Dump.isOn("state")) { Dump("state") << CVC4::PushCommand() << std::endl; } }
inline int Solver::decisionLevel () const { return trail_lim.size(); }
inline uint32_t Solver::abstractLevel (Var x) const { return 1 << (level(x) & 31); }
@@ -495,6 +499,6 @@ inline void Solver::toDimacs (const char* file, Lit p, Lit q, Lit r){ ve
//=================================================================================================
-}
+}/* Minisat namespace */
#endif
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback