3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 09:44:43 +00:00

more resilient equality adapter

This commit is contained in:
Nikolaj Bjorner 2020-10-12 10:35:01 -07:00
parent ae7d76767b
commit e3d1849be2
2 changed files with 14 additions and 3 deletions

View file

@ -524,8 +524,13 @@ namespace smt {
behavior conflicts with a convention used by the theory/family.
*/
virtual app * mk_eq_atom(expr * lhs, expr * rhs) {
ast_manager& m = get_manager();
if (lhs->get_id() > rhs->get_id())
std::swap(lhs, rhs);
if (m.are_distinct(lhs, rhs))
return m.mk_false();
if (m.are_equal(lhs, rhs))
return m.mk_true();
return get_manager().mk_eq(lhs, rhs);
}