{
if (children_s.empty())
{
- // check if beyond this, we can't do it or there is nothing
- // left, if so, repeat
- bool can_skip = false;
+ // Check if beyond this, we hit a conflict. In this case, we
+ // must repeat. Notice that we do not treat the case where
+ // there are no more strings to consume as a failure, since
+ // we may be within a recursive call, see issue #5510.
+ bool can_skip = true;
if (children.size() > 1)
{
std::vector<Node> mchildren_ss;
Trace("regexp-ext-rewrite-debug") << push;
Node rets = simpleRegexpConsume(mchildren_ss, children_ss, t);
Trace("regexp-ext-rewrite-debug") << pop;
- if (rets.isNull())
+ if (!rets.isNull())
{
- can_skip = true;
+ can_skip = false;
}
}
if (!can_skip)
regress1/strings/issue5330_2.smt2
regress1/strings/issue5374-proxy-i.smt2
regress1/strings/issue5483-pp-leq.smt2
+ regress1/strings/issue5510-re-consume.smt2
regress1/strings/kaluza-fl.smt2
regress1/strings/loop002.smt2
regress1/strings/loop003.smt2
--- /dev/null
+; COMMAND-LINE: --strings-exp
+; EXPECT: sat
+(set-logic QF_S)
+(set-info :status sat)
+(declare-fun x () String)
+(declare-fun y () String)
+(assert (str.in_re (str.++ x "B" y) (re.* (re.++ (str.to_re "A") (re.union (re.* (str.to_re "A")) (str.to_re "B"))))))
+(assert (str.in_re y (str.to_re "A")))
+(check-sat)