mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
fixes to cuts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
7d8b56027f
commit
dcd4fff284
18 changed files with 75 additions and 50 deletions
|
@ -147,19 +147,20 @@ struct expr2subpaving::imp {
|
|||
|
||||
// Put t as a^k.
|
||||
void as_power(expr * t, expr * & a, unsigned & k) {
|
||||
if (!m_autil.is_power(t)) {
|
||||
expr* p = nullptr;
|
||||
if (!m_autil.is_power(t, a, p)) {
|
||||
a = t;
|
||||
k = 1;
|
||||
return;
|
||||
}
|
||||
rational _k;
|
||||
if (!m_autil.is_numeral(to_app(t)->get_arg(1), _k) || !_k.is_int() || !_k.is_unsigned()) {
|
||||
if (m_autil.is_numeral(p, _k) && _k.is_unsigned() && !_k.is_zero()) {
|
||||
k = _k.get_unsigned();
|
||||
}
|
||||
else {
|
||||
a = t;
|
||||
k = 1;
|
||||
return;
|
||||
}
|
||||
a = to_app(t)->get_arg(0);
|
||||
k = _k.get_unsigned();
|
||||
}
|
||||
|
||||
subpaving::var process_mul(app * t, unsigned depth, mpz & n, mpz & d) {
|
||||
|
@ -168,7 +169,7 @@ struct expr2subpaving::imp {
|
|||
found_non_simplified();
|
||||
rational k;
|
||||
expr * m;
|
||||
if (m_autil.is_numeral(t->get_arg(0), k)) {
|
||||
if (m_autil.is_numeral(t->get_arg(0), k) && !k.is_zero()) {
|
||||
if (num_args != 2)
|
||||
found_non_simplified();
|
||||
qm().set(n, k.to_mpq().numerator());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue