diff --git a/src/smt/theory_str.cpp b/src/smt/theory_str.cpp index 97f0d6369..b97023fc0 100644 --- a/src/smt/theory_str.cpp +++ b/src/smt/theory_str.cpp @@ -9099,16 +9099,16 @@ namespace smt { return refine_eq(lhs, rhs, offset.get_unsigned()); } // Let's just giveup if we find ourselves in the disjunctive fragment. - if (offset == rational(-1)) { // negative equation + if (offset == NEQ) { // negative equation ++m_stats.m_refine_neq; return refine_dis(lhs, rhs); } - if (offset == rational(-2)) { // function like contains, prefix,... + if (offset == PFUN) { // function like contains, prefix,... SASSERT(rhs == lhs); ++m_stats.m_refine_f; return refine_function(lhs); } - if (offset == rational(-3)) { // negated function + if (offset == NFUN) { // negated function SASSERT(rhs == lhs); ++m_stats.m_refine_nf; ast_manager & m = get_manager(); @@ -9252,7 +9252,7 @@ namespace smt { ast_manager & m = get_manager(); expr_ref lesson(m); - lesson = m.mk_not(ctx.mk_eq_atom(lhs, rhs)); + lesson = m.mk_not(m.mk_eq(lhs, rhs)); TRACE("str", tout << "learning not " << mk_pp(lesson, m) << std::endl;); return lesson; } diff --git a/src/smt/theory_str.h b/src/smt/theory_str.h index cde36b88e..23927325a 100644 --- a/src/smt/theory_str.h +++ b/src/smt/theory_str.h @@ -780,6 +780,11 @@ protected: void get_unique_non_concat_nodes(expr * node, std::set & argSet); bool propagate_length_within_eqc(expr * var); + + const rational NEQ = rational(-1); // negative word equation lesson + const rational PFUN = rational(-2); // positive function lesson + const rational NFUN = rational(-3); // negative function lesson + // TESTING void refresh_theory_var(expr * e); diff --git a/src/smt/theory_str_mc.cpp b/src/smt/theory_str_mc.cpp index b6520d80e..40da788b4 100644 --- a/src/smt/theory_str_mc.cpp +++ b/src/smt/theory_str_mc.cpp @@ -90,7 +90,6 @@ namespace smt { ast_manager & m = get_manager(); ast_manager & sub_m = subsolver.m(); - context & sub_ctx = subsolver.get_context(); expr * full = nullptr; expr * suff = nullptr; @@ -137,13 +136,14 @@ namespace smt { // full[j] == suff[j] expr_ref cLHS(full_chars.get(full_chars.size() - j - 1), sub_m); expr_ref cRHS(suff_chars.get(suff_chars.size() - j - 1), sub_m); - expr_ref _e(sub_ctx.mk_eq_atom(cLHS, cRHS), sub_m); + expr_ref _e(sub_m.mk_eq(cLHS, cRHS), sub_m); branch.push_back(_e); } expr_ref final_diseq(mk_and(branch), sub_m); fixed_length_assumptions.push_back(final_diseq); - fixed_length_lesson.insert(final_diseq, std::make_tuple(rational(-2), f, f)); + TRACE("str_fl", tout << "inserting into fixed_lesson" < lhs_chars, rhs_chars; @@ -834,8 +834,9 @@ namespace smt { for (unsigned i = 0; i < lhs_chars.size(); ++i) { expr_ref cLHS(lhs_chars.get(i), sub_m); expr_ref cRHS(rhs_chars.get(i), sub_m); - expr_ref _e(sub_ctx.mk_eq_atom(cLHS, cRHS), sub_m); + expr_ref _e(sub_m.mk_eq(cLHS, cRHS), sub_m); fixed_length_assumptions.push_back(_e); + TRACE("str_fl", tout << "inserting into fixed_lesson" <