mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
99b291e78d
commit
7452e55698
10 changed files with 34 additions and 29 deletions
|
@ -1056,7 +1056,8 @@ namespace smt {
|
|||
}
|
||||
|
||||
bool inconsistent() const {
|
||||
return m_conflict != null_b_justification;
|
||||
return m_conflict != null_b_justification ||
|
||||
m_asserted_formulas.inconsistent();
|
||||
}
|
||||
|
||||
unsigned get_num_conflicts() const {
|
||||
|
|
|
@ -1323,21 +1323,27 @@ namespace smt {
|
|||
case CLS_AUX:
|
||||
case CLS_TH_AXIOM: {
|
||||
literal_buffer simp_lits;
|
||||
if (!simplify_aux_clause_literals(num_lits, lits, simp_lits))
|
||||
return nullptr; // clause is equivalent to true;
|
||||
DEBUG_CODE({
|
||||
for (unsigned i = 0; i < simp_lits.size(); i++) {
|
||||
SASSERT(get_assignment(simp_lits[i]) == l_true);
|
||||
if (!simplify_aux_clause_literals(num_lits, lits, simp_lits)) {
|
||||
if (j && !j->in_region()) {
|
||||
j->del_eh(m);
|
||||
dealloc(j);
|
||||
}
|
||||
});
|
||||
return nullptr; // clause is equivalent to true;
|
||||
}
|
||||
DEBUG_CODE(for (literal lit : simp_lits) SASSERT(get_assignment(lit) == l_true););
|
||||
if (!simp_lits.empty()) {
|
||||
j = mk_justification(unit_resolution_justification(m_region, j, simp_lits.size(), simp_lits.c_ptr()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CLS_TH_LEMMA: {
|
||||
if (!simplify_aux_lemma_literals(num_lits, lits))
|
||||
if (!simplify_aux_lemma_literals(num_lits, lits)) {
|
||||
if (j && !j->in_region()) {
|
||||
j->del_eh(m);
|
||||
dealloc(j);
|
||||
}
|
||||
return nullptr; // clause is equivalent to true
|
||||
}
|
||||
// simplify_aux_lemma_literals does not delete literals assigned to false, so
|
||||
// it is not necessary to create a unit_resolution_justification
|
||||
break;
|
||||
|
@ -1346,14 +1352,6 @@ namespace smt {
|
|||
break;
|
||||
}
|
||||
TRACE("mk_clause", tout << "after simplification:\n"; display_literals_verbose(tout, num_lits, lits) << "\n";);
|
||||
#if 0
|
||||
for (unsigned i = 0; i < num_lits; ++i) {
|
||||
expr_ref tmp(m);
|
||||
literal2expr(lits[i], tmp);
|
||||
std::cout << tmp << "\n";
|
||||
}
|
||||
std::cout << "\n";
|
||||
#endif
|
||||
|
||||
unsigned activity = 0;
|
||||
if (activity == 0)
|
||||
|
|
|
@ -377,8 +377,8 @@ namespace smt {
|
|||
justification(false),
|
||||
m_th_id(fid),
|
||||
m_params(num_params, params),
|
||||
m_num_literals(num_lits) {
|
||||
ast_manager & m = ctx.get_manager();
|
||||
m_num_literals(num_lits) {
|
||||
ast_manager& m = ctx.get_manager();
|
||||
m_literals = alloc_svect(expr*, num_lits);
|
||||
for (unsigned i = 0; i < num_lits; i++) {
|
||||
bool sign = lits[i].sign();
|
||||
|
@ -396,7 +396,8 @@ namespace smt {
|
|||
|
||||
void theory_lemma_justification::del_eh(ast_manager & m) {
|
||||
for (unsigned i = 0; i < m_num_literals; i++) {
|
||||
m.dec_ref(UNTAG(expr*, m_literals[i]));
|
||||
expr* v = UNTAG(expr*, m_literals[i]);
|
||||
m.dec_ref(v);
|
||||
}
|
||||
m_params.reset();
|
||||
}
|
||||
|
|
|
@ -3179,6 +3179,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
mf::quantifier_info * model_finder::get_quantifier_info(quantifier * q) const {
|
||||
TRACE("model_finder", tout << q->get_id() << ": " << q << " " << &m_q2info << " " << mk_pp(q, m) << "\n";);
|
||||
return m_q2info[q];
|
||||
}
|
||||
|
||||
|
@ -3190,7 +3191,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void model_finder::register_quantifier(quantifier * q) {
|
||||
TRACE("model_finder", tout << "registering:\n" << mk_pp(q, m) << "\n";);
|
||||
TRACE("model_finder", tout << "registering:\n" << q->get_id() << ": " << q << " " << &m_q2info << " " << mk_pp(q, m) << "\n";);
|
||||
quantifier_info * new_info = alloc(quantifier_info, *this, m, q);
|
||||
m_q2info.insert(q, new_info);
|
||||
m_quantifiers.push_back(q);
|
||||
|
|
|
@ -1356,7 +1356,8 @@ public:
|
|||
body = m.mk_implies(m.mk_not(m.mk_eq(q, zero)), a.mk_le(mod, upper));
|
||||
th.log_axiom_instantiation(body);
|
||||
}
|
||||
mk_axiom(mk_literal(a.mk_le(mod, upper)));
|
||||
expr_ref le(a.mk_le(mod, upper), m);
|
||||
mk_axiom(mk_literal(le));
|
||||
if (m.has_trace_stream()) m.trace_stream() << "[end-of-instance]\n";
|
||||
if (k.is_pos()) {
|
||||
if (m.has_trace_stream()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue