mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
fix proof checking for bounds propagation
This commit is contained in:
parent
cb279fba2b
commit
da3f31697b
7 changed files with 105 additions and 61 deletions
|
@ -918,6 +918,9 @@ namespace sat {
|
|||
case hint_type::farkas_h:
|
||||
ous << "farkas ";
|
||||
break;
|
||||
case hint_type::bound_h:
|
||||
ous << "bound ";
|
||||
break;
|
||||
case hint_type::cut_h:
|
||||
ous << "cut ";
|
||||
break;
|
||||
|
@ -946,6 +949,11 @@ namespace sat {
|
|||
s += 6;
|
||||
return true;
|
||||
}
|
||||
if (0 == strncmp(s, "bound", 5)) {
|
||||
h.m_ty = hint_type::bound_h;
|
||||
s += 5;
|
||||
return true;
|
||||
}
|
||||
if (0 == strncmp(s, "cut", 3)) {
|
||||
h.m_ty = hint_type::cut_h;
|
||||
s += 3;
|
||||
|
|
|
@ -97,6 +97,7 @@ namespace sat {
|
|||
enum class hint_type {
|
||||
null_h,
|
||||
farkas_h,
|
||||
bound_h,
|
||||
cut_h
|
||||
};
|
||||
|
||||
|
|
|
@ -94,7 +94,9 @@ namespace arith {
|
|||
m_bounds_pragma.m_ty = ty;
|
||||
m_bounds_pragma.m_literals.reset();
|
||||
m_bounds_pragma.m_eqs.reset();
|
||||
for (auto ev : m_explanation) {
|
||||
unsigned i = 0;
|
||||
for (auto const & ev : m_explanation) {
|
||||
++i;
|
||||
auto idx = ev.ci();
|
||||
if (UINT_MAX == idx)
|
||||
continue;
|
||||
|
|
|
@ -232,14 +232,13 @@ namespace arith {
|
|||
if (v == euf::null_theory_var)
|
||||
return;
|
||||
|
||||
TRACE("arith", tout << "v" << v << " " << be.kind() << " " << be.m_bound << "\n";);
|
||||
|
||||
reserve_bounds(v);
|
||||
|
||||
if (m_unassigned_bounds[v] == 0 && !should_refine_bounds()) {
|
||||
TRACE("arith", tout << "return\n";);
|
||||
if (m_unassigned_bounds[v] == 0 && !should_refine_bounds())
|
||||
return;
|
||||
}
|
||||
|
||||
TRACE("arith", tout << "lp bound v" << v << " " << be.kind() << " " << be.m_bound << "\n";);
|
||||
|
||||
lp_bounds const& bounds = m_bounds[v];
|
||||
bool first = true;
|
||||
for (unsigned i = 0; i < bounds.size(); ++i) {
|
||||
|
@ -249,7 +248,7 @@ namespace arith {
|
|||
literal lit = is_bound_implied(be.kind(), be.m_bound, *b);
|
||||
if (lit == sat::null_literal)
|
||||
continue;
|
||||
TRACE("arith", tout << lit << " bound: " << *b << " first: " << first << "\n";);
|
||||
TRACE("arith", tout << "lp bound " << lit << " bound: " << *b << " first: " << first << "\n";);
|
||||
|
||||
lp().settings().stats().m_num_of_implied_bounds++;
|
||||
if (first) {
|
||||
|
@ -263,7 +262,7 @@ namespace arith {
|
|||
TRACE("arith", for (auto lit : m_core) tout << lit << ": " << s().value(lit) << "\n";);
|
||||
DEBUG_CODE(for (auto lit : m_core) { VERIFY(s().value(lit) == l_true); });
|
||||
++m_stats.m_bound_propagations1;
|
||||
assign(lit, m_core, m_eqs, explain(sat::hint_type::farkas_h, lit));
|
||||
assign(lit, m_core, m_eqs, explain(sat::hint_type::bound_h, lit));
|
||||
}
|
||||
|
||||
if (should_refine_bounds() && first)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue