Addresses the issue on #8295.
The re elimination module was assuming that a trivial RE was rewritten when it was not.
case Rewrite::RE_STAR_EMPTY_STRING: return "RE_STAR_EMPTY_STRING";
case Rewrite::RE_STAR_NESTED_STAR: return "RE_STAR_NESTED_STAR";
case Rewrite::RE_STAR_UNION: return "RE_STAR_UNION";
+ case Rewrite::RE_STAR_UNION_CHAR: return "RE_STAR_UNION_CHAR";
case Rewrite::REPL_CHAR_NCONTRIB_FIND: return "REPL_CHAR_NCONTRIB_FIND";
case Rewrite::REPL_DUAL_REPL_ITE: return "REPL_DUAL_REPL_ITE";
case Rewrite::REPL_REPL_SHORT_CIRCUIT: return "REPL_REPL_SHORT_CIRCUIT";
RE_STAR_EMPTY_STRING,
RE_STAR_NESTED_STAR,
RE_STAR_UNION,
+ RE_STAR_UNION_CHAR,
REPL_CHAR_NCONTRIB_FIND,
REPL_DUAL_REPL_ITE,
REPL_REPL_SHORT_CIRCUIT,
}
else if (node[0].getKind() == REGEXP_UNION)
{
+ for (const Node& nc : node[0])
+ {
+ if (nc.getKind() == REGEXP_ALLCHAR)
+ {
+ // (re.* (re.union ... re.allchar ...)) ---> (re.* re.allchar)
+ retNode = nm->mkNode(REGEXP_STAR, nc);
+ return returnRewrite(node, retNode, Rewrite::RE_STAR_UNION_CHAR);
+ }
+ }
// simplification of unions under star
if (RegExpEntail::hasEpsilonNode(node[0]))
{
regress0/strings/issue6681-split-eq-strip-l.smt2
regress0/strings/issue6834-str-eq-const-nhomog.smt2
regress0/strings/issue7974-incomplete-neg-member.smt2
+ regress0/strings/issue8295-star-union-char.smt2
regress0/strings/itos-entail.smt2
regress0/strings/large-model.smt2
regress0/strings/leadingzero001.smt2
--- /dev/null
+(set-logic ALL)
+(set-info :status sat)
+(set-option :re-elim-agg true)
+(set-option :re-elim true)
+(declare-fun str9 () String)
+(assert (str.in_re str9 (re.* (re.union re.allchar (str.to_re "lE")))))
+(check-sat)