@Override
        protected boolean shouldConvert(Expression exp) {
            if (!ignoresInput) {
                return true;  // Answer found, skip ahead
            }
            if (exp == root) {
                return false;  // Skip root, check children
            }
            if (exp instanceof StatementExpression) {
                for (Expression expression : (StatementExpression) exp) {
                    if (ExpressionOptimizer.ignoresInput(expression)) {
                        return true;  // Skip children
                    }
                }
                ignoresInput = false;
                return true;  // Answer found, skip children
            }
            ignoresInput &= ExpressionOptimizer.ignoresInput(exp);
            return true;  // Children already checked. Skip them.
        }
Optimizes expressions by removing expressions that have no effect.
Typical examples are statements that come before a statement that
generates a new execution value without regard for the existing one.
indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/ExpressionOptimizer.java