mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
na
This commit is contained in:
parent
0b0efa83ca
commit
1b503b8887
3 changed files with 36 additions and 14 deletions
|
@ -4853,7 +4853,17 @@ bool seq_rewriter::reduce_itos(expr_ref_vector& ls, expr_ref_vector& rs,
|
|||
|
||||
bool seq_rewriter::reduce_eq_empty(expr* l, expr* r, expr_ref& result) {
|
||||
if (str().is_empty(r))
|
||||
std::swap(l,r);
|
||||
std::swap(l, r);
|
||||
if (str().is_length(r))
|
||||
std::swap(l, r);
|
||||
#if 0
|
||||
rational n;
|
||||
if (str().is_length(l) && m_autil.is_numeral(r, n) && n.is_zero()) {
|
||||
VERIFY(str().is_length(l, l));
|
||||
result = m().mk_eq(l, str().mk_empty(l->get_sort()));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
if (!str().is_empty(l))
|
||||
return false;
|
||||
expr* s = nullptr, *offset = nullptr, *len = nullptr;
|
||||
|
|
|
@ -176,6 +176,8 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
|
|||
// theory dispatch for =
|
||||
SASSERT(num == 2);
|
||||
family_id s_fid = args[0]->get_sort()->get_family_id();
|
||||
family_id op_fid = s_fid;
|
||||
try_mk_eq:
|
||||
if (s_fid == m_a_rw.get_fid())
|
||||
st = m_a_rw.mk_eq_core(args[0], args[1], result);
|
||||
else if (s_fid == m_bv_rw.get_fid())
|
||||
|
@ -190,6 +192,13 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
|
|||
st = m_seq_rw.mk_eq_core(args[0], args[1], result);
|
||||
if (st != BR_FAILED)
|
||||
return st;
|
||||
op_fid = s_fid;
|
||||
if (is_app(args[0]))
|
||||
op_fid = to_app(args[0])->get_family_id();
|
||||
if (op_fid != s_fid) {
|
||||
s_fid = op_fid;
|
||||
goto try_mk_eq;
|
||||
}
|
||||
}
|
||||
if (k == OP_EQ) {
|
||||
SASSERT(num == 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue