3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 17:45:32 +00:00

Add support for handling 'distinct' expressions in SLS context and user sort plugin

This commit is contained in:
Nikolaj Bjorner 2024-09-08 13:54:04 -07:00
parent a24b94828c
commit dda5dd7ccf
2 changed files with 17 additions and 0 deletions

View file

@ -181,6 +181,8 @@ namespace sls {
family_id fid = to_app(e)->get_family_id();
if (m.is_eq(e))
fid = to_app(e)->get_arg(0)->get_sort()->get_family_id();
if (m.is_distinct(e))
fid = to_app(e)->get_arg(0)->get_sort()->get_family_id();
return fid;
}

View file

@ -77,6 +77,21 @@ namespace sls {
ctx.flip(flit.var());
}
}
else if (e && m.is_distinct(e) && !lit.sign()) {
auto n = to_app(e)->get_num_args();
for (unsigned i = 0; i < n; ++i) {
auto a = m_g->find(to_app(e)->get_arg(i));
for (unsigned j = i + 1; j < n; ++j) {
auto b = m_g->find(to_app(e)->get_arg(j));
if (a->get_root() == b->get_root()) {
verbose_stream() << "block " << mk_bounded_pp(e, m) << "\n";
auto flit = block(a, b);
if (flit != sat::null_literal)
ctx.flip(flit.var());
}
}
}
}
else if (e && lit.sign()) {
auto a = m_g->find(e);
auto b = m_g->find(m.mk_true());