Analyze <Local, Parameter, Method, Field, Property, Type, Attribute, Assembly, Expression, Variable>(
     string fullMethodName,
     IMethodDriver <APC, Local, Parameter, Method, Field, Property, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver)
     where Variable : IEquatable <Variable>
     where Expression : IEquatable <Expression>
     where Type : IEquatable <Type>
 {
     return(AnalysisWrapper.AnalyzeStrings(fullMethodName, mdriver, options));
 }
Example #2
0
 public override IMethodResult <Variable> Analyze <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable>
 (
     string fullMethodName,
     IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver,
     Predicate <APC> cachePCs, DFAController controller
 )
 //where Type : IEquatable<Type>
 //where Expression : IEquatable<Expression>
 //where Variable : IEquatable<Variable>
 {
     return(AnalysisWrapper.RunArraysAnalysis(fullMethodName, mdriver, this.options[0], this.boundsOptions, this.nonnullAnalysis, this.IsEnumAnalysisSelected, cachePCs, controller));
 }
Example #3
0
            Analyze <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable>(
                string fullMethodName,
                IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver,
                Predicate <APC> cachePCs, DFAController controller
                )
            //where Type : IEquatable<Type>
            //where Expression : IEquatable<Expression>
            //where Variable : IEquatable<Variable>
            {
                var result = AnalysisWrapper.RunEnumAnalysis(fullMethodName, mdriver, this.options, cachePCs, controller);

                return(result);
            }
            /// <summary>
            ///  Run the analysis for the array bounds
            /// </summary>
            public override IMethodResult <Variable> Analyze <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable>
            (
                string methodFullName,
                IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> methodDriver,
                Predicate <APC> cachePCs
            )
            //where Variable : IEquatable<Variable>
            //where Expression : IEquatable<Expression>
            //where Type : IEquatable<Type>
            {
                var result = AnalysisWrapper.RunTheAnalysis(methodFullName, methodDriver, options, cachePCs);

                return(result);
            }
            /// <summary>
            ///  Run the analysis for the arithmetic checking
            /// </summary>
            public override IMethodResult <Variable> Analyze <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable>
            (
                string methodFullName,
                IMethodDriver <Local, Parameter, Method, Field, Property, Event, Type, Attribute, Assembly, Expression, Variable, ILogOptions> methodDriver,
                Predicate <APC> cachePCs
            )
            //where Variable : IEquatable<Variable>
            //where Expression : IEquatable<Expression>
            //where Type : IEquatable<Type>
            {
                // F: For the moment we do not have iterative application of the analysis for those
                var result = AnalysisWrapper.RunTheArithmeticAnalysis(methodFullName, methodDriver, options[0].Type, options[0], cachePCs);

                return(result);
            }
            /// <summary>
            /// method calling the analysis of containers, wich is preceded by a partition analysis of containers
            /// </summary>
            public override IMethodResult <Variable> Analyze <Local, Parameter, Method, Field, Property, Type, Attribute, Assembly, Expression, Variable>(
                string fullMethodName,
                IMethodDriver <APC, Local, Parameter, Method, Field, Property, Type, Attribute, Assembly, Expression, Variable, ILogOptions> mdriver,
                IFactQuery <BoxedExpression, Variable> factQuery)
            // where Variable : IEquatable<Variable>
            // where Expression : IEquatable<Expression>
            // where Type : IEquatable<Type>
            {
                //IMethodResult<Variable> partitions = AnalysisWrapper.RunPartitionAnalysis(fullMethodName, mdriver, this.options); //t-maper@54: do I need a different set of options for the partition analyis or I mixed it with the options of Container Analysis?

                //return AnalysisWrapper.RunContainerAnalysis(fullMethodName, mdriver, partitions, this.options); //t-maper@54: this.options[0] ?

                var partitionsResult = AnalysisWrapper.RunPartitionAnalysis(fullMethodName, mdriver, this.options, factQuery);

                var containersResult = AnalysisWrapper.RunContainerAnalysis(fullMethodName, mdriver, partitionsResult, this.options);

                containersResult.MethodAnalysis = this; // Mic: keep track of the analysis that gave the result
                return(containersResult);
                //return partitionsResult;
            }
Example #7
0
                private IEnumerable <IFixpointInfo <APC, INumericalAbstractDomain <BoxedVariable <Variable>, BoxedExpression> > > FixpointInfo()
                {
                    if (fixpointInfo_List == null)
                    {
                        fixpointInfo_List = new List <IFixpointInfo <APC, INumericalAbstractDomain <BoxedVariable <Variable>, BoxedExpression> > >();
                    }

                    var cached_Count = fixpointInfo_List.Count;

                    for (var i = 1; i < this.optionsList.Count; i++)
                    {
                        var result = null as IFixpointInfo <APC, INumericalAbstractDomain <BoxedVariable <Variable>, BoxedExpression> >;
                        if (cached_Count > 0 && i <= cached_Count)
                        {
                            result = fixpointInfo_List[i - 1];
                        }
                        else
                        {
                            var opt = this.optionsList[i];

                            try
                            {
#if DEBUG
                                var stopWatch = new Stopwatch();
                                stopWatch.Start();
                                Console.WriteLine("[NUMERICAL] Running a refined analysis");
#endif


                                if (this.Options.LogOptions.ShowPhases)
                                {
                                    Console.WriteLine("===== Running a refined analysis");
                                }

                                string why;
                                if (!this.MethodDriver.AdditionalSyntacticInformation.Renamings.TooManyRenamingsForRefinedAnalysis(!this.Options.LogOptions.IsAdaptiveAnalysis, out why))
                                {
                                    var run = AnalysisWrapper.RunTheAnalysis(this.MethodName, opt.Type, this.MethodDriver, opt,
                                                                             (APC pc) => false) as NumericalAnalysis <Options>;
                                    result = run.fixpointInfo;
                                }
                                else
                                {
#if DEBUG
                                    var methodName = this.DecoderForMetaData.Name(this.MethodDriver.CurrentMethod);
                                    Console.WriteLine("[REFINED ANALYSIS] Skipping refined analysis as the method {0} contains too many renamings ({1}). To force the more precise analysis add the option -adaptive=false", methodName, why);
#endif
                                    result = null;
                                }
#if DEBUG
                                if (this.Options.LogOptions.ShowPhases)
                                {
                                    Console.WriteLine("     Refined analysis done. Elapsed {0}", stopWatch.Elapsed);
                                }
#endif
                            }
                            catch (TimeoutExceptionFixpointComputation)
                            {
#if  DEBUG
                                Console.WriteLine("on demand fixpoint computation timed out!");
#endif
                            }
                            // Cache the fixpoint
                            this.fixpointInfo_List.Add(result);
                        }

                        if (result != null)
                        {
                            yield return(result);
                        }
                    }
                }