// must use partial substitute here, to avoid substitution into witness
std::map<Kind, bool> rkinds;
nn = partialSubstitute(t1, vars, subs, rkinds);
+ nn = Rewriter::rewrite(nn);
if (nn != t1)
{
// If full=false, then we've duplicated a term u in the children of n.
// For example, when ITE pulling, we have n is of the form:
// ite( C, f( u, t1 ), f( u, t2 ) )
// We must show that at least one copy of u dissappears in this case.
- nn = Rewriter::rewrite(nn);
if (nn == t2)
{
new_ret = nn;
--- /dev/null
+; COMMAND-LINE: --ext-rew-prep --ext-rew-prep-agg
+; EXPECT: sat
+(set-logic ALL)
+(declare-fun a () String)
+(assert
+ (str.contains ""
+ (str.replace_all ""
+ (str.substr a 1
+ (str.to_int
+ (str.substr
+ (str.substr a 0
+ (ite (= (str.len (str.substr a 2 1)) 1)
+ (ite (< (str.len a) 0)
+ (ite (= (str.len (str.substr (str.substr a 2 1) (str.len (str.substr a 1 1)) 2)) 1) 1 0)
+ (- 1))
+ 0))
+ 0 2)))
+ a)))
+(check-sat)