mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 20:05:51 +00:00
fix bug in translation of pbeq into sat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
badb32f9ae
commit
354c16454a
5 changed files with 10 additions and 7 deletions
|
@ -162,6 +162,9 @@ app * pb_util::mk_eq(unsigned num_args, rational const * coeffs, expr * const *
|
|||
if (!m_k.is_int()) {
|
||||
return m.mk_false();
|
||||
}
|
||||
if (num_args == 0) {
|
||||
return m_k.is_zero() ? m.mk_true() : m.mk_false();
|
||||
}
|
||||
m_params.reset();
|
||||
m_params.push_back(parameter(m_k));
|
||||
for (unsigned i = 0; i < num_args; ++i) {
|
||||
|
|
|
@ -94,12 +94,7 @@ struct pb2bv_rewriter::imp {
|
|||
for (unsigned i = 0; i < m_args.size(); ++i) {
|
||||
cas.push_back(std::make_pair(m_coeffs[i], expr_ref(m_args[i].get(), m)));
|
||||
}
|
||||
//for (ca const& ca : cas) std::cout << ca.first << " ";
|
||||
//std::cout << "\n";
|
||||
std::sort(cas.begin(), cas.end(), compare_coeffs());
|
||||
//std::cout << "post-sort\n";
|
||||
//for (ca const& ca : cas) std::cout << ca.first << " ";
|
||||
//std::cout << "\n";
|
||||
m_coeffs.reset();
|
||||
m_args.reset();
|
||||
for (ca const& ca : cas) {
|
||||
|
|
|
@ -329,7 +329,7 @@ br_status pb_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * cons
|
|||
tout << tmp << "\n";
|
||||
tout << result << "\n";
|
||||
);
|
||||
|
||||
|
||||
TRACE("pb_validate",
|
||||
validate_rewrite(f, num_args, args, result););
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue