public override IExpression?Simplify() { var newLeft = Left?.Simplify(); var newRight = Right?.Simplify(); var leftConst = newLeft as ConstantExpression; var rightConst = newRight as ConstantExpression; if (leftConst != null && rightConst != null) { // two constants return(new ConstantExpression(BooleanFunctions.Or(leftConst.Value, rightConst.Value))); } if (leftConst?.Value == 1 || rightConst?.Value == 1) { return(new ConstantExpression(1.0)); } return(new OrExpression(newLeft, newRight)); }
protected override Number Evaluate(Number number1, Number number2) { return(BooleanFunctions.Or(number1, number2)); }