diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2020-03-10 14:51:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 14:51:32 -0700 |
commit | e9f4cec2cad02e270747759223090c16b9d2d44c (patch) | |
tree | ff902073b926d48cb0ae23848bee4b90e96000c7 /src/decision | |
parent | bcaebfa163bb27e1cf14c0f763afb47b185a5f99 (diff) |
Fix issue with reset-assertions. (#3988)
Calling (reset-assertions) in start mode was not handled correctly.
Additionally, when calling (check-sat) after (reset-assertions) after a
(check-sat) call that answered unsat, we answered unsat instead of sat.
This cleans up and fixes reset-assertions) handling.
Diffstat (limited to 'src/decision')
-rw-r--r-- | src/decision/justification_heuristic.cpp | 47 | ||||
-rw-r--r-- | src/decision/justification_heuristic.h | 2 |
2 files changed, 25 insertions, 24 deletions
diff --git a/src/decision/justification_heuristic.cpp b/src/decision/justification_heuristic.cpp index a6b6cbd8f..ce79d6ca0 100644 --- a/src/decision/justification_heuristic.cpp +++ b/src/decision/justification_heuristic.cpp @@ -29,27 +29,28 @@ namespace CVC4 { JustificationHeuristic::JustificationHeuristic(CVC4::DecisionEngine* de, - context::UserContext *uc, - context::Context *c): - ITEDecisionStrategy(de, c), - d_justified(c), - d_exploredThreshold(c), - d_prvsIndex(c, 0), - d_threshPrvsIndex(c, 0), - d_helfulness("decision::jh::helpfulness", 0), - d_giveup("decision::jh::giveup", 0), - d_timestat("decision::jh::time"), - d_assertions(uc), - d_iteAssertions(uc), - d_iteCache(uc), - d_visited(), - d_visitedComputeITE(), - d_curDecision(), - d_curThreshold(0), - d_childCache(uc), - d_weightCache(uc), - d_startIndexCache(c) { - smtStatisticsRegistry()->registerStat(&d_helfulness); + context::UserContext* uc, + context::Context* c) + : ITEDecisionStrategy(de, c), + d_justified(c), + d_exploredThreshold(c), + d_prvsIndex(c, 0), + d_threshPrvsIndex(c, 0), + d_helpfulness("decision::jh::helpfulness", 0), + d_giveup("decision::jh::giveup", 0), + d_timestat("decision::jh::time"), + d_assertions(uc), + d_iteAssertions(uc), + d_iteCache(uc), + d_visited(), + d_visitedComputeITE(), + d_curDecision(), + d_curThreshold(0), + d_childCache(uc), + d_weightCache(uc), + d_startIndexCache(c) +{ + smtStatisticsRegistry()->registerStat(&d_helpfulness); smtStatisticsRegistry()->registerStat(&d_giveup); smtStatisticsRegistry()->registerStat(&d_timestat); Trace("decision") << "Justification heuristic enabled" << std::endl; @@ -57,7 +58,7 @@ JustificationHeuristic::JustificationHeuristic(CVC4::DecisionEngine* de, JustificationHeuristic::~JustificationHeuristic() { - smtStatisticsRegistry()->unregisterStat(&d_helfulness); + smtStatisticsRegistry()->unregisterStat(&d_helpfulness); smtStatisticsRegistry()->unregisterStat(&d_giveup); smtStatisticsRegistry()->unregisterStat(&d_timestat); } @@ -109,7 +110,7 @@ CVC4::prop::SatLiteral JustificationHeuristic::getNextThresh(bool &stopSearch, D if(litDecision != undefSatLiteral) { setPrvsIndex(i); Trace("decision") << "jh: splitting on " << litDecision << std::endl; - ++d_helfulness; + ++d_helpfulness; return litDecision; } } diff --git a/src/decision/justification_heuristic.h b/src/decision/justification_heuristic.h index b2c325628..bb426ad1e 100644 --- a/src/decision/justification_heuristic.h +++ b/src/decision/justification_heuristic.h @@ -57,7 +57,7 @@ class JustificationHeuristic : public ITEDecisionStrategy { context::CDO<unsigned> d_prvsIndex; context::CDO<unsigned> d_threshPrvsIndex; - IntStat d_helfulness; + IntStat d_helpfulness; IntStat d_giveup; TimerStat d_timestat; |