diff options
author | Kshitij Bansal <kshitij@cs.nyu.edu> | 2012-04-23 17:56:19 +0000 |
---|---|---|
committer | Kshitij Bansal <kshitij@cs.nyu.edu> | 2012-04-23 17:56:19 +0000 |
commit | 5676b8bddcf001ba567ebb6d8e7b42dbd13ac9f3 (patch) | |
tree | a3fe0f00ae5d5cd087b23c885c8b170ceb07b919 /src/prop/minisat | |
parent | 04e81f6d12cad8f2519aa6c94adee52aadd71ec3 (diff) |
Merge from decision branch -- partially working justification heuristic
Overview of changes
* command line option --decision={internal,justification}
* justification heuristic handles all operators except ITEs
revelant stats: decision::jh::*
* if decisionEngine has solved the problem PropEngine returns
unknown and smtEngine queries DE to get the answer
relevant stat: smt::resultSource
* there are known bugs
Full list of commits being merged
r3330 use CD data structures in JH
r3329 add command-line option --decision=MODE
r3328 timer stat, other fixes
r3326 more trace
r3325 enable implies, iff, xor (no further regression losses)
r3324 feed decision engine lemmas, changes to quitting mechanism
r3322 In progress
r3321 more fixes...
r3318 bugfix1 (69 more to go)
r3317 Handle other boolean operators in JH (except ITE)
r3316 mechanism for DE to stopSearch
r3315 merge from trunk + JH translation continuation
r3275 change option to enable JH by default[A
Diffstat (limited to 'src/prop/minisat')
-rw-r--r-- | src/prop/minisat/core/Solver.cc | 22 | ||||
-rw-r--r-- | src/prop/minisat/minisat.cpp | 3 |
2 files changed, 19 insertions, 6 deletions
diff --git a/src/prop/minisat/core/Solver.cc b/src/prop/minisat/core/Solver.cc index c602d8b9c..79893a087 100644 --- a/src/prop/minisat/core/Solver.cc +++ b/src/prop/minisat/core/Solver.cc @@ -370,8 +370,9 @@ Lit Solver::pickBranchLit() } #endif /* CVC4_REPLAY */ - // Theory requests - nextLit = MinisatSatSolver::toMinisatLit(proxy->getNextDecisionRequest()); + // Theory/DE requests + bool stopSearch = false; + nextLit = MinisatSatSolver::toMinisatLit(proxy->getNextDecisionRequest(stopSearch)); while (nextLit != lit_Undef) { if(value(var(nextLit)) == l_Undef) { Debug("propagateAsDecision") << "propagateAsDecision(): now deciding on " << nextLit << std::endl; @@ -379,7 +380,10 @@ Lit Solver::pickBranchLit() } else { Debug("propagateAsDecision") << "propagateAsDecision(): would decide on " << nextLit << " but it already has an assignment" << std::endl; } - nextLit = MinisatSatSolver::toMinisatLit(proxy->getNextDecisionRequest()); + nextLit = MinisatSatSolver::toMinisatLit(proxy->getNextDecisionRequest(stopSearch)); + } + if(stopSearch) { + return lit_Undef; } Var next = var_Undef; @@ -1020,15 +1024,23 @@ lbool Solver::search(int nof_conflicts) // If this was a final check, we are satisfiable if (check_type == CHECK_FINAL) { + bool decisionEngineDone = proxy->isDecisionEngineDone(); // Unless a lemma has added more stuff to the queues - if (!order_heap.empty() || qhead < trail.size()) { + if (!decisionEngineDone && + (!order_heap.empty() || qhead < trail.size()) ) { check_type = CHECK_WITH_THEORY; continue; - } else if (recheck) { + } else if (!decisionEngineDone && recheck) { // There some additional stuff added, so we go for another full-check continue; } else { // Yes, we're truly satisfiable + if(decisionEngineDone) { + // but we might know that only because of decision engine + Trace("decision") << decisionEngineDone << " decision engine stopping us" << std::endl; + interrupt(); + return l_Undef; + } return l_True; } } diff --git a/src/prop/minisat/minisat.cpp b/src/prop/minisat/minisat.cpp index c8d310992..bed30d658 100644 --- a/src/prop/minisat/minisat.cpp +++ b/src/prop/minisat/minisat.cpp @@ -94,7 +94,8 @@ void MinisatSatSolver::initialize(context::Context* context, TheoryProxy* theory // Create the solver d_minisat = new Minisat::SimpSolver(theoryProxy, d_context, - Options::current()->incrementalSolving); + Options::current()->incrementalSolving || + Options::current()->decisionMode == Options::DECISION_STRATEGY_JUSTIFICATION ); // Setup the verbosity d_minisat->verbosity = (Options::current()->verbosity > 0) ? 1 : -1; |