Ejemplo n.º 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);
                }
Ejemplo n.º 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());
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 4
0
 public BoxedExpression VariableFor(BoxedVariable <TVar> var)
 {
     return(BoxedExpression.Var(var));
 }
Ejemplo n.º 5
0
 public BoxedVariable <TVar> FreshVariable()
 {
     return(BoxedVariable <TVar> .SlackVariable());
 }
Ejemplo n.º 6
0
 public void ResetFreshVariableCounter()
 {
     BoxedVariable <TVar> .ResetFreshVariableCounter();
 }
Ejemplo n.º 7
0
 public string NameOf(BoxedVariable <TVar> variable)
 {
     return(variable.ToString());
 }