예제 #1
0
                protected GenericValueAnalysis(string methodName,
                                               IMethodDriver <TExpr, TVar> methodDriver)
                {
                    ThresholdDB.Reset();
                    BoxedVariable <TVar> .ResetFreshVariableCounter();

                    //        method_name = methodName;
                    method_driver = methodDriver;

                    EvaluatorOfConstants = new ConstantEvaluator(ContextProvider,
                                                                 MetaDataProvider);
                }
예제 #2
0
        public BoxedVariable <TVar> UnderlyingVariable(BoxedExpression expr)
        {
            var uv = expr.UnderlyingVariable;

            if (uv is TVar)
            {
                return(new BoxedVariable <TVar> ((TVar)expr.UnderlyingVariable));
            }

            var boxed = uv as BoxedVariable <TVar>;

            return(boxed ?? BoxedVariable <TVar> .SlackVariable());
        }
예제 #3
0
        public bool Equals(BoxedVariable <TVar> that)
        {
            if (ReferenceEquals(this, that))
            {
                return(true);
            }

            if (ReferenceEquals(that, null))
            {
                return(false);
            }

            if (inner_variable != null)
            {
                return(inner_variable.Equals(that.inner_variable));
            }

            return(variable != null && variable.Equals(that.variable));
        }
예제 #4
0
 public BoxedExpression VariableFor(BoxedVariable <TVar> var)
 {
     return(BoxedExpression.Var(var));
 }
예제 #5
0
 public BoxedVariable <TVar> FreshVariable()
 {
     return(BoxedVariable <TVar> .SlackVariable());
 }
예제 #6
0
 public void ResetFreshVariableCounter()
 {
     BoxedVariable <TVar> .ResetFreshVariableCounter();
 }
예제 #7
0
 public string NameOf(BoxedVariable <TVar> variable)
 {
     return(variable.ToString());
 }