コード例 #1
0
        public static string GetSymbolFor(EArithmaticOperators operatorKey)
        {
            string symbol;

            ArithmaticOperators.operators.TryGetValue(operatorKey, out symbol);
            return(symbol);
        }
コード例 #2
0
        public static ArithExpr GetSpec(EArithmaticOperators opr, ArithExpr arg_1, ArithExpr arg_2, Context ctx)
        {
            switch (opr)
            {
            case (EArithmaticOperators.SUM):
                return(ctx.MkAdd(arg_1, arg_2));

            case (EArithmaticOperators.SUB):
                return(ctx.MkSub(arg_1, arg_2));

            case (EArithmaticOperators.MUL):
                return(ctx.MkMul(arg_1, arg_2));

            case (EArithmaticOperators.DIV):
                return(ctx.MkDiv(arg_1, arg_2));
            }
            return(null);
        }