/// <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);
            }
Esempio n. 2
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);
                        }
                    }
                }