Fix issues with unsat cores and reset-assertions (#4159)
authorAndres Noetzli <andres.noetzli@gmail.com>
Fri, 27 Mar 2020 23:37:14 +0000 (16:37 -0700)
committerGitHub <noreply@github.com>
Fri, 27 Mar 2020 23:37:14 +0000 (16:37 -0700)
commit97f1e4592b617a5682a8e990b4f82d3cbb6ee037
tree802d51af8b5d86e7d62e56eea8976ff6e8f0f533
parentea1f107a92f22961a50fbc51d93780f89cbd66e0
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.
src/proof/proof_manager.cpp
src/proof/proof_manager.h
src/prop/prop_engine.cpp
src/smt/smt_engine.cpp
test/regress/CMakeLists.txt
test/regress/regress0/smtlib/issue4151.smt2 [new file with mode: 0644]