本文介绍了在Microsoft.Research.AbstractDomains.Numerical.Rational.op_Division处除以零错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CodeContracts:ClrExtensions40:未捕获异常失败:尝试除以零。
CodeContracts:ClrExtensions40:堆栈跟踪:在Microsoft.Research.AbstractDomains.Numerical.Rational.op_Division(Rational r1,Rational r2)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.Numerical.IntervalEnvironment`2 .HelperFortestTrueLessThan_AxLtK(Polynomial`2 guardInCanonicalForm)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.Numerical.IntervalEnvironment`2.TestTrueLessThan(Expression left,Expression right)
CodeContracts:ClrExtensions40:at Microsoft.Research。 AbstractDomains.Numerical.IntervalEnvironment_Base`5.IntervalsTrueTestVisitor.VisitLessThan(表达式左,表达式右,表达式原始,此数据)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.GenericExpressionVisitor`4.DispatchCompare(CompareVisitor cmp,Expression left ,表达权,表达式原文,在数据中)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.GenericE xpressionVisitor`4.DispatchVisitNot(Expression exp,In data)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.GenericExpressionVisitor`4.Visit(Expression exp,In data)
CodeContracts:ClrExtensions40:at Microsoft。 Research.AbstractDomains.Numerical.IntervalEnvironment_Base`5.IntervalsTrueTestVisitor.Visit(Expression exp,This data)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.Numerical.IntervalEnvironment_Base`5.TestTrue(Expression guard)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.Numerical.Pentagons`2.TestTrue(Expression guard)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.Numerical.PentagonsPlus`2.TestTrue(Expression guard)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.ReducedNumericalDomains`4.TestTrue(Expression guard)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.Numerical.NumericalDo mainWithKarr`2.TestTrue(Expression guard)
CodeContracts:ClrExtensions40:at Microsoft.Research.AbstractDomains.ReducedNumericalDomains`4.TestTrue(Expression guard)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.AnalysisWrapper。 TypeBindings`10.AILogicInference`1.CheckIfImplicationHolds(AbstractDomain adomain,FList`1 posAssumptions,FList`1 negAssumptions,BoxedExpression goal)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.AnalysisWrapper.TypeBindings`10.AILogicInference`1 .IsTrueImply(APC pc,FList`1 posAssumptions,FList`1 negAssumptions,BoxedExpression goal)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.ComposedFactQuery`1.IsTrueImply(APC pc,FList`1 posAssumptions,FList` 1 negAssumptions,BoxedExpression目标)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.Exploration.TryProvingTheImplication(Path head)
CodeContracts: ClrExtensions40:at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.Exploration.DischargePath(Path head)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.Exploration.ExpandPath(Path head, FList`1&安培;路径)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.Exploration.DischargePaths(FList`1 paths)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder `11.DischargeObligation(IMethodDriver`12 mdriver,IFactQuery`2 fact,Int32 maxPathSize,APC pc,BoxedExpression goalExpression)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.DischargeObligation(IMethodDriver`12 mdriver,IFactQuery`2 fact,Int32 maxPathSize,APC pc,Variable goal)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.Discharge [Local,Parameter,Method,Field,Property,Type,Attribute,Assembly ,表达式,变量,LogOptions](APC pc,变量目标,Int32 maxPathSize,IMethodDriver`12 mdriver,IFactQuery`2事实)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.Asser tionFinder.TypeBindings`10.ValidateAssertions(IMethodDriver`12 mdriver,FList`1 results,IOutputResults output,AssertionStatistics& assertStats)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.AssertionFinder.ValidateAssertions [Local,Parameter,Method,Field,Property,Type,Attribute,Assembly,Expression,Variable](IMethodDriver`12 driver,FList`1结果,IOutputResults输出,AssertionStatistics& assertStats)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.AnalyzeNonIteratorMethodInternal(Method method)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis。 Clousot.TypeBinder`8.AnalyzeMethodInternal(Method method)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.AnalyzeMethod(Method method)
CodeContracts:ClrExtensions40:at Microsoft.Research。 CodeAnalysis.Clousot.TypeBinder`8.AnalyzeAssembly(String assemblyName,Set`1 assembliesUnderAnalysis)
CodeContracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.InternalAnalyze()
CodeCo ntracts:ClrExtensions40:at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.Analyze()
CodeContracts:ClrExtensions40:
CodeContracts:ClrExtensions40:完成后台合同分析。
解决方案
CodeContracts: ClrExtensions40: Failed with uncaught exception: Attempted to divide by zero. CodeContracts: ClrExtensions40: Stack trace: at Microsoft.Research.AbstractDomains.Numerical.Rational.op_Division(Rational r1, Rational r2) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.Numerical.IntervalEnvironment`2.HelperFortestTrueLessThan_AxLtK(Polynomial`2 guardInCanonicalForm) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.Numerical.IntervalEnvironment`2.TestTrueLessThan(Expression left, Expression right) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.Numerical.IntervalEnvironment_Base`5.IntervalsTrueTestVisitor.VisitLessThan(Expression left, Expression right, Expression original, This data) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.GenericExpressionVisitor`4.DispatchCompare(CompareVisitor cmp, Expression left, Expression right, Expression original, In data) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.GenericExpressionVisitor`4.DispatchVisitNot(Expression exp, In data) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.GenericExpressionVisitor`4.Visit(Expression exp, In data) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.Numerical.IntervalEnvironment_Base`5.IntervalsTrueTestVisitor.Visit(Expression exp, This data) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.Numerical.IntervalEnvironment_Base`5.TestTrue(Expression guard) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.Numerical.Pentagons`2.TestTrue(Expression guard) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.Numerical.PentagonsPlus`2.TestTrue(Expression guard) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.ReducedNumericalDomains`4.TestTrue(Expression guard) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.Numerical.NumericalDomainWithKarr`2.TestTrue(Expression guard) CodeContracts: ClrExtensions40: at Microsoft.Research.AbstractDomains.ReducedNumericalDomains`4.TestTrue(Expression guard) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.AnalysisWrapper.TypeBindings`10.AILogicInference`1.CheckIfImplicationHolds(AbstractDomain adomain, FList`1 posAssumptions, FList`1 negAssumptions, BoxedExpression goal) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.AnalysisWrapper.TypeBindings`10.AILogicInference`1.IsTrueImply(APC pc, FList`1 posAssumptions, FList`1 negAssumptions, BoxedExpression goal) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.ComposedFactQuery`1.IsTrueImply(APC pc, FList`1 posAssumptions, FList`1 negAssumptions, BoxedExpression goal) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.Exploration.TryProvingTheImplication(Path head) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.Exploration.DischargePath(Path head) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.Exploration.ExpandPath(Path head, FList`1& paths) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.Exploration.DischargePaths(FList`1 paths) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.DischargeObligation(IMethodDriver`12 mdriver, IFactQuery`2 facts, Int32 maxPathSize, APC pc, BoxedExpression goalExpression) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.TypeBinder`11.DischargeObligation(IMethodDriver`12 mdriver, IFactQuery`2 facts, Int32 maxPathSize, APC pc, Variable goal) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.WeakestPreconditionProver.Discharge[Local,Parameter,Method,Field,Property,Type,Attribute,Assembly,Expression,Variable,LogOptions](APC pc, Variable goal, Int32 maxPathSize, IMethodDriver`12 mdriver, IFactQuery`2 facts) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.AssertionFinder.TypeBindings`10.ValidateAssertions(IMethodDriver`12 mdriver, FList`1 results, IOutputResults output, AssertionStatistics& assertStats) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.AssertionFinder.ValidateAssertions[Local,Parameter,Method,Field,Property,Type,Attribute,Assembly,Expression,Variable](IMethodDriver`12 driver, FList`1 results, IOutputResults output, AssertionStatistics& assertStats) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.AnalyzeNonIteratorMethodInternal(Method method) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.AnalyzeMethodInternal(Method method) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.AnalyzeMethod(Method method) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.AnalyzeAssembly(String assemblyName, Set`1 assembliesUnderAnalysis) CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.InternalAnalyze() CodeContracts: ClrExtensions40: at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`8.Analyze() CodeContracts: ClrExtensions40: CodeContracts: ClrExtensions40: Background contract analysis done.
解决方案
这篇关于在Microsoft.Research.AbstractDomains.Numerical.Rational.op_Division处除以零错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!