mirror of
https://github.com/Z3Prover/z3
synced 2025-07-28 23:17:56 +00:00
#7739 optimization
add simplification rule for at(x, offset) = "" Introducing j just postpones some rewrites that prevent useful simplifications. Z3 already uses common sub-expressions. The example highlights some opportunities for simplification, noteworthy at(..) = "". The example is solved in both versions after adding this simplification.
This commit is contained in:
parent
8e1a528796
commit
1f8b08108c
1 changed files with 6 additions and 0 deletions
|
@ -6021,6 +6021,12 @@ bool seq_rewriter::reduce_eq_empty(expr* l, expr* r, expr_ref& result) {
|
|||
result = m_autil.mk_lt(s, zero());
|
||||
return true;
|
||||
}
|
||||
// at(s, offset) = "" <=> len(s) <= offset or offset < 0
|
||||
if (str().is_at(r, s, offset)) {
|
||||
expr_ref len_s(str().mk_length(s), m());
|
||||
result = m().mk_or(m_autil.mk_le(len_s, offset), m_autil.mk_lt(offset, zero()));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue