mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 06:03:23 +00:00
fix #6675
disable remove_unused_defs from pb-solver until it is integrated with model reconstruction.
This commit is contained in:
parent
e8222433c3
commit
eba0732629
3 changed files with 16 additions and 10 deletions
|
@ -825,16 +825,17 @@ struct pb2bv_rewriter::imp {
|
||||||
if (a->get_family_id() == au.get_family_id()) {
|
if (a->get_family_id() == au.get_family_id()) {
|
||||||
switch (a->get_decl_kind()) {
|
switch (a->get_decl_kind()) {
|
||||||
case OP_ADD:
|
case OP_ADD:
|
||||||
for (unsigned i = 0; i < sz; ++i) {
|
for (unsigned i = 0; i < sz; ++i)
|
||||||
if (!is_pb(a->get_arg(i), mul)) return false;
|
if (!is_pb(a->get_arg(i), mul))
|
||||||
}
|
return false;
|
||||||
return true;
|
return true;
|
||||||
case OP_SUB: {
|
case OP_SUB: {
|
||||||
if (!is_pb(a->get_arg(0), mul)) return false;
|
if (!is_pb(a->get_arg(0), mul))
|
||||||
|
return false;
|
||||||
r = -mul;
|
r = -mul;
|
||||||
for (unsigned i = 1; i < sz; ++i) {
|
for (unsigned i = 1; i < sz; ++i)
|
||||||
if (!is_pb(a->get_arg(1), r)) return false;
|
if (!is_pb(a->get_arg(i), r))
|
||||||
}
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case OP_UMINUS:
|
case OP_UMINUS:
|
||||||
|
|
|
@ -1240,7 +1240,7 @@ bool cmd_context::try_mk_pdecl_app(symbol const & s, unsigned num_args, expr * c
|
||||||
if (!dt.is_datatype(args[0]->get_sort()))
|
if (!dt.is_datatype(args[0]->get_sort()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (auto* a : dt.plugin().get_accessors(s)) {
|
for (auto* a : dt.plugin().get_accessors(s)) {
|
||||||
fn = a->instantiate(args[0]->get_sort());
|
fn = a->instantiate(args[0]->get_sort());
|
||||||
r = m().mk_app(fn, num_args, args);
|
r = m().mk_app(fn, num_args, args);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2039,7 +2039,7 @@ namespace pb {
|
||||||
for (unsigned sz = m_constraints.size(), i = 0; i < sz; ++i) simplify(*m_constraints[i]);
|
for (unsigned sz = m_constraints.size(), i = 0; i < sz; ++i) simplify(*m_constraints[i]);
|
||||||
for (unsigned sz = m_learned.size(), i = 0; i < sz; ++i) simplify(*m_learned[i]);
|
for (unsigned sz = m_learned.size(), i = 0; i < sz; ++i) simplify(*m_learned[i]);
|
||||||
init_use_lists();
|
init_use_lists();
|
||||||
remove_unused_defs();
|
// remove_unused_defs();
|
||||||
set_non_external();
|
set_non_external();
|
||||||
elim_pure();
|
elim_pure();
|
||||||
for (unsigned sz = m_constraints.size(), i = 0; i < sz; ++i) subsumption(*m_constraints[i]);
|
for (unsigned sz = m_constraints.size(), i = 0; i < sz; ++i) subsumption(*m_constraints[i]);
|
||||||
|
@ -2528,8 +2528,13 @@ namespace pb {
|
||||||
}
|
}
|
||||||
|
|
||||||
void solver::remove_unused_defs() {
|
void solver::remove_unused_defs() {
|
||||||
if (incremental_mode()) return;
|
if (incremental_mode())
|
||||||
|
return;
|
||||||
// remove constraints where indicator literal isn't used.
|
// remove constraints where indicator literal isn't used.
|
||||||
|
NOT_IMPLEMENTED_YET();
|
||||||
|
// TODO: #6675
|
||||||
|
// need to add this inequality to the model reconstruction
|
||||||
|
// stack in order to produce correct models.
|
||||||
for (constraint* cp : m_constraints) {
|
for (constraint* cp : m_constraints) {
|
||||||
constraint& c = *cp;
|
constraint& c = *cp;
|
||||||
literal lit = c.lit();
|
literal lit = c.lit();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue