** Major contributors:
** Minor contributors (to current version):
** This file is part of the CVC4 prototype.
- ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
+ ** Copyright (c) 2009-2014 The Analysis of Computer Systems Group (ACSys)
** Courant Institute of Mathematical Sciences
** New York University
** See the file COPYING in the top-level source directory for licensing
**
** \brief SAT Solver.
**
- ** Implementation of the minisat for cvc4.
+ ** Implementation of the minisat interface for cvc4.
**/
#include "prop/minisat/minisat.h"
Assert((unsigned)clause.size() == sat_clause.size());
}
-void MinisatSatSolver::initialize(context::Context* context, TheoryProxy* theoryProxy)
-{
+void MinisatSatSolver::initialize(context::Context* context, TheoryProxy* theoryProxy) {
d_context = context;
d_minisat = new Minisat::SimpSolver(theoryProxy, d_context,
options::incrementalSolving() ||
options::decisionMode() != decision::DECISION_STRATEGY_INTERNAL );
+
+ d_statistics.init(d_minisat);
+}
+
+// Like initialize() above, but called just before each search when in
+// incremental mode
+void MinisatSatSolver::setupOptions() {
+ // Copy options from CVC4 options structure into minisat, as appropriate
+
// Set up the verbosity
d_minisat->verbosity = (options::verbosity() > 0) ? 1 : -1;
// Set up the random decision parameters
d_minisat->random_var_freq = options::satRandomFreq();
- d_minisat->random_seed = options::satRandomSeed();
+ // If 0, we use whatever we like (here, the Minisat default seed)
+ if(options::satRandomSeed() != 0) {
+ d_minisat->random_seed = double(options::satRandomSeed());
+ }
// Give access to all possible options in the sat solver
d_minisat->var_decay = options::satVarDecay();
d_minisat->clause_decay = options::satClauseDecay();
d_minisat->restart_first = options::satRestartFirst();
d_minisat->restart_inc = options::satRestartInc();
-
- d_statistics.init(d_minisat);
}
void MinisatSatSolver::addClause(SatClause& clause, bool removable) {
SatValue MinisatSatSolver::solve(unsigned long& resource) {
Trace("limit") << "SatSolver::solve(): have limit of " << resource << " conflicts" << std::endl;
+ setupOptions();
if(resource == 0) {
d_minisat->budgetOff();
} else {
}
SatValue MinisatSatSolver::solve() {
+ setupOptions();
d_minisat->budgetOff();
return toSatLiteralValue(d_minisat->solve());
}
** Major contributors:
** Minor contributors (to current version):
** This file is part of the CVC4 prototype.
- ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
+ ** Copyright (c) 2009-2014 The Analysis of Computer Systems Group (ACSys)
** Courant Institute of Mathematical Sciences
** New York University
** See the file COPYING in the top-level source directory for licensing
**
** \brief SAT Solver.
**
- ** Implementation of the minisat for cvc4.
+ ** Implementation of the minisat interface for cvc4.
**/
#pragma once
/** Context we will be using to synchronize the sat solver */
context::Context* d_context;
+ void setupOptions();
+
public:
MinisatSatSolver();
Statistics();
~Statistics();
void init(Minisat::SimpSolver* d_minisat);
- };
+ };/* class MinisatSatSolver::Statistics */
Statistics d_statistics;
-};
-
-} // prop namespace
-} // cvc4 namespace
+};/* class MinisatSatSolver */
+}/* CVC4::prop namespace */
+}/* CVC4 namespace */