3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Add RUP checking mode to proof checker.

This commit is contained in:
Nikolaj Bjorner 2022-08-30 09:45:19 -07:00
parent 8cb118235a
commit 0f475f45b5
3 changed files with 63 additions and 19 deletions

View file

@ -158,14 +158,14 @@ namespace arith {
sort_ref_vector sorts(m);
for (unsigned i = m_lit_head; i < m_lit_tail; ++i) {
auto const& [coeff, lit] = a.m_arith_hint.lit(i);
args.push_back(arith.mk_int(coeff*lc));
args.push_back(arith.mk_int(abs(coeff*lc)));
args.push_back(s.literal2expr(lit));
}
for (unsigned i = m_eq_head; i < m_eq_tail; ++i) {
auto const& [x, y, is_eq] = a.m_arith_hint.eq(i);
expr_ref eq(m.mk_eq(x->get_expr(), y->get_expr()), m);
if (!is_eq) eq = m.mk_not(eq);
args.push_back(arith.mk_int(lc));
args.push_back(arith.mk_int(1));
args.push_back(eq);
}
for (expr* arg : args)

View file

@ -370,7 +370,10 @@ namespace arith {
expr* x, *y;
for (expr* arg : *jst) {
if (even) {
VERIFY(a.is_numeral(arg, coeff));
if (!a.is_numeral(arg, coeff)) {
IF_VERBOSE(0, verbose_stream() << "not numeral " << mk_pp(jst, m) << "\n");
return false;
}
}
else {
bool sign = m.is_not(arg, arg);
@ -387,13 +390,16 @@ namespace arith {
}
even = !even;
}
// display(verbose_stream());
// todo: correlate with literals in clause, literals that are not in clause should have RUP property.
return check_farkas();
if (check_farkas())
return true;
IF_VERBOSE(0, verbose_stream() << "did not check farkas\n" << mk_pp(jst, m) << "\n");
return false;
}
// todo: rules for bounds and implied-by
IF_VERBOSE(0, verbose_stream() << "did not check " << mk_pp(jst, m) << "\n");
return false;
}