@Override
    public void endVisitMath(MathOperator mathOperator) {
        Object rightOperand = this.conditionOperands.pop();
        Object leftOperand = this.conditionOperands.pop();
        if (!(rightOperand instanceof String) && !(leftOperand instanceof String)) {
            Expression expression = null;
            switch (mathOperator) {
                case ADD:
                    expression = Expression.add(
                            ((Expression) leftOperand), ((Expression) rightOperand)
                    );
                    break;
                case SUBTRACT:
                    expression = Expression.subtract(
                            ((Expression) leftOperand), ((Expression) rightOperand)
                    );
                    break;
                case MULTIPLY:
                    expression = Expression.multiply(
                            ((Expression) leftOperand), ((Expression) rightOperand)
                    );
                    break;
                case DIVIDE:
                    expression = Expression.divide(
                            ((Expression) leftOperand), ((Expression) rightOperand)
                    );
                    break;
                case MOD:
                    expression = Expression.mod(
                            ((Expression) leftOperand), ((Expression) rightOperand)
                    );
                    break;
                default:
                    this.conditionOperands.push("true");
            }
            this.conditionOperands.push(expression);
        } else {
            this.conditionOperands.push("true");
        }
    }
Visitor class to reduce on condition Expression
modules/siddhi-core/src/main/java/io/siddhi/core/aggregation/AggregationExpressionVisitor.java