This makes a small change to the sequence rewriter to work a bit harder
on one of the rewrite rule. This fixes some performance issues we've
observed.
Signed-off-by: Bruno Dutertre <dutebrun@amazon.com>
{
// must call rewrite contains directly to avoid infinite loop
Node ctn = nm->mkNode(STRING_CONTAINS, node[r], node[1 - r]);
+ Node prev = ctn;
ctn = rewriteContains(ctn);
Assert(!ctn.isNull());
+ if (ctn != prev && ctn.getKind() == STRING_CONTAINS)
+ {
+ prev = ctn;
+ ctn = rewriteContains(ctn);
+ Assert(!ctn.isNull());
+ }
if (ctn.isConst())
{
if (!ctn.getConst<bool>())