Skip to content

Commit

Permalink
fix #6675
Browse files Browse the repository at this point in the history
disable remove_unused_defs from pb-solver until it is integrated with model reconstruction.
  • Loading branch information
NikolajBjorner committed Apr 13, 2023
1 parent e822243 commit eba0732
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
15 changes: 8 additions & 7 deletions src/ast/rewriter/pb2bv_rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,16 +825,17 @@ struct pb2bv_rewriter::imp {
if (a->get_family_id() == au.get_family_id()) {
switch (a->get_decl_kind()) {
case OP_ADD:
for (unsigned i = 0; i < sz; ++i) {
if (!is_pb(a->get_arg(i), mul)) return false;
}
for (unsigned i = 0; i < sz; ++i)
if (!is_pb(a->get_arg(i), mul))
return false;
return true;
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;
for (unsigned i = 1; i < sz; ++i) {
if (!is_pb(a->get_arg(1), r)) return false;
}
for (unsigned i = 1; i < sz; ++i)
if (!is_pb(a->get_arg(i), r))
return false;
return true;
}
case OP_UMINUS:
Expand Down
2 changes: 1 addition & 1 deletion src/cmd_context/cmd_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
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());
r = m().mk_app(fn, num_args, args);
return true;
Expand Down
9 changes: 7 additions & 2 deletions src/sat/smt/pb_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_learned.size(), i = 0; i < sz; ++i) simplify(*m_learned[i]);
init_use_lists();
remove_unused_defs();
// remove_unused_defs();
set_non_external();
elim_pure();
for (unsigned sz = m_constraints.size(), i = 0; i < sz; ++i) subsumption(*m_constraints[i]);
Expand Down Expand Up @@ -2528,8 +2528,13 @@ namespace pb {
}

void solver::remove_unused_defs() {
if (incremental_mode()) return;
if (incremental_mode())
return;
// 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) {
constraint& c = *cp;
literal lit = c.lit();
Expand Down

0 comments on commit eba0732

Please sign in to comment.