I try to make a simple substitution of a variable x (set variable if important) with another variable y. From the post here (Substitution in Z3 java), I presume that substitute works fine in Java. However I get the same expression object (when printed) as return. Is substitution correctly implemented or I am making a mistake? The below is the code snippet on how I define my variable and call substitute method in case it is relevant.

```
EnumSort xSort = ctx.mkEnumSort(xs, ctx.mkSymbol("A"),ctx.mkSymbol("B"));
SetSort xSet = ctx.mkSetSort(xSort);
Expr x = ctx.mkConst("x",xSet);
/*Construct the formula "formOld".....*/
Expr y = ctx.mkConst("y",x.getSort());
BoolExpr form_sub = (BoolExpr)formOld.substitute(x, y);
```

The formula formSub seems unchanged when I print. Couldn't find any hint from debugging.

Thanks.