* children. If nothing changes, the argument is cached and
* returned, otherwise a replacement intExpr is cached and returned.
* @return { e: IntExpression | e.op = intExpr.op && #e.children = #intExpr.children && all i: [0..intExpr.children) | e.child(i) = intExpr.child(i).accept(this) }
*/
public IntExpression visit(NaryIntExpression intExpr) {
IntExpression ret = lookup(intExpr);
if (ret!=null) return ret;
final IntExpression[] visited = new IntExpression[intExpr.size()];
boolean allSame = true;
for(int i = 0 ; i < visited.length; i++) {
final IntExpression child = intExpr.child(i);
visited[i] = child.accept(this);
allSame = allSame && visited[i]==child;
}
ret = allSame ? intExpr : IntExpression.compose(intExpr.op(), visited);
return cache(intExpr,ret);