3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-29 09:28:45 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-04-02 20:35:15 -07:00
parent 26192e848c
commit be3a9b227c
5 changed files with 34 additions and 47 deletions

View file

@ -1079,6 +1079,7 @@ namespace smt {
clauses because they are deleted during backtracking.
*/
bool context::simplify_aux_clause_literals(unsigned & num_lits, literal * lits, literal_buffer & simp_lits) {
TRACE("simplify_aux_clause_literals", display_literals(tout, num_lits, lits); tout << "\n";);
std::sort(lits, lits + num_lits);
literal prev = null_literal;
unsigned j = 0;
@ -1087,7 +1088,7 @@ namespace smt {
lbool val = get_assignment(curr);
switch(val) {
case l_false:
TRACE("simplify_aux_clause_literals", display_literal(tout << get_assign_level(curr) << " " << get_scope_level() << " ", curr); tout << "\n"; );
TRACE("simplify_aux_clause_literals", display_literal_verbose(tout << get_assign_level(curr) << " " << get_scope_level() << " " << curr << ":", curr); tout << "\n"; );
simp_lits.push_back(~curr);
break; // ignore literal
// fall through
@ -1131,9 +1132,9 @@ namespace smt {
kind of simplification.
*/
bool context::simplify_aux_lemma_literals(unsigned & num_lits, literal * lits) {
TRACE("simplify_aux_lemma_literals", tout << "1) "; display_literals(tout, num_lits, lits); tout << "\n";);
TRACE("simplify_aux_lemma_literals", display_literals(tout << "1) ", num_lits, lits) << "\n";);
std::sort(lits, lits + num_lits);
TRACE("simplify_aux_lemma_literals", tout << "2) "; display_literals(tout, num_lits, lits); tout << "\n";);
TRACE("simplify_aux_lemma_literals", display_literals(tout << "2) ", num_lits, lits) << "\n";);
literal prev = null_literal;
unsigned i = 0;
unsigned j = 0;
@ -1155,7 +1156,7 @@ namespace smt {
}
}
num_lits = j;
TRACE("simplify_aux_lemma_literals", tout << "3) "; display_literals(tout, num_lits, lits); tout << "\n";);
TRACE("simplify_aux_lemma_literals", display_literals(tout << "3) ", num_lits, lits) << "\n";);
return true;
}
@ -1338,7 +1339,7 @@ namespace smt {
}
break;
}
case CLS_TH_LEMMA: {
case CLS_TH_LEMMA:
if (!simplify_aux_lemma_literals(num_lits, lits)) {
if (j && !j->in_region()) {
j->del_eh(m);
@ -1348,16 +1349,13 @@ namespace smt {
}
// simplify_aux_lemma_literals does not delete literals assigned to false, so
// it is not necessary to create a unit_resolution_justification
break;
}
break;
default:
break;
}
TRACE("mk_clause", tout << "after simplification:\n"; display_literals_verbose(tout, num_lits, lits) << "\n";);
TRACE("mk_clause", display_literals_verbose(tout << "after simplification:\n", num_lits, lits) << "\n";);
unsigned activity = 0;
if (activity == 0)
activity = 1;
unsigned activity = 1;
bool lemma = is_lemma(k);
m_stats.m_num_mk_lits += num_lits;
switch (num_lits) {