mirror of
https://github.com/Z3Prover/z3
synced 2025-05-03 22:05:45 +00:00
fix #1577 again
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
44a0dbbc61
commit
c4829dfa22
12 changed files with 61 additions and 56 deletions
|
@ -1312,7 +1312,7 @@ void cmd_context::assert_expr(expr * t) {
|
|||
m().inc_ref(t);
|
||||
m_assertions.push_back(t);
|
||||
if (produce_unsat_cores())
|
||||
m_assertion_names.push_back(0);
|
||||
m_assertion_names.push_back(nullptr);
|
||||
if (m_solver)
|
||||
m_solver->assert_expr(t);
|
||||
}
|
||||
|
@ -1491,7 +1491,18 @@ void cmd_context::check_sat(unsigned num_assumptions, expr * const * assumptions
|
|||
expr_ref_vector asms(m());
|
||||
asms.append(num_assumptions, assumptions);
|
||||
if (!m_processing_pareto) {
|
||||
get_opt()->set_hard_constraints(m_assertions);
|
||||
expr_ref_vector assertions(m());
|
||||
unsigned sz = m_assertions.size();
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
if (m_assertion_names.size() > i && m_assertion_names[i]) {
|
||||
asms.push_back(m_assertion_names[i]);
|
||||
assertions.push_back(m().mk_implies(m_assertion_names[i], m_assertions[i]));
|
||||
}
|
||||
else {
|
||||
assertions.push_back(m_assertions[i]);
|
||||
}
|
||||
}
|
||||
get_opt()->set_hard_constraints(assertions);
|
||||
}
|
||||
try {
|
||||
r = get_opt()->optimize(asms);
|
||||
|
@ -1802,11 +1813,8 @@ void cmd_context::validate_model() {
|
|||
cancel_eh<reslimit> eh(m().limit());
|
||||
expr_ref r(m());
|
||||
scoped_ctrl_c ctrlc(eh);
|
||||
ptr_vector<expr>::const_iterator it = begin_assertions();
|
||||
ptr_vector<expr>::const_iterator end = end_assertions();
|
||||
bool invalid_model = false;
|
||||
for (; it != end; ++it) {
|
||||
expr * a = *it;
|
||||
for (expr * a : assertions()) {
|
||||
if (is_ground(a)) {
|
||||
r = nullptr;
|
||||
evaluator(a, r);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue