diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 2c8d93acd..538626a0e 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -30,6 +30,21 @@ Version 4.3.2 - Fixed problem in the pretty printer. It was not introducing quotes for attribute names such as |foo:10|. +- Fixed bug when using assumptions (Thanks to Philippe Suter) + Consider the following example: + (assert F) + (check-sat a) + (check-sat) + If 'F' is unstatisfiable independently of the assumption 'a', and + the inconsistenty can be detected by just performing propagation, + Then, version <= 4.3.1 may return + unsat + sat + instead of + unsat + unsat + We say may because 'F' may have other unsatisfiable cores. + Version 4.3.1 ============= diff --git a/src/smt/smt_context.cpp b/src/smt/smt_context.cpp index a7623832f..02ee06985 100644 --- a/src/smt/smt_context.cpp +++ b/src/smt/smt_context.cpp @@ -2854,7 +2854,12 @@ namespace smt { m_bool_var2assumption.reset(); m_unsat_core.reset(); if (num_assumptions > 0) { - propagate(); // we must give a chance to the theories to propagate before we create a new scope... + // We must give a chance to the theories to propagate before we create a new scope... + propagate(); + // Internal backtracking scopes (created with push_scope()) must only be created when we are + // in a consistent context. + if (inconsistent()) + return; push_scope(); for (unsigned i = 0; i < num_assumptions; i++) { expr * curr_assumption = assumptions[i]; @@ -3987,3 +3992,8 @@ namespace smt { }; +#ifdef Z3DEBUG +void pp(smt::context & c) { + c.display(std::cout); +} +#endif