diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2020-03-27 16:37:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 16:37:14 -0700 |
commit | 97f1e4592b617a5682a8e990b4f82d3cbb6ee037 (patch) | |
tree | 802d51af8b5d86e7d62e56eea8976ff6e8f0f533 /src/prop/prop_engine.cpp | |
parent | ea1f107a92f22961a50fbc51d93780f89cbd66e0 (diff) |
Fix issues with unsat cores and reset-assertions (#4159)
Fixes #4151. Commit e9f4cec2cad02e270747759223090c16b9d2d44c fixed how
`(reset-assertions)` is handled by destroying and recreating the
`PropEngine` owned by `SmtEngine`. When unsat cores are enabled,
creating a `PropEngine` triggers the creation of a SAT proof and a CNF
proof. In the `ProofManager`, we had assertions that checked that those
kinds of proofs were only created once, which is not true anymore. This
commit removes the assertions, cleans up the memory management in
`ProofManager` to use `std::unique_ptr` and makes all the
`ProofManager::init*` methods non-static for consistency.
The commit also fixes an additional issue that I encountered while
testing the fix: When creating the new `PropEngine`, we were not
asserting `true` and `(not false)`, which lead to an error if we tried
to get the unsat core after a `(reset-assertion)` command and we had
asserted `(assert false)`. The commit fixes this by asserting `true` and
`(not false)` in the constructor of `PropEngine`.
The regression test is an extension of the example in #4151 and covers
both issues.
Diffstat (limited to 'src/prop/prop_engine.cpp')
-rw-r--r-- | src/prop/prop_engine.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/prop/prop_engine.cpp b/src/prop/prop_engine.cpp index 19ee29191..2436aed04 100644 --- a/src/prop/prop_engine.cpp +++ b/src/prop/prop_engine.cpp @@ -115,6 +115,11 @@ PropEngine::PropEngine(TheoryEngine* te, PROOF ( ProofManager::currentPM()->initCnfProof(d_cnfStream, userContext); ); + + NodeManager* nm = NodeManager::currentNM(); + d_cnfStream->convertAndAssert(nm->mkConst(true), false, false, RULE_GIVEN); + d_cnfStream->convertAndAssert( + nm->mkConst(false).notNode(), false, false, RULE_GIVEN); } PropEngine::~PropEngine() { |