mirror of
https://github.com/Z3Prover/z3
synced 2025-10-11 10:18:06 +00:00
record simplified input clauses as lemmas
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
247980c5a2
commit
f2e636c598
7 changed files with 54 additions and 23 deletions
|
@ -320,11 +320,18 @@ namespace sat {
|
|||
clause * solver::mk_clause_core(unsigned num_lits, literal * lits, bool learned) {
|
||||
TRACE("sat", tout << "mk_clause: " << mk_lits_pp(num_lits, lits) << (learned?" learned":" aux") << "\n";);
|
||||
if (!learned) {
|
||||
unsigned old_sz = num_lits;
|
||||
bool keep = simplify_clause(num_lits, lits);
|
||||
TRACE("sat_mk_clause", tout << "mk_clause (after simp), keep: " << keep << "\n" << mk_lits_pp(num_lits, lits) << "\n";);
|
||||
if (!keep) {
|
||||
return nullptr; // clause is equivalent to true.
|
||||
}
|
||||
// if an input clause is simplified, then log the simplified version as learned
|
||||
if (!learned && old_sz > num_lits && m_config.m_drat) {
|
||||
m_lemma.reset();
|
||||
m_lemma.append(num_lits, lits);
|
||||
m_drat.add(m_lemma);
|
||||
}
|
||||
++m_stats.m_non_learned_generation;
|
||||
}
|
||||
|
||||
|
@ -706,7 +713,7 @@ namespace sat {
|
|||
if (curr != prev) {
|
||||
prev = curr;
|
||||
if (i != j)
|
||||
lits[j] = lits[i];
|
||||
std::swap(lits[j], lits[i]);
|
||||
j++;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue