summaryrefslogtreecommitdiff
path: root/src/theory/strings/regexp_elim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/theory/strings/regexp_elim.cpp')
-rw-r--r--src/theory/strings/regexp_elim.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/theory/strings/regexp_elim.cpp b/src/theory/strings/regexp_elim.cpp
index b6a997629..e132d8e24 100644
--- a/src/theory/strings/regexp_elim.cpp
+++ b/src/theory/strings/regexp_elim.cpp
@@ -547,11 +547,13 @@ Node RegExpElimination::eliminateStar(Node atom)
Node lens = nm->mkNode(STRING_LENGTH, s);
lens = Rewriter::rewrite(lens);
Assert(lens.isConst());
+ Assert(lens.getConst<Rational>().sgn() > 0);
std::vector<Node> conj;
+ // lens is a positive constant, so it is safe to use total div/mod here.
Node bound = nm->mkNode(
AND,
nm->mkNode(LEQ, d_zero, index),
- nm->mkNode(LT, index, nm->mkNode(INTS_DIVISION, lenx, lens)));
+ nm->mkNode(LT, index, nm->mkNode(INTS_DIVISION_TOTAL, lenx, lens)));
Node conc =
nm->mkNode(STRING_SUBSTR, x, nm->mkNode(MULT, index, lens), lens)
.eqNode(s);
@@ -559,7 +561,9 @@ Node RegExpElimination::eliminateStar(Node atom)
Node bvl = nm->mkNode(BOUND_VAR_LIST, index);
Node res = nm->mkNode(FORALL, bvl, body);
res = nm->mkNode(
- AND, nm->mkNode(INTS_MODULUS, lenx, lens).eqNode(d_zero), res);
+ AND,
+ nm->mkNode(INTS_MODULUS_TOTAL, lenx, lens).eqNode(d_zero),
+ res);
// e.g.
// x in ("abc")* --->
// forall k. 0 <= k < (len( x ) div 3) => substr(x,3*k,3) = "abc" ^
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback