3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-15 03:25:43 +00:00

Add regression test for QE unsoundness issue #4175

This commit is contained in:
copilot-swe-agent[bot] 2026-07-12 23:49:22 +00:00 committed by GitHub
parent 3757b7f66c
commit bcee5ef4d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -168,6 +168,44 @@ static void test_quant_solver(ast_manager& m, char const* str, bool validate = t
test_quant_solver(m, vars.size(), vars.data(), fml, validate);
}
static void test_qe_regression_4175() {
ast_manager m;
reg_decl_plugins(m);
smt_params params;
arith_util a(m);
expr_ref fml = parse_fml(m, "(forall ((b Real)) (= (= r1 b) (= b 0)))");
expr_ref result(m);
qe::expr_quant_elim qe(m, params);
qe(m.mk_true(), fml, result);
expr_ref r1(m.mk_const(symbol("r1"), a.mk_real()), m);
expr_ref zero(a.mk_numeral(rational(0), false), m);
{
smt::kernel solver(m, params);
solver.assert_expr(fml);
VERIFY(l_true == solver.check());
}
{
smt::kernel solver(m, params);
solver.assert_expr(result);
VERIFY(l_true == solver.check());
}
{
smt::kernel solver(m, params);
solver.assert_expr(result);
solver.assert_expr(m.mk_eq(r1, zero));
VERIFY(l_true == solver.check());
}
{
smt::kernel solver(m, params);
solver.assert_expr(result);
solver.assert_expr(m.mk_not(m.mk_eq(r1, zero)));
VERIFY(l_false == solver.check());
}
}
static void test_quant_solve1() {
ast_manager m;
@ -253,6 +291,7 @@ void tst_quant_solve() {
disable_debug("heap");
test_quant_solve1();
test_qe_regression_4175();
#if 0
memory::finalize();
@ -263,4 +302,3 @@ void tst_quant_solve() {
#endif
}