mirror of
https://github.com/Z3Prover/z3
synced 2025-04-14 21:08:46 +00:00
Fix bugs in iuc generation
This commit is contained in:
parent
4ed6783aff
commit
ac23002dce
|
@ -33,7 +33,7 @@ public:
|
||||||
bool is_h_marked(proof* p) {return m_h_mark.is_marked(p);}
|
bool is_h_marked(proof* p) {return m_h_mark.is_marked(p);}
|
||||||
|
|
||||||
bool is_b_pure (proof *p) {
|
bool is_b_pure (proof *p) {
|
||||||
return !is_h_marked (p) && is_core_pure(m.get_fact (p));
|
return !is_h_marked(p) && !this->is_a_marked(p) && is_core_pure(m.get_fact(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_dot(std::ostream &out);
|
void display_dot(std::ostream &out);
|
||||||
|
|
|
@ -135,13 +135,13 @@ namespace spacer {
|
||||||
*/
|
*/
|
||||||
parameter const* params = d->get_parameters() + 2; // point to the first Farkas coefficient
|
parameter const* params = d->get_parameters() + 2; // point to the first Farkas coefficient
|
||||||
|
|
||||||
STRACE("spacer.farkas",
|
TRACE("spacer.farkas",
|
||||||
verbose_stream() << "Farkas input: "<< "\n";
|
tout << "Farkas input: "<< "\n";
|
||||||
for (unsigned i = 0; i < m.get_num_parents(step); ++i) {
|
for (unsigned i = 0; i < m.get_num_parents(step); ++i) {
|
||||||
proof * prem = m.get_parent(step, i);
|
proof * prem = m.get_parent(step, i);
|
||||||
rational coef = params[i].get_rational();
|
rational coef = params[i].get_rational();
|
||||||
bool b_pure = m_learner.m_pr.is_b_pure (prem);
|
bool b_pure = m_learner.m_pr.is_b_pure (prem);
|
||||||
verbose_stream() << (b_pure?"B":"A") << " " << coef << " " << mk_pp(m.get_fact(prem), m) << "\n";
|
tout << (b_pure?"B":"A") << " " << coef << " " << mk_pp(m.get_fact(prem), m) << "\n";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -153,13 +153,14 @@ namespace spacer {
|
||||||
if (m_learner.is_b_open (premise)) {
|
if (m_learner.is_b_open (premise)) {
|
||||||
SASSERT(!m_learner.m_pr.is_a_marked(premise));
|
SASSERT(!m_learner.m_pr.is_a_marked(premise));
|
||||||
|
|
||||||
if (m_learner.m_pr.is_b_pure (step)) {
|
if (m_learner.m_pr.is_b_pure (premise)) {
|
||||||
if (!m_use_constant_from_a) {
|
if (!m_use_constant_from_a) {
|
||||||
rational coefficient = params[i].get_rational();
|
rational coefficient = params[i].get_rational();
|
||||||
coeff_lits.push_back(std::make_pair(abs(coefficient), (app*)m.get_fact(premise)));
|
coeff_lits.push_back(std::make_pair(abs(coefficient), (app*)m.get_fact(premise)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// -- mixed premise, won't be able to close this proof step
|
||||||
can_be_closed = false;
|
can_be_closed = false;
|
||||||
|
|
||||||
if (m_use_constant_from_a) {
|
if (m_use_constant_from_a) {
|
||||||
|
@ -205,11 +206,11 @@ namespace spacer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// only if all b-premises can be used directly, add the farkas core and close the step
|
// only if all b-premises can be used directly, add the farkas core and close the step
|
||||||
|
// AG: this decision needs to be re-evaluated. If the proof cannot be closed, literals above
|
||||||
|
// AG: it will go into the core. However, it does not mean that this literal should/could not be added.
|
||||||
if (can_be_closed) {
|
if (can_be_closed) {
|
||||||
m_learner.set_closed(step, true);
|
m_learner.set_closed(step, true);
|
||||||
|
|
||||||
expr_ref res = compute_linear_combination(coeff_lits);
|
expr_ref res = compute_linear_combination(coeff_lits);
|
||||||
|
|
||||||
m_learner.add_lemma_to_core(res);
|
m_learner.add_lemma_to_core(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue