namespace Bts.ArithmeticExpressions; using System.Numerics; public interface IArithmeticExpression { IArithmeticExpression Add(IArithmeticExpression factor) => new Sum(this, factor); IArithmeticExpression Divide(IArithmeticExpression other) => new Quotient(this, other); IArithmeticExpression Multiply(IArithmeticExpression other) => new Product(this, other); IArithmeticExpression Subtract(IArithmeticExpression other) => new Difference(this, other); IArithmeticExpression Negate() => new AdditiveInverse(this); object? Evaluate(IDictionary env); } public interface IArithmeticExpression : IArithmeticExpression where T : INumber { new T Evaluate(IDictionary env); object? IArithmeticExpression.Evaluate(IDictionary env) => Evaluate(env); }