diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2021-02-16 16:36:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 16:36:57 -0800 |
commit | 20d266f9e641062004633e24e74878791be2b919 (patch) | |
tree | b5f7f463f26f2a4c8ad84511e9484f675e9f0ac7 /src/prop/cadical.cpp | |
parent | 0bd00a9a25ff2358cb613a964186c1a13c5f351d (diff) |
Add bit-level propagation support to BV bitblast solver. (#5906)
This commit adds support for bit-level propagation for the BV bitblast solver to quickly detect conflicts on effort levels != FULL. Bit-level propagation for the bitblast solver is by default disabled for now. Further, bit-blasting of facts is now handled more lazily with a bit-blast queue.
Diffstat (limited to 'src/prop/cadical.cpp')
-rw-r--r-- | src/prop/cadical.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/prop/cadical.cpp b/src/prop/cadical.cpp index b3563bf28..0324f8128 100644 --- a/src/prop/cadical.cpp +++ b/src/prop/cadical.cpp @@ -61,6 +61,7 @@ CadicalSolver::CadicalSolver(StatisticsRegistry* registry, // Note: CaDiCaL variables start with index 1 rather than 0 since negated // literals are represented as the negation of the index. d_nextVarIdx(1), + d_inSatMode(false), d_statistics(registry, name) { } @@ -111,10 +112,10 @@ SatVariable CadicalSolver::falseVar() { return d_false; } SatValue CadicalSolver::solve() { - d_assumptions.clear(); TimerStat::CodeTimer codeTimer(d_statistics.d_solveTime); + d_assumptions.clear(); SatValue res = toSatValue(d_solver->solve()); - d_okay = (res == SAT_VALUE_TRUE); + d_inSatMode = (res == SAT_VALUE_TRUE); ++d_statistics.d_numSatCalls; return res; } @@ -126,19 +127,25 @@ SatValue CadicalSolver::solve(long unsigned int&) SatValue CadicalSolver::solve(const std::vector<SatLiteral>& assumptions) { - d_assumptions.clear(); TimerStat::CodeTimer codeTimer(d_statistics.d_solveTime); + d_assumptions.clear(); for (const SatLiteral& lit : assumptions) { d_solver->assume(toCadicalLit(lit)); d_assumptions.push_back(lit); } SatValue res = toSatValue(d_solver->solve()); - d_okay = (res == SAT_VALUE_TRUE); + d_inSatMode = (res == SAT_VALUE_TRUE); ++d_statistics.d_numSatCalls; return res; } +bool CadicalSolver::setPropagateOnly() +{ + d_solver->limit("decisions", 0); /* Gets reset after next solve() call. */ + return true; +} + void CadicalSolver::getUnsatAssumptions(std::vector<SatLiteral>& assumptions) { for (const SatLiteral& lit : d_assumptions) @@ -154,13 +161,13 @@ void CadicalSolver::interrupt() { d_solver->terminate(); } SatValue CadicalSolver::value(SatLiteral l) { - Assert(d_okay); + Assert(d_inSatMode); return toSatValueLit(d_solver->val(toCadicalLit(l))); } SatValue CadicalSolver::modelValue(SatLiteral l) { - Assert(d_okay); + Assert(d_inSatMode); return value(l); } @@ -169,7 +176,7 @@ unsigned CadicalSolver::getAssertionLevel() const Unreachable() << "CaDiCaL does not support assertion levels."; } -bool CadicalSolver::ok() const { return d_okay; } +bool CadicalSolver::ok() const { return d_inSatMode; } CadicalSolver::Statistics::Statistics(StatisticsRegistry* registry, const std::string& prefix) |