mirror of
https://github.com/Z3Prover/z3
synced 2025-08-24 03:57:51 +00:00
aligning simplifier and rewriter for regression tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
a3dba5b2f9
commit
f12a4f04fd
12 changed files with 125 additions and 43 deletions
|
@ -455,7 +455,7 @@ br_status arith_rewriter::mk_le_ge_eq_core(expr * arg1, expr * arg2, op_kind kin
|
|||
st = BR_DONE;
|
||||
}
|
||||
}
|
||||
if (is_numeral(arg2, a2) && is_neg_poly(arg1, new_arg1)) {
|
||||
if (m_arith_lhs && is_numeral(arg2, a2) && is_neg_poly(arg1, new_arg1)) {
|
||||
a2.neg();
|
||||
new_arg2 = m_util.mk_numeral(a2, m_util.is_int(new_arg1));
|
||||
switch (kind) {
|
||||
|
@ -523,7 +523,7 @@ expr_ref arith_rewriter::neg_monomial(expr* e) const {
|
|||
}
|
||||
else {
|
||||
args.push_back(m_util.mk_numeral(rational(-1), m_util.is_int(e)));
|
||||
args.append(to_app(e)->get_num_args(), to_app(e)->get_args());
|
||||
args.push_back(e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -36,6 +36,7 @@ protected:
|
|||
bool m_sort_sums;
|
||||
bool m_hoist_mul;
|
||||
bool m_hoist_cmul;
|
||||
bool m_ast_order;
|
||||
|
||||
bool is_numeral(expr * n) const { return Config::is_numeral(n); }
|
||||
bool is_numeral(expr * n, numeral & r) const { return Config::is_numeral(n, r); }
|
||||
|
|
|
@ -18,7 +18,8 @@ Notes:
|
|||
--*/
|
||||
#include "ast/rewriter/poly_rewriter.h"
|
||||
#include "ast/rewriter/poly_rewriter_params.hpp"
|
||||
// include "ast/ast_lt.h"
|
||||
#include "ast/rewriter/arith_rewriter_params.hpp"
|
||||
#include "ast/ast_lt.h"
|
||||
#include "ast/ast_ll_pp.h"
|
||||
#include "ast/ast_smt2_pp.h"
|
||||
|
||||
|
@ -33,6 +34,8 @@ void poly_rewriter<Config>::updt_params(params_ref const & _p) {
|
|||
m_som_blowup = p.som_blowup();
|
||||
if (!m_flat) m_som = false;
|
||||
if (m_som) m_hoist_mul = false;
|
||||
arith_rewriter_params ap(_p);
|
||||
m_ast_order = !ap.arith_ineq_lhs();
|
||||
}
|
||||
|
||||
template<typename Config>
|
||||
|
@ -485,6 +488,8 @@ void poly_rewriter<Config>::hoist_cmul(expr_ref_buffer & args) {
|
|||
|
||||
template<typename Config>
|
||||
bool poly_rewriter<Config>::mon_lt::operator()(expr* e1, expr * e2) const {
|
||||
if (rw.m_ast_order)
|
||||
return lt(e1,e2);
|
||||
return ordinal(e1) < ordinal(e2);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue