mirror of
https://github.com/Z3Prover/z3
synced 2025-04-22 16:45:31 +00:00
enhance rewriting for indexof based on #3516
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f92050c7e5
commit
73d73e6c95
1 changed files with 17 additions and 0 deletions
|
@ -1138,6 +1138,23 @@ br_status seq_rewriter::mk_seq_index(expr* a, expr* b, expr* c, expr_ref& result
|
|||
result = c;
|
||||
return BR_DONE;
|
||||
}
|
||||
|
||||
if (a == b) {
|
||||
if (m_autil.is_numeral(c, r)) {
|
||||
if (r.is_zero()) {
|
||||
result = m_autil.mk_int(0);
|
||||
}
|
||||
else {
|
||||
result = m_autil.mk_int(-1);
|
||||
}
|
||||
return BR_DONE;
|
||||
}
|
||||
else {
|
||||
result = m().mk_ite(m().mk_eq(m_autil.mk_int(0), c), m_autil.mk_int(0), m_autil.mk_int(-1));
|
||||
return BR_REWRITE2;
|
||||
}
|
||||
}
|
||||
|
||||
// Enhancement: walk segments of a, determine which segments must overlap, must not overlap, may overlap.
|
||||
return BR_FAILED;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue