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);
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" ^
regress1/strings/nterm-re-inter-sigma.smt2
regress1/strings/pierre150331.smt2
regress1/strings/policy_variable.smt2
+ regress1/strings/re-agg-total1.smt2
+ regress1/strings/re-agg-total2.smt2
regress1/strings/re-elim-exact.smt2
regress1/strings/re-unsound-080718.smt2
regress1/strings/regexp001.smt2
--- /dev/null
+(set-info :smt-lib-version 2.6)
+(set-logic QF_S)
+(set-info :status unsat)
+(set-option :strings-exp true)
+(set-option :re-elim-agg true)
+(declare-const x String)
+(declare-const y String)
+
+
+(assert (str.in.re x (re.* (str.to.re "ab") ) ) )
+(assert (str.in.re x (re.* (str.to.re "abab") ) ) )
+(assert (str.in.re x (re.* (str.to.re "ababac") ) ) )
+
+(assert (> (str.len x) 1) )
+
+(check-sat)
+(get-model)
--- /dev/null
+(set-info :smt-lib-version 2.6)
+(set-logic ALL)
+(set-info :status unsat)
+(set-option :strings-exp true)
+(set-option :re-elim-agg true)
+(declare-const x String)
+(declare-const y String)
+(assert (str.in.re x (re.* (str.to.re "'\r''k'\n'"))))
+(assert (str.in.re x (re.* (str.to.re "'\r''k'\n''\r''k'\n'"))))
+(assert (> (str.len x) 20))
+(assert (< (str.len x) 25))
+(check-sat)
+(get-model)