diff options
Diffstat (limited to 'src/theory/strings/term_registry.cpp')
-rw-r--r-- | src/theory/strings/term_registry.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/theory/strings/term_registry.cpp b/src/theory/strings/term_registry.cpp index c7b3b5300..aac9e9313 100644 --- a/src/theory/strings/term_registry.cpp +++ b/src/theory/strings/term_registry.cpp @@ -90,13 +90,17 @@ Node TermRegistry::eagerReduce(Node t, SkolemCache* sc) } else if (tk == STRING_STRIDOF || tk == STRING_INDEXOF_RE) { - // (and (>= (f x y n) (- 1)) (<= (f x y n) (str.len x))) + // (and + // (or (= (f x y n) (- 1)) (>= (f x y n) n)) + // (<= (f x y n) (str.len x))) // // where f in { str.indexof, str.indexof_re } Node l = nm->mkNode(STRING_LENGTH, t[0]); - lemma = nm->mkNode(AND, - nm->mkNode(GEQ, t, nm->mkConst(Rational(-1))), - nm->mkNode(LEQ, t, l)); + lemma = nm->mkNode( + AND, + nm->mkNode( + OR, nm->mkConst(Rational(-1)).eqNode(t), nm->mkNode(GEQ, t, t[2])), + nm->mkNode(LEQ, t, l)); } else if (tk == STRING_STOI) { |