3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-27 16:38:45 +00:00

handle root expressions, and checking exponentiation with nlsat

this one is for you @matthai
This commit is contained in:
Nikolaj Bjorner 2025-04-22 13:47:38 -07:00
parent 2fe2735b5e
commit ff920ba51b
2 changed files with 131 additions and 61 deletions

View file

@ -1099,6 +1099,14 @@ public:
expr_ref zero(a.mk_real(0), m);
mk_axiom(~mk_literal(a.mk_le(p, zero)));
}
if (a.is_extended_numeral(y, r) && r > 0) {
// r is 1/n then x >= 0 => x = p^n
if (numerator(r) == 1 && denominator(r) > 1) {
expr_ref x_ge_0(a.mk_ge(x, a.mk_real(0)), m);
expr_ref x_eq_pn(a.mk_eq(x, a.mk_power(p, a.mk_real(denominator(r)))), m);
mk_axiom(~mk_literal(x_ge_0), mk_literal(x_eq_pn));
}
}
bool can_be_underspecified = false;
if (a.is_numeral(x, r) && r == 0 && (!a.is_numeral(y, r) || r == 0))
can_be_underspecified = true;