@@ -691,15 +691,12 @@ br_status seq_rewriter::mk_seq_length(expr* a, expr_ref& result) {
691
691
return BR_REWRITE3;
692
692
}
693
693
#if 0
694
- expr* s = nullptr, *offs = nullptr, *l = nullptr;
695
- // len(extract(s, offs, len(s) - offs)) = max(0, len(s) - offs)
696
- //
697
- if (m_util.str.is_extract(a, s, offs, l) && is_suffix(s, offs, l)) {
698
- result = m_autil.mk_sub(m_util.str.mk_length(s), offs);
699
- result = m().mk_ite(m_autil.mk_ge(result, zero()), result, zero());
700
- return BR_REWRITE_FULL;
694
+ if (m().is_ite(a, c, t, e) && (get_depth(t) <= 2 || get_depth(e) <= 2)) {
695
+ result = m().mk_ite(c, m_util.str.mk_length(t), m_util.str.mk_length(e));
696
+ return BR_REWRITE3;
701
697
}
702
698
#endif
699
+
703
700
return BR_FAILED;
704
701
}
705
702
@@ -774,6 +771,21 @@ br_status seq_rewriter::mk_seq_extract(expr* a, expr* b, expr* c, expr_ref& resu
774
771
bool lengthPos = m_util.str .is_length (b) || m_autil.is_add (b);
775
772
sort* a_sort = m ().get_sort (a);
776
773
774
+ expr* cond = nullptr , *t = nullptr , *e = nullptr ;
775
+ #if 0
776
+ if (m().is_ite(a, cond, t, e) && (get_depth(t) <= 2 || get_depth(e) <= 2)) {
777
+ result = m().mk_ite(cond, m_util.str.mk_substr(t, b, c), m_util.str.mk_substr(e, b, c));
778
+ return BR_REWRITE3;
779
+ }
780
+ if (m().is_ite(b, cond, t, e) && (get_depth(t) <= 2 || get_depth(e) <= 2)) {
781
+ result = m().mk_ite(cond, m_util.str.mk_substr(a, t, c), m_util.str.mk_substr(a, e, c));
782
+ return BR_REWRITE3;
783
+ }
784
+ if (m().is_ite(c, cond, t, e) && (get_depth(t) <= 2 || get_depth(e) <= 2)) {
785
+ result = m().mk_ite(cond, m_util.str.mk_substr(a, b, t), m_util.str.mk_substr(a, b, e));
786
+ return BR_REWRITE3;
787
+ }
788
+ #endif
777
789
sign sg;
778
790
if (sign_is_determined (c, sg) && sg == sign_neg) {
779
791
result = m_util.str .mk_empty (a_sort);
0 commit comments