Ejemplo n.º 1
0
                    public LocallocObligation(APC pc, BoxedExpression size, BoxedExpressionDecoder <Variable> decoder,
                                              IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver
                                              )
                        : base(pc, decoder, mdriver, null)
                    {
                        Contract.Requires(size != null);

                        this.size = size;
                    }
Ejemplo n.º 2
0
                public ArrayLowerBoundAccess(BoxedExpression index, BoxedExpressionDecoder <Variable> decoder, APC pc,
                                             IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver
                                             )
                    : base(pc, decoder, mdriver, null)
                {
                    Contract.Requires(index != null);
                    Contract.Requires(mdriver != null);

                    this.index = index;
                }
 public StripeForUnsafeCode(
     BoxedExpressionDecoder decoder,
     IExpressionEncoder <BoxedExpression> encoder,
     IExpressionContext <APC, Local, Parameter, Method, Field, Type, ExternalExpression, Variable> context,
     IDecodeMetaData <Local, Parameter, Method, Field, Property, Type, Attribute, Assembly> mdDecoder)
     : base(decoder, mdDecoder, encoder)
 {
     this.context = context;
     this.decoder = decoder;
 }
Ejemplo n.º 4
0
                protected ArithmeticUnderflowOrOverflowObligation(BoxedExpression exp, Type type, APC pc,
                                                                  BoxedExpressionDecoder <Variable> decoder,
                                                                  IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver)
                    : base(pc, decoder, mdriver, null)
                {
                    Contract.Requires(exp != null);

                    this.exp  = exp;
                    this.type = type;
                }
Ejemplo n.º 5
0
                    public UpperBoundsBufferAccess(APC pc, BoxedExpressionDecoder <Variable> decoder,
                                                   IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver)
                        : base(pc, decoder, mdriver, null)
                    {
                        Contract.Requires(mdriver != null);

                        this.condition   = default(BoxedExpression);
                        this.uncheckable = true;
                        this.isWrite     = default(bool);
                    }
Ejemplo n.º 6
0
                protected ProofObligationWithDecoder(APC pc, BoxedExpressionDecoder <Variable> decoder,
                                                     IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver
                                                     , Provenance provenance)
                    : base(pc, mdriver.CurrentMethodName(), provenance)
                {
                    Contract.Requires(mdriver != null);

                    this.decoder      = decoder;
                    this.MethodDriver = mdriver;
                }
Ejemplo n.º 7
0
 public LinearEqualitiesForUnsafeCode(
     LinearEqualitiesEnvironment <BoxedExpression> /*!*/ val,
     BoxedExpressionDecoder <Type, ExternalExpression> decoder,
     IExpressionContext <APC, Local, Parameter, Method, Field, Type, ExternalExpression, Variable> context,
     IDecodeMetaData <Local, Parameter, Method, Field, Property, Type, Attribute, Assembly> mdDecoder)
     : base(val)
 {
     this.bdecoder  = decoder;
     this.context   = context;
     this.mdDecoder = mdDecoder;
 }
Ejemplo n.º 8
0
                public ArithmeticIsNaN(BoxedExpression exp, Type type, APC pc, BoxedExpressionDecoder <Variable> decoder,
                                       IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver,
                                       object provenance = null)
                    : base(exp, type, pc, decoder, mdriver)
                {
                    Contract.Requires(exp != null);
                    Contract.Requires(decoder != null);
                    Contract.Requires(mdriver != null);

                    this.condition = null;
                }
Ejemplo n.º 9
0
                public DivisionByZeroObligation
                (
                    BoxedExpression denominator, BoxedExpressionDecoder <Variable> decoder, APC pc,
                    IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver
                )
                    : base(pc, decoder, mdriver, null)
                {
                    Contract.Requires(denominator != null);

                    this.denominator = denominator;
                }
                private ExpressionManager <BoxedVariable <Variable>, BoxedExpression> GetExpressionManager()
                {
                    var valuedDecoder = new AnalysisWrapper.TypeBindings <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable> .ValueExpDecoder(this.Mdriver.Context, this.Mdriver.MetaDataDecoder);

                    var expDecoder = BoxedExpressionDecoder <Variable> .Decoder(valuedDecoder, (object o) => ExpressionType.Unknown);

                    var expEncoder = BoxedExpressionEncoder <Variable> .Encoder(this.Mdriver.MetaDataDecoder, this.Mdriver.Context);

                    var expManager = new ExpressionManagerWithEncoder <BoxedVariable <Variable>, BoxedExpression>(this.timeout, expDecoder, expEncoder);

                    return(expManager);
                }
Ejemplo n.º 11
0
                public DivisionOverflowObligation(BoxedExpression op1, BoxedExpression op2,
                                                  Type typeOp1,
                                                  BoxedExpressionDecoder <Variable> decoder, APC pc,
                                                  IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver)
                    : base(pc, decoder, mdriver, null)
                {
                    Contract.Requires(op1 != null);
                    Contract.Requires(op2 != null);

                    this.Op1     = op1;
                    this.Op2     = op2;
                    this.TypeOp1 = typeOp1;
                }
 public StripeIntervalsKarrForUnsafeCode(
     StripeWithIntervalsForUnsafeCode /*!*/ left,
     LinearEqualitiesForUnsafeCode /*!*/ right,
     BoxedExpressionDecoder <Type, ExternalExpression> decoder,
     IExpressionEncoder <BoxedExpression> encoder,
     IExpressionContext <APC, Local, Parameter, Method, Field, Type, ExternalExpression, Variable> context,
     IDecodeMetaData <Local, Parameter, Method, Field, Property, Type, Attribute, Assembly> mdDecoder
     )
     : base(left, right, decoder, encoder)
 {
     this.decoder   = decoder;
     this.context   = context;
     this.mdDecoder = mdDecoder;
 }
Ejemplo n.º 13
0
                public NoMinValueObligation
                (
                    Type typeOfArg,
                    string nameOfTypeOfArg,
                    BoxedExpression arg, BoxedExpressionDecoder <Variable> decoder, APC pc,
                    IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver
                )
                    : base(pc, decoder, mdriver, null)
                {
                    Contract.Requires(arg != null);

                    this.arg             = arg;
                    this.typeOfArg       = typeOfArg;
                    this.nameOfTypeOfArg = nameOfTypeOfArg;
                }
Ejemplo n.º 14
0
        internal static BoxedExpressionDecoder <Type, Variable, Expression> BoxedDecoder <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, LogOptions>
        (
            this IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, LogOptions> mdriver
        )
            where Type : IEquatable <Type>
            where Expression : IEquatable <Expression>
            where Variable : IEquatable <Variable>
            where LogOptions : IFrameworkLogOptions
        {
            Contract.Ensures(Contract.Result <BoxedExpressionDecoder <Type, Variable, Expression> >() != null);

            var result = decoderCache as BoxedExpressionDecoder <Type, Variable, Expression>;

            if (result == null)
            {
                decoderCache = result = BoxedExpressionDecoder <Variable> .Decoder(new AnalysisWrapper.TypeBindings <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable> .ValueExpDecoder(mdriver.Context, mdriver.MetaDataDecoder),
                                                                                   (obj) => mdriver.TypeFor(obj));
            }

            return(result);
        }
 public IntervalsForUnsafeCode(BoxedExpressionDecoder decoder, IExpressionEncoder <BoxedExpression> encoder, IExpressionContext <APC, Local, Parameter, Method, Field, Type, ExternalExpression, Variable> context)
     : base(decoder, encoder)
 {
     this.decoder = decoder;
     this.context = context;
 }
 public IntervalsForUnsafeCode(IntervalEnvironment <BoxedExpression> original, IExpressionContext <APC, Local, Parameter, Method, Field, Type, ExternalExpression, Variable> context)
     : base(original)
 {
     this.context = context;
     this.decoder = (BoxedExpressionDecoder <Type, ExternalExpression>)original.Decoder;
 }
 public IntervalsForUnsafeCode(IntervalsForUnsafeCode original, IExpressionContext <APC, Local, Parameter, Method, Field, Type, ExternalExpression, Variable> context)
     : base(original)
 {
     this.context = context;
     this.decoder = original.decoder;
 }
Ejemplo n.º 18
0
 public NewArrayArithmeticOverflow(BoxedExpression exp, APC pc, BoxedExpressionDecoder <Variable> decoder,
                                   IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver)
     : base(exp, mdriver.MetaDataDecoder.System_Int32, pc, decoder, mdriver)
 {
 }
Ejemplo n.º 19
0
                public ArrayCreation(BoxedExpression size, int dimension, bool isMultidimensional, BoxedExpressionDecoder <Variable> decoder, APC pc,
                                     IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver
                                     )
                    : base(pc, decoder, mdriver, null)
                {
                    Contract.Requires(size != null);
                    Contract.Requires(mdriver != null);

                    this.size               = size;
                    this.dimension          = dimension;
                    this.isMultidimensional = isMultidimensional;
                }
 public StripeForUnsafeCode(Stripe <BoxedExpression, IDecodeMetaData <Local, Parameter, Method, Field, Property, Type, Attribute, Assembly> > original, IExpressionContext <APC, Local, Parameter, Method, Field, Type, ExternalExpression, Variable> context)
     : base(original)
 {
     this.context = context;
     this.decoder = (BoxedExpressionDecoder <Type, ExternalExpression>)original.decoder;
 }
Ejemplo n.º 21
0
 public FloatEqualityObligation(APC pc, Variable var, BoxedExpression left, BoxedExpression right, BoxedExpressionDecoder <Variable> decoder, IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver)
     : base(pc, decoder, mdriver, null)
 {
     this.var   = var;
     this.left  = left;
     this.right = right;
 }
Ejemplo n.º 22
0
                public ArrayUpperBoundAccess(BoxedExpression left, BoxedExpression right, BoxedExpressionDecoder <Variable> decoder, APC pc,
                                             IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver
                                             )
                    : base(pc, decoder, mdriver, null)
                {
                    Contract.Requires(left != null);
                    Contract.Requires(right != null);
                    Contract.Requires(mdriver != null);

                    this.left  = left;
                    this.right = right;

                    Contract.Assume(fixedMessages.Length == 4, "assuming the invariant on the static field");
                }
Ejemplo n.º 23
0
 public ArithmeticOverflowForFloats(BoxedExpression exp, Type type, APC pc, BoxedExpressionDecoder <Variable> decoder,
                                    IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver)
     : base(exp, type, pc, decoder, mdriver)
 {
 }
Ejemplo n.º 24
0
                    public LowerBoundBufferAccess(APC pc, BoxedExpression condition, bool isWrite, BoxedExpressionDecoder <Variable> decoder,
                                                  IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver)
                        : base(pc, decoder, mdriver, null)
                    {
                        Contract.Requires(condition != null);
                        Contract.Requires(mdriver != null);

                        this.condition   = condition;
                        this.uncheckable = false;
                        this.isWrite     = isWrite;
                    }