3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-11 13:40:52 +00:00

switch to solve_eqs2 tactic

This commit is contained in:
Nikolaj Bjorner 2022-11-08 12:23:36 -08:00
parent f769e2f1f6
commit 3a37cfca30
24 changed files with 149 additions and 52 deletions

View file

@ -29,16 +29,23 @@ namespace euf {
class basic_extract_eq : public extract_eq {
ast_manager& m;
bool m_ite_solver = true;
bool m_allow_bool = true;
public:
basic_extract_eq(ast_manager& m) : m(m) {}
virtual void set_allow_booleans(bool f) {
m_allow_bool = f;
}
void get_eqs(dependent_expr const& e, dep_eq_vector& eqs) override {
auto [f, d] = e();
expr* x, * y;
if (m.is_eq(f, x, y)) {
if (x == y)
return;
if (!m_allow_bool && m.is_bool(x))
return;
if (is_uninterp_const(x))
eqs.push_back(dependent_eq(e.fml(), to_app(x), expr_ref(y, m), d));
if (is_uninterp_const(y))
@ -47,6 +54,8 @@ namespace euf {
expr* c, * th, * el, * x1, * y1, * x2, * y2;
if (m_ite_solver && m.is_ite(f, c, th, el)) {
if (m.is_eq(th, x1, y1) && m.is_eq(el, x2, y2)) {
if (!m_allow_bool && m.is_bool(x1))
return;
if (x1 == y2 && is_uninterp_const(x1))
std::swap(x2, y2);
if (x2 == y2 && is_uninterp_const(x2))
@ -57,6 +66,8 @@ namespace euf {
eqs.push_back(dependent_eq(e.fml(), to_app(x1), expr_ref(m.mk_ite(c, y1, y2), m), d));
}
}
if (!m_allow_bool)
return;
if (is_uninterp_const(f))
eqs.push_back(dependent_eq(e.fml(), to_app(f), expr_ref(m.mk_true(), m), d));
if (m.is_not(f, x) && is_uninterp_const(x))