static AddToTree.Tree ArrangmentToDeleteingMul(AddToTree.Tree Dummy) { if (Dummy == null) { return(Dummy); } DeletingMultaplification.ArrangmentToDeleteingMul(Dummy.LeftSideAccess); DeletingMultaplification.ArrangmentToDeleteingMul(Dummy.RightSideAccess); if (Dummy.SampleAccess == "*") { if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) { Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess); } } if (Dummy.SampleAccess == "*") { if (IS.IsMulOrDiv(Dummy.LeftSideAccess.SampleAccess)) { Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess); } } return(Dummy); }
//ERORRCORECTION646565654646:The paranterization and the state of indexpendence function variable ahs been proved.:1394/3/30 public void CreateLinkListFromTree1(AddToTree.Tree T) { bool AD = false, Parantez = false; LinkListNodeClass Dummy = Node;//new LinkListNodeClass(); LinkListNodeClass NEW = new LinkListNodeClass(); if (T != null)//ERRORCORECTION1246789:The Link Litst Of Dummy Corected:1394/3/31 { if (T.RightSideAccess == null && T.LeftSideAccess != null && IS.IsFunction(T.SampleAccess)) { AD = true; Dummy = Node;//new LinkListNodeClass(); NEW = new LinkListNodeClass(); while (Dummy.NextAccess != null) { Dummy = Dummy.NextAccess; } NEW.CurrentAccess.SampleAccess = ")"; Dummy.NextAccess = NEW; Dummy.NextAccess.ThreadAccess = Dummy; // NodeNumber = CurrentSize; CurrentSize++; CreateLinkListFromTree1(T.LeftSideAccess); //ERRORCORECTION1456125478:The Righ Side instide of leftside recurve the answer:1394/3/31 Dummy = Node; //new LinkListNodeClass(); NEW = new LinkListNodeClass(); while (Dummy.NextAccess != null) { Dummy = Dummy.NextAccess; } NEW.CurrentAccess.SampleAccess = "("; Dummy.NextAccess = NEW; Dummy.NextAccess.ThreadAccess = Dummy; CurrentSize++; //CreateLinkListFromTree1(T.LeftSideAccess.RightSideAccess); } else //ERRORCORECTION1246789:The Link Litst Of Dummy Corected:1394/3/31 { /*if (Parantez) * { * Dummy = Node;//new LinkListNodeClass(); * NEW = new LinkListNodeClass(); * * while (Dummy.NextAccess != null) * Dummy = Dummy.NextAccess; * NEW.CurrentAccess.SampleAccess = ")"; * Dummy.NextAccess = NEW; * Dummy.NextAccess.ThreadAccess = Dummy; * CurrentSize++; * Parantez=false; * } * */ CreateLinkListFromTree1(T.RightSideAccess);//ERRORCORECTION1456125478:The Righ Side instide of leftside recurve the answer:1394/3/31 /*if (IS.IsOperator(T.SampleAccess)) * { * Dummy = Node;//new LinkListNodeClass(); * NEW = new LinkListNodeClass(); * * while (Dummy.NextAccess != null) * Dummy = Dummy.NextAccess; * NEW.CurrentAccess.SampleAccess = "("; * Dummy.NextAccess = NEW; * Dummy.NextAccess.ThreadAccess = Dummy; * CurrentSize++; * Parantez=true; * } * */ Dummy = Node;//new LinkListNodeClass(); NEW = new LinkListNodeClass(); //LinkListNodeClass NEW = new LinkListNodeClass(); while (Dummy.NextAccess != null) { Dummy = Dummy.NextAccess; } NEW.CurrentAccess.SampleAccess = T.SampleAccess; Dummy.NextAccess = NEW; Dummy.NextAccess.ThreadAccess = Dummy; // NodeNumber = CurrentSize; CurrentSize++; /*if (Parantez && IS.IsOperator(T.SampleAccess)) * { * Dummy = Node;//new LinkListNodeClass(); * NEW = new LinkListNodeClass(); * Parantez=false; * while (Dummy.NextAccess != null) * Dummy = Dummy.NextAccess; * NEW.CurrentAccess.SampleAccess = ")"; * Dummy.NextAccess = NEW; * Dummy.NextAccess.ThreadAccess = Dummy; * CurrentSize++; * } */ CreateLinkListFromTree1(T.LeftSideAccess); } } if (AD) { AD = false; Dummy = Node;//new LinkListNodeClass(); NEW = new LinkListNodeClass(); while (Dummy.NextAccess != null) { Dummy = Dummy.NextAccess; } NEW.CurrentAccess.SampleAccess = T.SampleAccess; Dummy.NextAccess = NEW; Dummy.NextAccess.ThreadAccess = Dummy; CurrentSize++; } }
static AddToTree.Tree LocalSearchMinusPlusWithNumberMulatedEqualSimplifierActionFx(AddToTree.Tree Dummy) { if (Dummy == null) { return(Dummy); } bool SimplifiedTrueOtherWiseFalse = false; bool Suitable = false; bool MinuseTruePluseFalse = false; float Num = 0; if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) { LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.RightSideAccess, Dummy.LeftSideAccess, ref Suitable, ref MinuseTruePluseFalse, ref SimplifiedTrueOtherWiseFalse, ref Num); if (SimplifiedTrueOtherWiseFalse) { if ((Dummy.ThreadAccess.ThreadAccess == null) || (Dummy.ThreadAccess.SampleAccess == "+")) { if (MinuseTruePluseFalse) { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess)) - Num; Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } else { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess)) + Num; Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } } else if (Dummy.ThreadAccess.SampleAccess == "-") { if (MinuseTruePluseFalse) { if (MinuseTruePluseFalse) { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess) * -1) - Num; Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } else { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess)) + Num; Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } else { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess)) + Num; Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } } } } SimplifiedTrueOtherWiseFalse = false; Suitable = false; MinuseTruePluseFalse = false; Num = 0; if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) { LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(Dummy.LeftSideAccess, Dummy.RightSideAccess, ref Suitable, ref MinuseTruePluseFalse, ref SimplifiedTrueOtherWiseFalse, ref Num); if (SimplifiedTrueOtherWiseFalse) { if (Dummy.SampleAccess == "+") { if (MinuseTruePluseFalse) { Num = (float)(System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess)) - Num; Dummy.RightSideAccess.SampleAccess = Num.ToString(); } else { Num = (float)(System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess)) + Num; Dummy.RightSideAccess.SampleAccess = Num.ToString(); } } else { if (MinuseTruePluseFalse) { Num = (float)(System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess) * -1) - Num; Dummy.RightSideAccess.SampleAccess = Num.ToString(); } else { Num = (float)(System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess) * -1) + Num; Dummy.RightSideAccess.SampleAccess = Num.ToString(); } } Dummy.RightSideAccess.SetLeftAndRightSide(null, null); Dummy.RightSideAccess.SampleAccess = null; } } LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.LocalSearchMinusPlusWithNumberMulatedEqualSimplifierActionFx(Dummy.LeftSideAccess); LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.LocalSearchMinusPlusWithNumberMulatedEqualSimplifierActionFx(Dummy.RightSideAccess); return(Dummy); }
static AddToTree.Tree MulTowDivisionCalculator(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { if (Dummy == null) { return(Dummy); } //int INCREASE = 2147483647; UIS.SetProgressValue(UIS.progressBar6, 0); if (IS.IsMul(Dummy.SampleAccess)) { if (IS.IsDiv(Dummy.LeftSideAccess.SampleAccess) && IS.IsDiv(Dummy.RightSideAccess.SampleAccess)) { AddToTree.Tree MUL = new AddToTree.Tree(null, false); MUL = Dummy.CopyNewTree(Dummy.LeftSideAccess.RightSideAccess); Dummy.LeftSideAccess.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess.LeftSideAccess), Dummy.CopyNewTree(Dummy.RightSideAccess.LeftSideAccess)); Dummy.LeftSideAccess.SampleAccess = "*"; Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.LeftSideAccess; Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess; Dummy.SampleAccess = "/"; Dummy.RightSideAccess.SetLefTandRightCommonlySide(MUL, Dummy.CopyNewTree(Dummy.RightSideAccess.RightSideAccess)); Dummy.RightSideAccess.SampleAccess = "*"; Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess; Dummy.RightSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess; } UIS.SetProgressValue(UIS.progressBar6, 2147483647); /* else * if (IS.IsDiv(Dummy.LeftSideAccess.SampleAccess)) * { * AddToTree.Tree MUL = new AddToTree.Tree(null, false); * MUL = Dummy.CopyNewTree(Dummy.RightSideAccess); * Dummy.RightSideAccess = Dummy.LeftSideAccess.RightSideAccess; * Dummy.RightSideAccess.ThreadAccess = Dummy; * * Dummy.SampleAccess = "/"; * * Dummy.LeftSideAccess.RightSideAccess = MUL; * Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess; * Dummy.LeftSideAccess.SampleAccess = "*"; * * * } * else * if (IS.IsDiv(Dummy.RightSideAccess.SampleAccess)) * { * Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess,Dummy.LeftSideAccess); * * AddToTree.Tree MUL = new AddToTree.Tree(null, false); * MUL = Dummy.CopyNewTree(Dummy.RightSideAccess); * Dummy.RightSideAccess = Dummy.LeftSideAccess.RightSideAccess; * Dummy.RightSideAccess.ThreadAccess = Dummy; * * Dummy.SampleAccess = "/"; * * Dummy.LeftSideAccess.RightSideAccess = MUL; * Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess; * Dummy.LeftSideAccess.SampleAccess = "*"; * * * } */ } MulTowDivision.MulTowDivisionCalculator(Dummy.LeftSideAccess, ref UIS); MulTowDivision.MulTowDivisionCalculator(Dummy.RightSideAccess, ref UIS); return(Dummy); }
static AddToTree.Tree SimplifierCommonSubFactorActionRightSideFx(AddToTree.Tree Dummy, AddToTree.Tree COMMONSUBFACTOR, ref bool END, AddToTreeTreeLinkList NOTFACTOR) { if (Dummy == null) { return(Dummy); } if (Dummy.SampleAccess != "*") { if (NOTFACTOR.FINDTreeWithOutThreadConsideration(Dummy)) { return(Dummy); } } if (END) { return(Dummy); } try { //ERROCRECTIOn98217487 :the last condition (Dummy.ThreadAccess.SampleAccess) is Div. if ((EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy, COMMONSUBFACTOR) && (Dummy.ThreadAccess.SampleAccess == "*") || (Dummy.ThreadAccess.SampleAccess == "/"))) { Dummy.SetLefTandRightCommonlySide(null, null); Dummy.SampleAccess = "1"; END = true; } else if ((Dummy.ThreadAccess.SampleAccess == "^") && (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy, COMMONSUBFACTOR)) && (IS.IsNumber(Dummy.ThreadAccess.RightSideAccess.SampleAccess))) { float NUM = (float)System.Convert.ToDouble(Dummy.ThreadAccess.RightSideAccess.SampleAccess); NUM = NUM - 1; if (NUM > 0) { Dummy.ThreadAccess.RightSideAccess.SampleAccess = NUM.ToString(); } else { Dummy.SetLefTandRightCommonlySide(null, null); Dummy.SampleAccess = "1"; } END = true; } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } Dummy.LeftSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionRightSideFx(Dummy.LeftSideAccess, COMMONSUBFACTOR, ref END, NOTFACTOR); Dummy.RightSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionRightSideFx(Dummy.RightSideAccess, COMMONSUBFACTOR, ref END, NOTFACTOR); return(Dummy); }
static AddToTree.Tree SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, ref bool Suitable, ref bool MinuseTruePlusFalse, ref bool SimplifiedTrueOtherWiseFalse, ref float Num) { if (Dummy == null) { return(Dummy); } AddToTree.Tree HOLDERCATCH = Dummy; try { if (IS.IsMinuseOrPluse(Dummy.SampleAccess)) { if ((EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess.RightSideAccess, ToSimplified.RightSideAccess)) && (IS.IsNumber(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess))) { try { Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess); //Dummy = Dummy.LeftSideAccess.RightSideAccess; if ((ToSimplified.ThreadAccess == null) && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = null; //LOCATION81726487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); /*Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = null; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * // Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy; * // Dummy.LeftSideAccess = Dummy.LeftSideAccess.RightSideAccess; * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } */ Suitable = true; return(Dummy); } else if ((ToSimplified.ThreadAccess != null) && (Dummy.SampleAccess == "-")) { if ((ToSimplified.ThreadAccess.SampleAccess == "+") && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = null; //LOCATION81987526487 :refer to page 265. /* AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); * Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = null; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } */ Suitable = true; return(Dummy); } else if ((ToSimplified.ThreadAccess != null) && (Dummy.SampleAccess == "+")) { if ((ToSimplified.ThreadAccess.SampleAccess == "-") && (Dummy.SampleAccess == "+")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = false; Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = null; //LOCATION81987526487 :refer to page 265. /*AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); * Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = null; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } */ Suitable = true; return(Dummy); } else if ((ToSimplified.ThreadAccess != null) && (Dummy.SampleAccess == "-")) { if ((ToSimplified.ThreadAccess.SampleAccess == "-") && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = null; //LOCATION81987526487 :refer to page 265. /* AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); * Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = null; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } */ Suitable = true; return(Dummy); } } } } } /*if (SimplifiedTrueOtherWiseFalse) * Dummy = Dummy.ThreadAccess; * else * Dummy = Dummy.ThreadAccess.ThreadAccess; * } */ catch (NullReferenceException t) { Dummy = HOLDERCATCH; ExceptionClass.ExceptionClassMethod(t); } } else if ((EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess.RightSideAccess, ToSimplified.RightSideAccess)) & (IS.IsNumber(Dummy.RightSideAccess.LeftSideAccess.SampleAccess))) { //Dummy.RightSideAccess.SampleAccess = null; try { Num = (float)System.Convert.ToDouble(Dummy.RightSideAccess.LeftSideAccess.SampleAccess); //Dummy = Dummy.RightSideAccess.RightSideAccess; if ((ToSimplified.ThreadAccess == null) && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = null; //LOCATION81726487 :refer to page 265. /*AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); * Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = null; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } */ Suitable = true; return(Dummy); } else if ((((ToSimplified.ThreadAccess != null))) && (ToSimplified.ThreadAccess.SampleAccess == "+") && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; //LOCATION81987526487 :refer to page 265. /* AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); * Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy; * Dummy.RightSideAccess = Dummy.RightSideAccess.LeftSideAccess; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } */ Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = null; Suitable = true; return(Dummy); } else if ((((ToSimplified.ThreadAccess != null))) && (ToSimplified.ThreadAccess.SampleAccess == "-") && (Dummy.SampleAccess == "+")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = false; //LOCATION81987526487 :refer to page 265. /* AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); * Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = null; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } */ Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = null; Suitable = true; return(Dummy); } else if ((((ToSimplified.ThreadAccess != null))) && (ToSimplified.ThreadAccess.SampleAccess == "-") && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; //LOCATION81987526487 :refer to page 265. /*AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); * Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = null; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } */ Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = null; Suitable = true; return(Dummy); } /*if (SimplifiedTrueOtherWiseFalse) * Dummy = Dummy.ThreadAccess; * else * Dummy = Dummy.ThreadAccess.ThreadAccess; */ } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); Dummy = HOLDERCATCH; } } } else { return(Dummy); } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.LeftSideAccess, ToSimplified, ref Suitable, ref MinuseTruePlusFalse, ref SimplifiedTrueOtherWiseFalse, ref Num); LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.RightSideAccess, ToSimplified, ref Suitable, ref MinuseTruePlusFalse, ref SimplifiedTrueOtherWiseFalse, ref Num); return(Dummy); }
static AddToTree.Tree DerivasionCalculator(AddToTree.Tree Node, AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { if (Node == null) { return(Dummy); } if (Node.SampleAccess == "x") { Dummy.SampleAccess = "1"; return(Dummy); } //ERROR317142 :The structure is ok.refer to page 155. //ERRORCORECTION30704012 :The error correced.refer to page 155. if (Node.LeftSideAccess != null) { if (Node.LeftSideAccess.LeftSideAccess == null) { if (Node.LeftSideAccess.RightSideAccess == null) { if (IS.IsFunction(Node.SampleAccess)) { Dummy = Derivasion.ConsTantFuctionDerivasion(Node); return(Dummy); } else if (IS.IsNumber(Dummy.SampleAccess)) { Dummy = null; return(Dummy); } } } } if (Node.SampleAccess == "/") { AddToTree.Tree Minuse = new AddToTree.Tree("-", false); AddToTree.Tree MulL = new AddToTree.Tree("*", false); AddToTree.Tree MulR = new AddToTree.Tree("*", false); AddToTree.Tree Power = new AddToTree.Tree("^", false); AddToTree.Tree DFX = new AddToTree.Tree(null, false); AddToTree.Tree DGX = new AddToTree.Tree(null, false); AddToTree.Tree NRMulL = new AddToTree.Tree(null, false); AddToTree.Tree NRMulR = new AddToTree.Tree(null, false); AddToTree.Tree GX = Node.CopyNewTree(Node.RightSideAccess); AddToTree.Tree IND = new AddToTree.Tree("2", false); DFX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS); NRMulL = Node.RightSideAccess; MulL.SetLefTandRightCommonlySide(DFX, NRMulL); MulL.LeftSideAccess.ThreadAccess = MulL; MulL.RightSideAccess.ThreadAccess = MulL; DGX = Derivasion.DerivasionOfFX(Node.RightSideAccess, ref UIS); NRMulR = Node.LeftSideAccess; MulR.SetLefTandRightCommonlySide(DGX, NRMulR); MulR.LeftSideAccess.ThreadAccess = MulR; MulR.RightSideAccess.ThreadAccess = MulR; Minuse.SetLefTandRightCommonlySide(MulL, MulR); Minuse.LeftSideAccess.ThreadAccess = Minuse; Minuse.RightSideAccess.ThreadAccess = Minuse; Power.SetLefTandRightCommonlySide(GX, IND); Power.LeftSideAccess.ThreadAccess = Power; Power.RightSideAccess.ThreadAccess = Power; Dummy.SampleAccess = "/"; Dummy.SetLefTandRightCommonlySide(Minuse, Power); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; } else if (Node.SampleAccess == "*") { AddToTree.Tree MulL = new AddToTree.Tree("*", false); AddToTree.Tree MulR = new AddToTree.Tree("*", false); AddToTree.Tree DFX = new AddToTree.Tree(null, false); AddToTree.Tree DGX = new AddToTree.Tree(null, false); AddToTree.Tree NRMulL = new AddToTree.Tree(null, false); AddToTree.Tree NRMulR = new AddToTree.Tree(null, false); DFX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS); DGX = Derivasion.DerivasionOfFX(Node.RightSideAccess, ref UIS); NRMulL = Node.LeftSideAccess; NRMulR = Node.RightSideAccess; MulL.SetLefTandRightCommonlySide(DFX, NRMulR); MulL.LeftSideAccess.ThreadAccess = MulL; if (NRMulR.SampleAccess != null) { MulL.RightSideAccess.ThreadAccess = MulL; } MulR.SetLefTandRightCommonlySide(Node.LeftSideAccess, DGX); MulR.LeftSideAccess.ThreadAccess = MulR; if (DGX.SampleAccess != null) { MulR.RightSideAccess.ThreadAccess = MulR; } Dummy.SampleAccess = "+"; Dummy.SetLefTandRightCommonlySide(MulL, MulR); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; } else if (Node.SampleAccess == "-") { AddToTree.Tree DFX = new AddToTree.Tree(null, false); AddToTree.Tree DGX = new AddToTree.Tree(null, false); DFX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS); DGX = Derivasion.DerivasionOfFX(Node.RightSideAccess, ref UIS); Dummy.SampleAccess = "-"; Dummy.SetLefTandRightCommonlySide(DFX, DGX); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; } else if (Node.SampleAccess == "+") { AddToTree.Tree DFX = new AddToTree.Tree(null, false); AddToTree.Tree DGX = new AddToTree.Tree(null, false); DFX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS); DGX = Derivasion.DerivasionOfFX(Node.RightSideAccess, ref UIS); Dummy.SampleAccess = "+"; Dummy.SetLefTandRightCommonlySide(DFX, DGX); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; } else if (Node.SampleAccess == "^") { AddToTree.Tree ADD = new AddToTree.Tree("+", false); AddToTree.Tree Copy = Node.CopyNewTree(Node); AddToTree.Tree LnFX = new AddToTree.Tree("Ln", false); AddToTree.Tree FXONE = Node.CopyNewTree(Node.LeftSideAccess); AddToTree.Tree FXTOW = Node.CopyNewTree(Node.LeftSideAccess); AddToTree.Tree GX = Node.CopyNewTree(Node.RightSideAccess); AddToTree.Tree DFX = new AddToTree.Tree(null, false); AddToTree.Tree DGX = new AddToTree.Tree(null, false); AddToTree.Tree MulLevelTowL = new AddToTree.Tree("*", false); AddToTree.Tree MulLevelTowR = new AddToTree.Tree("*", false); AddToTree.Tree DIVThree = new AddToTree.Tree("/", false); FXONE.ThreadAccess = null; DFX = Derivasion.DerivasionOfFX(FXONE, ref UIS); GX.ThreadAccess = null; DGX = Derivasion.DerivasionOfFX(GX, ref UIS); DIVThree.SetLefTandRightCommonlySide(DFX, FXONE); DIVThree.LeftSideAccess.ThreadAccess = DIVThree; DIVThree.RightSideAccess.ThreadAccess = DIVThree; MulLevelTowR.SetLefTandRightCommonlySide(GX, DIVThree); MulLevelTowR.LeftSideAccess.ThreadAccess = MulLevelTowR; MulLevelTowR.RightSideAccess.ThreadAccess = MulLevelTowR; LnFX.SetLefTandRightCommonlySide(FXTOW, null); LnFX.LeftSideAccess.ThreadAccess = LnFX; LnFX.RightSideAccess = null; MulLevelTowL.SetLefTandRightCommonlySide(DGX, LnFX); MulLevelTowL.LeftSideAccess.ThreadAccess = MulLevelTowL; MulLevelTowL.RightSideAccess.ThreadAccess = MulLevelTowL; ADD.SetLefTandRightCommonlySide(MulLevelTowL, MulLevelTowR); ADD.LeftSideAccess.ThreadAccess = ADD; ADD.RightSideAccess.ThreadAccess = ADD; Dummy.SampleAccess = "*"; Dummy.SetLefTandRightCommonlySide(Copy, ADD); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; } else if (IS.IsFunction(Node.SampleAccess)) { AddToTree.Tree DFoGX = Node.CopyNewTree(Node); AddToTree.Tree FX = (Node); AddToTree.Tree GX = Node.RightSideAccess; AddToTree.Tree DFX = new AddToTree.Tree(null, false); AddToTree.Tree DGX = new AddToTree.Tree(null, false); FX.LeftSideAccess.SetLefTandRightCommonlySide(null, null); FX.LeftSideAccess.SampleAccess = "x"; DFX = Derivasion.DerivasionOfFX(FX, ref UIS); DGX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS); /*DFoGX.SetLefTandRightCommonlySide(DFX,null); * DFoGX.SampleAccess = DFX.SampleAccess; * DFoGX.LeftSideAccess.ThreadAccess = DFoGX; * if(DFoGX.RightSideAccess!=null) * DFoGX.RightSideAccess.ThreadAccess = DFoGX; */ DFoGX = Derivasion.ReplaceXToFX(DFX, Node.RightSideAccess); Dummy.SampleAccess = "*"; Dummy.SetLefTandRightCommonlySide(DGX, DFoGX); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; } return(Dummy); }
static AddToTree.Tree SuitableToSimplifierLocalThatDivIsLocatedAtUp(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, ref bool Suitable, ref bool MulTrueDivFalse, ref bool SimplifiedTrueOtherWiseFalse, ref float Num, ref bool RETURNED) { if (Dummy == null) { return(Dummy); } if (RETURNED) { return(Dummy); } try { if (IS.IsMul(Dummy.SampleAccess)) { //if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, ToSimplified)) if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, ToSimplified.RightSideAccess)) { if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) { Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess); try { if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "/") && (Dummy.SampleAccess == "*")) { RETURNED = true; SimplifiedTrueOtherWiseFalse = true; MulTrueDivFalse = true; Dummy.SetLefTandRightCommonlySide(null, null); Dummy.SampleAccess = "1"; Suitable = true; return(Dummy); } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } } /*else * { //ERRORCORECTION13175402 :Considerable. * RETURNED = true; * SimplifiedTrueOtherWiseFalse = true; * MulTrueDivFalse = true; * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = "1"; * Suitable = true; * Num = 1; * return Dummy; * } */ } else if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, ToSimplified.RightSideAccess)) { if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) { Num = (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess); try { if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "/") && (Dummy.ThreadAccess.SampleAccess == "*")) { RETURNED = true; SimplifiedTrueOtherWiseFalse = true; MulTrueDivFalse = true; Dummy.SetLefTandRightCommonlySide(null, null); Dummy.SampleAccess = "1"; Suitable = true; return(Dummy); } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } } /*else * {//ERRORCORECTION13175402 :Considerable. * SimplifiedTrueOtherWiseFalse = true; * MulTrueDivFalse = true; * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = "1"; * Suitable = true; * Num = 1; * return Dummy; * }*/ } } else { RETURNED = true; return(Dummy); } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtUp(Dummy.LeftSideAccess, ToSimplified, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED); LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtUp(Dummy.RightSideAccess, ToSimplified, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED); return(Dummy); }
static public bool IsNumberNegative(String Sample) { bool NumberNegative = false; if (Sample != null) { //ERRORCORECTION89764567 :The condition of being parantez added if ((!IS.IsFunction(Sample)) && (!IS.IsOperator(Sample)) && (!IS.ISindependenceVaribale(Sample)) && (!IS.IsParantez(Sample)) && (!IS.IsEqualWithThreadConsiderationCommonlySample(Sample)) && (Sample.ToLower() != "c")) { NumberNegative = true; } if (NumberNegative && System.Convert.ToDouble(Sample) < 0) { NumberNegative = true; } else if (NumberNegative && System.Convert.ToDouble(Sample) >= 0) { NumberNegative = false; } } return(NumberNegative); }
static public bool IsNumber(String Sample) { bool IsNumber = false; if (Sample != null) { //ERRORCORECTION89764567 :The condition of being parantez added if ((!IS.IsFunction(Sample)) && (!IS.IsOperator(Sample)) && (!IS.ISindependenceVaribale(Sample)) && (!IS.IsParantez(Sample)) && (!IS.IsEqualWithThreadConsiderationCommonlySample(Sample)) && (Sample.ToLower() != "c")) { IsNumber = true; } } return(IsNumber); }
static AddToTree.Tree NumberDivMulFxAction(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { if (Dummy == null) { return(Dummy); } Dummy.LeftSideAccess = NumberDivMul.NumberDivMulFxAction(Dummy.LeftSideAccess, ref UIS); Dummy.RightSideAccess = NumberDivMul.NumberDivMulFxAction(Dummy.RightSideAccess, ref UIS); int INCREASE = 2147483647 / 6; try { UIS.SetProgressValue(UIS.progressBar15, 0); if (IS.IsMul(Dummy.SampleAccess)) { if (IS.IsMul(Dummy.RightSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.RightSideAccess.LeftSideAccess.SampleAccess)) { if (Dummy.LeftSideAccess.SampleAccess.ToLower() == "c") { Dummy.RightSideAccess.RightSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess = Dummy.RightSideAccess.RightSideAccess; } } } } UIS.SetProgressValue(UIS.progressBar15, INCREASE + UIS.progressBar15.Value); if (IS.IsDiv(Dummy.SampleAccess)) { if (IS.IsMul(Dummy.LeftSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) { //ERRORCORECTION981273 :The Error corrected.refer to page218. float Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess); Num = Num / (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess); Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); Dummy.LeftSideAccess.ThreadAccess = Dummy.ThreadAccess; Dummy = Dummy.LeftSideAccess; } } } } UIS.SetProgressValue(UIS.progressBar15, INCREASE + UIS.progressBar15.Value); if (IS.IsMul(Dummy.SampleAccess)) { if (IS.IsMul(Dummy.RightSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.RightSideAccess.LeftSideAccess.SampleAccess)) { //ERRORCORECTION981273 :The Error corrected.refer to page218. if (Dummy.LeftSideAccess.SampleAccess.ToLower() != "c") { if (Dummy.RightSideAccess.SampleAccess.ToLower() != "c") { float Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess); Num = Num * (float)System.Convert.ToDouble(Dummy.RightSideAccess.LeftSideAccess.SampleAccess); Dummy.LeftSideAccess.SampleAccess = Num.ToString(); Dummy.RightSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess.ThreadAccess; Dummy.RightSideAccess = Dummy.RightSideAccess.RightSideAccess; } else { Dummy.LeftSideAccess.SampleAccess = "C"; } } } } } } UIS.SetProgressValue(UIS.progressBar15, INCREASE + UIS.progressBar15.Value); if (IS.IsDiv(Dummy.SampleAccess)) { if (IS.IsMul(Dummy.LeftSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) { //ERRORCORECTION981273 :The Error corrected.refer to page218. float Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess); Num = Num / (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess); Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy = Dummy.LeftSideAccess; } } } } UIS.SetProgressValue(UIS.progressBar15, INCREASE + UIS.progressBar15.Value); //ADDCONDITION18979714 :Refer to page 248. if (Dummy.SampleAccess == "/") { if (Dummy.LeftSideAccess.SampleAccess == "*") { if (Dummy.RightSideAccess.SampleAccess == "*") { if (IS.IsNumber(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.RightSideAccess.LeftSideAccess.SampleAccess)) { if ((Dummy.RightSideAccess.LeftSideAccess.SampleAccess.ToLower() != "c") && ((Dummy.LeftSideAccess.LeftSideAccess.SampleAccess.ToLower() != "c"))) { float Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess); Num = Num / (float)System.Convert.ToDouble(Dummy.RightSideAccess.LeftSideAccess.SampleAccess); Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); } else { Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = "C"; } Dummy.RightSideAccess.RightSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess = Dummy.RightSideAccess.RightSideAccess; } } } } } UIS.SetProgressValue(UIS.progressBar15, INCREASE + UIS.progressBar15.Value); if (Dummy.SampleAccess == "*") { if (Dummy.LeftSideAccess.SampleAccess == "*") { if (Dummy.RightSideAccess.SampleAccess == "*") { if (IS.IsNumber(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) { if (IS.IsNumber(Dummy.RightSideAccess.LeftSideAccess.SampleAccess)) { if ((Dummy.RightSideAccess.LeftSideAccess.SampleAccess.ToLower() != "c") && ((Dummy.LeftSideAccess.LeftSideAccess.SampleAccess.ToLower() != "c"))) { float Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess); Num = Num * (float)System.Convert.ToDouble(Dummy.RightSideAccess.LeftSideAccess.SampleAccess); Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); } else { Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = "C"; } Dummy.RightSideAccess.RightSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess = Dummy.RightSideAccess.RightSideAccess; } } } } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } UIS.SetProgressValue(UIS.progressBar15, 2147483647); return(Dummy); }
static public AddToTree.Tree SuitableStructureForLocalSimplifierConverstionOfDivToMul(AddToTree.Tree Dummy, ref bool CONVERSION, ref UknownIntegralSolver UIS) { if (Dummy == null) { return(Dummy); } if (CONVERSION) { return(Dummy); } bool CUREENTCONVERSION = false; AddToTree.Tree HOLDER = Dummy; AddToTree.Tree HOLDERTOMUL = new AddToTree.Tree(null, false); bool FIND = false; try { if (Dummy.SampleAccess == "/") { while (IS.IsMulOrDiv(Dummy.SampleAccess)) {//ERRORCORECTION31704050 :Refer to page 290. if (Dummy.ThreadAccess != null) { Dummy = Dummy.ThreadAccess; FIND = true; /*bool LEFTTRUERIGHTFALSE = false; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, Dummy)) * LEFTTRUERIGHTFALSE = true; * else * LEFTTRUERIGHTFALSE = false; */ bool BREAK = false; if (Dummy.SampleAccess == "/") { HOLDERTOMUL = Dummy.CopyNewTree(Dummy.RightSideAccess); Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = "1"; Dummy.SampleAccess = "*"; do { Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDER); AddToTree.Tree NEW = new AddToTree.Tree("*", false); NEW.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess), HOLDERTOMUL); NEW.LeftSideAccess.ThreadAccess = NEW; NEW.RightSideAccess.ThreadAccess = NEW; Dummy.RightSideAccess = NEW; Dummy.RightSideAccess.ThreadAccess = Dummy; System.Media.SystemSounds.Beep.Play(); BREAK = true; CUREENTCONVERSION = true; //break; } while (!BREAK); } /*else * { * if (LEFTTRUERIGHTFALSE) * Dummy = Dummy.LeftSideAccess; * else * Dummy = Dummy.RightSideAccess; * * } */ if (BREAK) { break; } } else { Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDER); FIND = false; break; } } } //ADD7317 :refer to page 291. if (CUREENTCONVERSION) { AddToTree.Tree THREAD = Dummy.ThreadAccess; Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); Dummy.ThreadAccess = THREAD; } else if (FIND) { Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDER); FIND = false; } SuitableStructureForLocalSimplifier.SuitableStructureForLocalSimplifierConverstionOfDivToMul(Dummy.LeftSideAccess, ref CONVERSION, ref UIS); SuitableStructureForLocalSimplifier.SuitableStructureForLocalSimplifierConverstionOfDivToMul(Dummy.RightSideAccess, ref CONVERSION, ref UIS); } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } catch (StackOverflowException t) { ExceptionClass.ExceptionClassMethod(t); } return(Dummy); }
static AddToTree.Tree SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, ref bool Suitable, ref bool DivTrueMulFalse, ref bool SimplifiedTrueOtherWiseFalse) { if (Dummy == null) { return(Dummy); } try { if (IS.IsMul(Dummy.SampleAccess)) { //if (Dummy.FINDTreeWithThreadConsideration(ToSimplified, Dummy.LeftSideAccess) == null) if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.LeftSideAccess, ToSimplified)) { try { if ((ToSimplified.ThreadAccess.SampleAccess == "/") && (Dummy.SampleAccess == "*")) { SimplifiedTrueOtherWiseFalse = true; DivTrueMulFalse = true; //LOCATION81726487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); //Dummy = Dummy.ThreadAccess; /*if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess,HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = "1"; * } * else */ //if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess,HOLDER)) //{ Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = "1"; //} } /*else * if ((ToSimplified.ThreadAccess.SampleAccess == "*") && (Dummy.ThreadAccess.SampleAccess == "/")) * { * SimplifiedTrueOtherWiseFalse = true; * DivTrueMulFalse = false; * //LOCATION81987526487 :refer to page 265. * AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); * //Dummy = Dummy.ThreadAccess; * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) * { * Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.RightSideAccess.SampleAccess = "1"; * } * else * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = null; * } * * * }*/ } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } } else //if (Dummy.FINDTreeWithThreadConsideration(ToSimplified, Dummy.RightSideAccess) == null) if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.RightSideAccess, ToSimplified)) { try { if ((ToSimplified.ThreadAccess.SampleAccess == "/") && (Dummy.SampleAccess == "*")) { SimplifiedTrueOtherWiseFalse = true; DivTrueMulFalse = true; //LOCATION81726487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = "1"; Suitable = true; } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } } Suitable = true; } else { return(Dummy); } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } LocalSearchMulDivisionEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(Dummy.LeftSideAccess, ToSimplified, ref Suitable, ref DivTrueMulFalse, ref SimplifiedTrueOtherWiseFalse); LocalSearchMulDivisionEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(Dummy.RightSideAccess, ToSimplified, ref Suitable, ref DivTrueMulFalse, ref SimplifiedTrueOtherWiseFalse); return(Dummy); }
static AddToTree.Tree LocalSearchMinusPlusTowNumberSimplifierActionFx(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { if (Dummy == null) { return(Dummy); } bool SimplifiedTrueOtherWiseFalse = false; bool Suitable = false; bool MinuseTruePluseFalse = false; float NUM = 0; try { if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) { LocalSearchMinusPlusTowNumberSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.RightSideAccess, Dummy.LeftSideAccess, out Suitable, out MinuseTruePluseFalse, out SimplifiedTrueOtherWiseFalse, out NUM); if (SimplifiedTrueOtherWiseFalse) { if (MinuseTruePluseFalse) { float NUMC = (float)System.Convert.ToDouble(Dummy.SampleAccess) - NUM; if (NUMC != 0) { Dummy.SampleAccess = System.Convert.ToString(NUMC); } else { Dummy.SampleAccess = null; } } else { float NUMC = (float)System.Convert.ToDouble(Dummy.SampleAccess) + NUM; if (NUMC != 0) { Dummy.SampleAccess = System.Convert.ToString(NUMC); } else { Dummy.SampleAccess = null; } } } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } SimplifiedTrueOtherWiseFalse = false; Suitable = false; MinuseTruePluseFalse = false; try { if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) { LocalSearchMinusPlusTowNumberSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(Dummy, Dummy.RightSideAccess, out Suitable, out MinuseTruePluseFalse, out SimplifiedTrueOtherWiseFalse, out NUM); if (SimplifiedTrueOtherWiseFalse) { if (MinuseTruePluseFalse) { Dummy.SampleAccess = System.Convert.ToString(System.Convert.ToDouble(Dummy.SampleAccess) - NUM); } else { Dummy.SampleAccess = System.Convert.ToString(System.Convert.ToDouble(Dummy.SampleAccess) + NUM); } } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } LocalSearchMinusPlusTowNumberSimplifier.LocalSearchMinusPlusTowNumberSimplifierActionFx(Dummy.LeftSideAccess, ref UIS); LocalSearchMinusPlusTowNumberSimplifier.LocalSearchMinusPlusTowNumberSimplifierActionFx(Dummy.RightSideAccess, ref UIS); return(Dummy); }
static public AddToTreeTreeLinkList GetBigestCommonFactor(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { AddToTreeTreeLinkList CommonFactors = new AddToTreeTreeLinkList(); AddToTreeTreeLinkList Holder = new AddToTreeTreeLinkList(); //ERRORCORECTION1284797 :refer to page 302. Holder = ONLYMULnODE.CopyLinkList(); AddToTree.Tree Current = new AddToTree.Tree(null, false); AddToTreeTreeLinkList MulatedMul = new AddToTreeTreeLinkList(); AddToTree.Tree Factors = null; while (!(Holder.ISEmpty())) { Current = Holder.DELETEFromTreeFirstNode(); //ERRORCORCTION827346 :Refer to page 302. //ERROR715540 :Refer to page 302. MULATEDELEMENTS = FactorActivation.GetMultedElements(Current, ref UIS); AddToTreeTreeLinkList DummyConsiderationCopy = new AddToTreeTreeLinkList(); DummyConsiderationCopy = ONLYMULnODE.CopyLinkList(); AddToTreeTreeLinkList DummyConsideration = new AddToTreeTreeLinkList(); DummyConsideration = ONLYMULnODE.CopyLinkList(); AddToTree.Tree EveryMulatedElementsConsideration = new AddToTree.Tree(null, false); while (!(MULATEDELEMENTS.ISEmpty())) { DummyConsideration = DummyConsiderationCopy.CopyLinkList(); EveryMulatedElementsConsideration = MULATEDELEMENTS.DELETEFromTreeFirstNode(); //bool IsFactor = false; float Num = 0; if (EveryMulatedElementsConsideration.SampleAccess != null) { if ((IS.IsMinusAndPluseFirstNode(Dummy)) && (IS.ExistElementOnAllMulatedNodes(EveryMulatedElementsConsideration, DummyConsideration, ref UIS)) && (IS.IsNotUpperPowerOfNodeInList(EveryMulatedElementsConsideration, AbledFactors.CopyLinkList(), ref Num)) && (!(AbledFactors.FINDTreeWithOutThreadConsideration(EveryMulatedElementsConsideration)))) { Factors = EveryMulatedElementsConsideration; AbledFactors.ADDToTree(Factors); } } } } return(AbledFactors); }
static AddToTree.Tree ChangeFunctionFxAction(AddToTree.Tree Dummy) { if (Dummy == null) { return(null); } if ((Dummy.SampleAccess == "^") && (Dummy.LeftSideAccess.SampleAccess.ToLower() == "sin") && (IS.IsNumber(Dummy.RightSideAccess.SampleAccess))) { AddToTree.Tree Cos = new AddToTree.Tree("Cos", false); AddToTree.Tree TOW = new AddToTree.Tree("2", false); AddToTree.Tree ONE = new AddToTree.Tree("1", false); float NUM = (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess); if (NUM <= 1) { return(Dummy); } NUM = NUM - 2; Cos.LeftSideAccess = new AddToTree.Tree(null, false); Cos.LeftSideAccess.ThreadAccess = Cos; Cos = Cos.LeftSideAccess; Cos.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess.LeftSideAccess), TOW.CopyNewTree(TOW)); Cos.LeftSideAccess.ThreadAccess = Cos; Cos.RightSideAccess.ThreadAccess = Cos; Cos.SampleAccess = "*"; Cos = Cos.ThreadAccess; Cos.SetLefTandRightCommonlySide(ONE, Cos.CopyNewTree(Cos)); Cos.LeftSideAccess.ThreadAccess = Cos; Cos.RightSideAccess.ThreadAccess = Cos; Cos.SampleAccess = "-"; Cos.SetLefTandRightCommonlySide(Cos.CopyNewTree(Cos), TOW); Cos.LeftSideAccess.ThreadAccess = Cos; Cos.RightSideAccess.ThreadAccess = Cos; Cos.SampleAccess = "/"; AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy.ThreadAccess); AddToTree.Tree HOLDERDummy = Dummy.CopyNewTree(Dummy.LeftSideAccess); AddToTree.Tree NUMDummy = new AddToTree.Tree(null, false); if (NUM > 0) { Dummy.LeftSideAccess = Cos; Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.LeftSideAccess; Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess; NUMDummy.SampleAccess = NUM.ToString(); HOLDERDummy.SetLefTandRightCommonlySide(HOLDERDummy.CopyNewTree(HOLDERDummy), NUMDummy); HOLDERDummy.RightSideAccess.ThreadAccess = HOLDERDummy; HOLDERDummy.LeftSideAccess.ThreadAccess = HOLDERDummy; HOLDERDummy.SampleAccess = "^"; Dummy.RightSideAccess = HOLDERDummy; Dummy.RightSideAccess.ThreadAccess = Dummy; Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.SampleAccess = "*"; } else { Dummy = Cos; } Dummy.ThreadAccess = HOLDER; } if ((Dummy.SampleAccess == "^") && (Dummy.LeftSideAccess.SampleAccess.ToLower() == "cos") && (IS.IsNumber(Dummy.RightSideAccess.SampleAccess))) { AddToTree.Tree Cos = new AddToTree.Tree("Cos", false); AddToTree.Tree TOW = new AddToTree.Tree("2", false); AddToTree.Tree ONE = new AddToTree.Tree("1", false); float NUM = (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess); if (NUM <= 1) { return(Dummy); } NUM = NUM - 2; Cos.LeftSideAccess = new AddToTree.Tree(null, false); Cos.LeftSideAccess.ThreadAccess = Cos; Cos = Cos.LeftSideAccess; Cos.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess.LeftSideAccess), TOW.CopyNewTree(TOW)); Cos.LeftSideAccess.ThreadAccess = Cos; Cos.RightSideAccess.ThreadAccess = Cos; Cos.SampleAccess = "*"; Cos = Cos.ThreadAccess; Cos.SetLefTandRightCommonlySide(ONE, Cos.CopyNewTree(Cos)); Cos.LeftSideAccess.ThreadAccess = Cos; Cos.RightSideAccess.ThreadAccess = Cos; Cos.SampleAccess = "+"; Cos.SetLefTandRightCommonlySide(Cos.CopyNewTree(Cos), TOW); Cos.LeftSideAccess.ThreadAccess = Cos; Cos.RightSideAccess.ThreadAccess = Cos; Cos.SampleAccess = "/"; AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy.ThreadAccess); AddToTree.Tree HOLDERDummy = Dummy.CopyNewTree(Dummy.LeftSideAccess); AddToTree.Tree NUMDummy = new AddToTree.Tree(null, false); if (NUM > 0) { Dummy.LeftSideAccess = Cos; Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.LeftSideAccess; Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess; NUMDummy.SampleAccess = NUM.ToString(); HOLDERDummy.SetLefTandRightCommonlySide(HOLDERDummy.CopyNewTree(HOLDERDummy), NUMDummy); HOLDERDummy.RightSideAccess.ThreadAccess = HOLDERDummy; HOLDERDummy.LeftSideAccess.ThreadAccess = HOLDERDummy; HOLDERDummy.SampleAccess = "^"; Dummy.RightSideAccess = HOLDERDummy; Dummy.RightSideAccess.ThreadAccess = Dummy; Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.SampleAccess = "*"; } else { Dummy = Cos; } Dummy.ThreadAccess = HOLDER; } return(Dummy); }
static AddToTree.Tree SuitableToSimplifierLocalThatDivIsLocatedAtDown(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, ref bool Suitable, ref bool MulTrueDivFalse, ref bool SimplifiedTrueOtherWiseFalse, ref float Num, ref bool RETURNED) { if (Dummy == null) { return(Dummy); } if (RETURNED) { return(Dummy); } try { if (IS.IsMul(Dummy.SampleAccess)) { } else if (IS.IsDiv(Dummy.SampleAccess)) { if ((EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, ToSimplified.RightSideAccess)) && (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess))) { Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess); try { if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "*") && (Dummy.SampleAccess == "/")) { RETURNED = true; SimplifiedTrueOtherWiseFalse = true; MulTrueDivFalse = false; Dummy.SetLefTandRightCommonlySide(null, null); Dummy.SampleAccess = "1"; } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } Suitable = true; } else if ((EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess.LeftSideAccess, ToSimplified.RightSideAccess)) && (IS.IsMul(Dummy.RightSideAccess.SampleAccess) && (Dummy.SampleAccess == "/"))) { //ERRORCORECTION9812737 Private state for Page 292. try { if ((ToSimplified.ThreadAccess.SampleAccess == "*")) { RETURNED = true; SimplifiedTrueOtherWiseFalse = true; MulTrueDivFalse = false; Dummy.RightSideAccess.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.LeftSideAccess.SampleAccess = "1"; Num = 1; } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } } else { Suitable = false; return(Dummy); } } else { RETURNED = true; return(Dummy); } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtDown(Dummy.LeftSideAccess, ToSimplified, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED); LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtDown(Dummy.RightSideAccess, ToSimplified, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED); return(Dummy); }
static public bool IsPlusOrMulAllNode(AddToTree.Tree Dummy) { if (Dummy == null) { return(true); } bool Is = true; if (((Dummy.SampleAccess != "+") && (Dummy.SampleAccess != "^") || (Dummy.SampleAccess != "*")) && IS.IsOperator(Dummy.SampleAccess)) { Is = false; } Is = Is && IS.IsPlusOrMulAllNode(Dummy.LeftSideAccess); Is = Is && IS.IsPlusOrMulAllNode(Dummy.RightSideAccess); return(Is); }
static AddToTree.Tree LocalSearchMulDivionWithNumberMulatedEqualSimplifierActionFx(AddToTree.Tree Dummy, ref bool MULDIVISIONWITHNUMBERMULATED, ref UknownIntegralSolver UIS) { if (Dummy == null) { return(Dummy); } bool SimplifiedTrueOtherWiseFalse = false; bool Suitable = false; bool MulTrueDivFalse = false; bool RETURNED = false; float Num = 0; try { if (Dummy.RightSideAccess.SampleAccess == "/") {//ERRORCORECTION19862348761 :Refer to page 288. LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtUp(Dummy.LeftSideAccess, Dummy.RightSideAccess, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED); if (SimplifiedTrueOtherWiseFalse) { Dummy = Dummy.RightSideAccess; if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) { Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = "1"; Num = Num * (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess)); if (Num == 0) { Dummy.LeftSideAccess.SampleAccess = null; } else { Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } MULDIVISIONWITHNUMBERMULATED = true; } /*else * if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) * { * Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); * Dummy.LeftSideAccess.SampleAccess = "1"; * Num = Num / (float)(System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess)); * if (Num == 0) * Dummy.RightSideAccess.SampleAccess = null; * else * Dummy.RightSideAccess.SampleAccess = Num.ToString(); * } * else * { * Dummy.SetLefTandRightCommonlySide(null, null); * if (Num == 0) * Dummy.SampleAccess = null; * else * Dummy.SampleAccess = Num.ToString(); * } */ } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } if (SimplifiedTrueOtherWiseFalse) { Dummy = Dummy.ThreadAccess; AddToTree.Tree HOLDERTHRED = Dummy.ThreadAccess; Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); Dummy.ThreadAccess = HOLDERTHRED; } SimplifiedTrueOtherWiseFalse = false; Suitable = false; MulTrueDivFalse = false; Num = 0; RETURNED = false; try { if (Dummy.LeftSideAccess.SampleAccess == "*") { LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtDown(Dummy.RightSideAccess, Dummy.LeftSideAccess, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED); if (SimplifiedTrueOtherWiseFalse) {//ERRORCORECTION1274 :Refer to page 292. Dummy = Dummy.LeftSideAccess; if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) { Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = "1"; Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess)) / Num; if (Num == 0) { Dummy.RightSideAccess.SampleAccess = null; } else { Dummy.RightSideAccess.SampleAccess = Num.ToString(); } MULDIVISIONWITHNUMBERMULATED = true; } else if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) { Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = "1"; Num = Num * (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess)); if (Num == 0) { Dummy.LeftSideAccess.SampleAccess = null; } else { Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } MULDIVISIONWITHNUMBERMULATED = true; } else { Dummy.SetLefTandRightCommonlySide(null, null); if (Num == 0) { Dummy.SampleAccess = null; } else { Dummy.SampleAccess = Num.ToString(); } MULDIVISIONWITHNUMBERMULATED = true; } } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } if (SimplifiedTrueOtherWiseFalse) { Dummy = Dummy.ThreadAccess; AddToTree.Tree HOLDERTHRED = Dummy.ThreadAccess; Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); Dummy.ThreadAccess = HOLDERTHRED; } LocalSearchMulDivionWithNumberMulatedEqualSimplifier.LocalSearchMulDivionWithNumberMulatedEqualSimplifierActionFx(Dummy.LeftSideAccess, ref MULDIVISIONWITHNUMBERMULATED, ref UIS); LocalSearchMulDivionWithNumberMulatedEqualSimplifier.LocalSearchMulDivionWithNumberMulatedEqualSimplifierActionFx(Dummy.RightSideAccess, ref MULDIVISIONWITHNUMBERMULATED, ref UIS); return(Dummy); }
static void FindSubFactorCommonFinalizationFx(AddToTree.Tree Dummy2) { if (Dummy2 == null) { return; } if ((Dummy2.SampleAccess == "+") || (Dummy2.SampleAccess == "-")) { if (!(FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy2))) { NOTEXPECTED.ADDToTree(Dummy2); return; } } try { //ADDEDCONDTITION9281374 :Refer to page 328. //ERRORCORECTION98127489 :refer to page 328. //ERRORCORECTION892374978 :Refer to page 330. if ((!(IS.IsMulInNode(Dummy2))) && (COMMONFACTORS.ISEmpty())) { if ((FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy2)) && (!(COMMONFACTORS.FINDTreeWithOutThreadConsideration(Dummy2)))) { COMMONFACTORS.ADDToTree(Dummy2); //LOCATION3070405000 :refer to page 300. FACTORLISTEDS.DELETEFromTreeFindedNode(Dummy2); NOTEXPECTED.DELETEFromTreeFindedNode(Dummy2); } else if ((Dummy2.SampleAccess == "^") && (IS.IsNumber(Dummy2.RightSideAccess.RightSideAccess.SampleAccess)) && ((FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy2.RightSideAccess.LeftSideAccess))) && (!(COMMONFACTORS.FINDTreeWithOutThreadConsideration(Dummy2.LeftSideAccess)))) { COMMONFACTORS.ADDToTree(Dummy2.LeftSideAccess); FACTORLISTEDS.DELETEFromTreeFindedNode(Dummy2.LeftSideAccess); NOTEXPECTED.DELETEFromTreeFindedNode(Dummy2.LeftSideAccess); } else { NOTEXPECTED.ADDToTree(Dummy2); } } if (Dummy2.SampleAccess == "*") { //if (!IS.IsNumber(Dummy2.LeftSideAccess.SampleAccess)) //{ if ((!(COMMONFACTORS.FINDTreeWithOutThreadConsideration(Dummy2.LeftSideAccess))) && (FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy2.LeftSideAccess))) { COMMONFACTORS.ADDToTree(Dummy2.LeftSideAccess); FACTORLISTEDS.DELETEFromTreeFindedNode(Dummy2.LeftSideAccess); NOTEXPECTED.DELETEFromTreeFindedNode(Dummy2.LeftSideAccess); } else if ((Dummy2.LeftSideAccess.SampleAccess == "^") && (IS.IsNumber(Dummy2.LeftSideAccess.RightSideAccess.SampleAccess)) && ((FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy2.LeftSideAccess.LeftSideAccess))) && (!(COMMONFACTORS.FINDTreeWithOutThreadConsideration(Dummy2.LeftSideAccess.LeftSideAccess)))) { COMMONFACTORS.ADDToTree(Dummy2.LeftSideAccess.LeftSideAccess); FACTORLISTEDS.DELETEFromTreeFindedNode(Dummy2.LeftSideAccess.LeftSideAccess); NOTEXPECTED.DELETEFromTreeFindedNode(Dummy2.LeftSideAccess.LeftSideAccess); } else { NOTEXPECTED.ADDToTree(Dummy2.LeftSideAccess); } //} //if (!IS.IsNumber(Dummy2.RightSideAccess.SampleAccess)) //{ if ((FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy2.RightSideAccess)) && (!(COMMONFACTORS.FINDTreeWithOutThreadConsideration(Dummy2.RightSideAccess)))) { COMMONFACTORS.ADDToTree(Dummy2.RightSideAccess); //LOCATION3070405000 :refer to page 300. FACTORLISTEDS.DELETEFromTreeFindedNode(Dummy2.RightSideAccess); NOTEXPECTED.DELETEFromTreeFindedNode(Dummy2.RightSideAccess); } else if ((Dummy2.RightSideAccess.SampleAccess == "^") && (IS.IsNumber(Dummy2.RightSideAccess.RightSideAccess.SampleAccess)) && ((FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy2.RightSideAccess.LeftSideAccess))) && (!(COMMONFACTORS.FINDTreeWithOutThreadConsideration(Dummy2.RightSideAccess.LeftSideAccess)))) { COMMONFACTORS.ADDToTree(Dummy2.RightSideAccess.LeftSideAccess); FACTORLISTEDS.DELETEFromTreeFindedNode(Dummy2.RightSideAccess.LeftSideAccess); NOTEXPECTED.DELETEFromTreeFindedNode(Dummy2.RightSideAccess.LeftSideAccess); } else { NOTEXPECTED.ADDToTree(Dummy2.RightSideAccess); } // } } FindSubFactor.FindSubFactorCommonFinalizationFx(Dummy2.LeftSideAccess); FindSubFactor.FindSubFactorCommonFinalizationFx(Dummy2.RightSideAccess); } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } }
static AddToTree.Tree LocalSearchMinusPlusWithNumberMulatedEqualSimplifierActionFx(AddToTree.Tree Dummy, ref bool MINUSEPLUSWITHNUMBERMULATED) { if (Dummy == null) { return(Dummy); } bool SimplifiedTrueOtherWiseFalse = false; bool Suitable = false; bool MinuseTruePluseFalse = false; float Num = 0; try { if (IS.IsNumber(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) { LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.RightSideAccess, Dummy.LeftSideAccess, ref Suitable, ref MinuseTruePluseFalse, ref SimplifiedTrueOtherWiseFalse, ref Num); if (SimplifiedTrueOtherWiseFalse) { if ((Dummy.ThreadAccess.ThreadAccess == null) || (Dummy.SampleAccess == "+")) { if (MinuseTruePluseFalse) { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) - Num; Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } else { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) + Num; Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } } else if (Dummy.SampleAccess == "-") { if (MinuseTruePluseFalse) { if (MinuseTruePluseFalse) { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess) * -1) - Num; Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } else { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) + Num; Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } // Dummy.LeftSideAccess.SampleAccess = Num.ToString(); } else { Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) + Num; Dummy.LeftSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } } } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } SimplifiedTrueOtherWiseFalse = false; Suitable = false; MinuseTruePluseFalse = false; Num = 0; try { if (IS.IsNumber(Dummy.RightSideAccess.LeftSideAccess.SampleAccess)) { LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(Dummy.LeftSideAccess, Dummy.RightSideAccess, ref Suitable, ref MinuseTruePluseFalse, ref SimplifiedTrueOtherWiseFalse, ref Num); if (SimplifiedTrueOtherWiseFalse) { if (Dummy.SampleAccess == "+") { if (MinuseTruePluseFalse) { Num = (float)(System.Convert.ToDouble(Dummy.RightSideAccess.LeftSideAccess.SampleAccess)) - Num; Dummy.RightSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } else { Num = (float)(System.Convert.ToDouble(Dummy.RightSideAccess.LeftSideAccess.SampleAccess)) + Num; Dummy.RightSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } } else { if (MinuseTruePluseFalse) { Num = (float)(System.Convert.ToDouble(Dummy.RightSideAccess.LeftSideAccess.SampleAccess) * -1) - Num; Dummy.LeftSideAccess.RightSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } else { Num = (float)(System.Convert.ToDouble(Dummy.RightSideAccess.LeftSideAccess.SampleAccess) * -1) + Num; Dummy.RightSideAccess.LeftSideAccess.SampleAccess = Num.ToString(); MINUSEPLUSWITHNUMBERMULATED = true; } } //Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); //Dummy.RightSideAccess.SampleAccess = null; } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.LocalSearchMinusPlusWithNumberMulatedEqualSimplifierActionFx(Dummy.LeftSideAccess, ref MINUSEPLUSWITHNUMBERMULATED); LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.LocalSearchMinusPlusWithNumberMulatedEqualSimplifierActionFx(Dummy.RightSideAccess, ref MINUSEPLUSWITHNUMBERMULATED); return(Dummy); }
static void FindSubFactorCommonAddedToListFx(AddToTree.Tree Dummy1) { if (Dummy1 == null) { return; } //ERRORGESSESSADDED8127466 :refer to page 328. //ERRORCORECTION892374978 :Refer to page 330. if ((!(IS.IsMulInNode(Dummy1))) && (FACTORLISTEDS.ISEmpty())) { if (!(FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy1))) { FACTORLISTEDS.ADDToTree(Dummy1); } } try { if (Dummy1.SampleAccess == "*") { //if ((!(IS.IsNumber(Dummy1.LeftSideAccess.SampleAccess))) && (Dummy1.LeftSideAccess.SampleAccess != "*")) //{ //if (!IS.IsMulInNode(Dummy1.LeftSideAccess)) if (!(FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy1.LeftSideAccess))) { FACTORLISTEDS.ADDToTree(Dummy1.LeftSideAccess); } if (!(FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy1.LeftSideAccess))) { if (Dummy1.LeftSideAccess.SampleAccess == "^") { if (IS.IsNumber(Dummy1.LeftSideAccess.RightSideAccess.SampleAccess)) { //if (!IS.IsMulInNode(Dummy1.LeftSideAccess.LeftSideAccess)) if (!(FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy1.LeftSideAccess.LeftSideAccess))) { FACTORLISTEDS.ADDToTree(Dummy1.LeftSideAccess.LeftSideAccess); } } } } //} //if ((!(IS.IsNumber(Dummy1.RightSideAccess.SampleAccess))) && (Dummy1.RightSideAccess.SampleAccess != "*")) //{ //if (!IS.IsMulInNode(Dummy1.RightSideAccess)) if (!(FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy1.RightSideAccess))) { FACTORLISTEDS.ADDToTree(Dummy1.RightSideAccess); } if (!(FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy1.RightSideAccess))) { if (Dummy1.RightSideAccess.SampleAccess == "^") { if (IS.IsNumber(Dummy1.RightSideAccess.RightSideAccess.SampleAccess)) { //if (!IS.IsMulInNode(Dummy1.RightSideAccess.LeftSideAccess)) if (!(FACTORLISTEDS.FINDTreeWithOutThreadConsideration(Dummy1.RightSideAccess.LeftSideAccess))) { FACTORLISTEDS.ADDToTree(Dummy1.RightSideAccess.LeftSideAccess); } } } } //} } FindSubFactor.FindSubFactorCommonAddedToListFx(Dummy1.LeftSideAccess); FindSubFactor.FindSubFactorCommonAddedToListFx(Dummy1.RightSideAccess); } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } }
static AddToTree.Tree SimplifierCommonSubFactorActionLeftSideFx(AddToTree.Tree Dummy, AddToTree.Tree COMMONSUBFACTOR, ref bool END, AddToTreeTreeLinkList NOTFACTOR) { if (Dummy == null) { return(Dummy); } if (Dummy.SampleAccess != "*") { if (NOTFACTOR.FINDTreeWithOutThreadConsideration(Dummy)) { return(Dummy); } } if (END) { return(Dummy); } if ((Dummy.ThreadAccess.SampleAccess == "*") && (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy, COMMONSUBFACTOR))) { Dummy.SetLefTandRightCommonlySide(null, null); Dummy.SampleAccess = "1"; END = true; } else if ((Dummy.ThreadAccess.SampleAccess == "^") && (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.ThreadAccess.LeftSideAccess, COMMONSUBFACTOR)) && (IS.IsNumber(Dummy.ThreadAccess.RightSideAccess.SampleAccess))) { float NUM = (float)System.Convert.ToDouble(Dummy.ThreadAccess.RightSideAccess.SampleAccess); NUM = NUM - 1; if (NUM > 0) { Dummy.ThreadAccess.RightSideAccess.SampleAccess = NUM.ToString(); } else { Dummy.SetLefTandRightCommonlySide(null, null); Dummy.SampleAccess = "1"; } END = true; } Dummy.LeftSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionLeftSideFx(Dummy.LeftSideAccess, COMMONSUBFACTOR, ref END, NOTFACTOR); Dummy.RightSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionLeftSideFx(Dummy.RightSideAccess, COMMONSUBFACTOR, ref END, NOTFACTOR); return(Dummy); }
static AddToTree.Tree BesidesAverageActionFx(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { if (Dummy == null) { return(Dummy); } int INCREASE = 2147483647 / 4; UIS.SetProgressValue(UIS.progressBar8, 0); if (IS.IsDiv(Dummy.SampleAccess)) { if (IS.IsDiv(Dummy.LeftSideAccess.SampleAccess) && IS.IsDiv(Dummy.RightSideAccess.SampleAccess)) { AddToTree.Tree MUL = new AddToTree.Tree(null, false); MUL = Dummy.CopyNewTree(Dummy.LeftSideAccess.RightSideAccess); UIS.SetProgressValue(UIS.progressBar8, INCREASE + UIS.progressBar8.Value); Dummy.LeftSideAccess.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess.LeftSideAccess), Dummy.CopyNewTree(Dummy.RightSideAccess.RightSideAccess)); Dummy.LeftSideAccess.SampleAccess = "*"; Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.LeftSideAccess; Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess; UIS.SetProgressValue(UIS.progressBar8, INCREASE + UIS.progressBar8.Value); Dummy.SampleAccess = "/"; Dummy.RightSideAccess.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess.LeftSideAccess), MUL); Dummy.RightSideAccess.SampleAccess = "*"; Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess; Dummy.RightSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess; UIS.SetProgressValue(UIS.progressBar8, INCREASE + UIS.progressBar8.Value); } UIS.SetProgressValue(UIS.progressBar8, 2147483647); /* else * if (IS.IsDiv(Dummy.LeftSideAccess.SampleAccess)) * { * AddToTree.Tree MUL = new AddToTree.Tree(null, false); * MUL = Dummy.CopyNewTree(Dummy.RightSideAccess); * Dummy.RightSideAccess = Dummy.LeftSideAccess.RightSideAccess; * Dummy.RightSideAccess.ThreadAccess = Dummy; * * Dummy.SampleAccess = "/"; * * Dummy.LeftSideAccess.RightSideAccess = MUL; * Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess; * Dummy.LeftSideAccess.SampleAccess = "*"; * * * } * else * if (IS.IsDiv(Dummy.RightSideAccess.SampleAccess)) * { * Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess); * * AddToTree.Tree MUL = new AddToTree.Tree(null, false); * MUL = Dummy.CopyNewTree(Dummy.RightSideAccess); * Dummy.RightSideAccess = Dummy.LeftSideAccess.RightSideAccess; * Dummy.RightSideAccess.ThreadAccess = Dummy; * * Dummy.SampleAccess = "/"; * * Dummy.LeftSideAccess.RightSideAccess = MUL; * Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess; * Dummy.LeftSideAccess.SampleAccess = "*"; * * * } */ } Dummy.LeftSideAccess = BesidesAverage.BesidesAverageActionFx(Dummy.LeftSideAccess, ref UIS); Dummy.RightSideAccess = BesidesAverage.BesidesAverageActionFx(Dummy.RightSideAccess, ref UIS); return(Dummy); }
static public AddToTree.Tree SimplifierCommonSubFactorCalculatorFx(AddToTree.Tree Dummy, ref bool CONTINUE, ref UknownIntegralSolver UIS) { if ((Dummy == null) || (!(IS.IsDivInNode(Dummy)))) { return(Dummy); } //ERRORCORECTION2189743 :the Second condition of above is added. int INCREASE = 2147483647 / 9; UIS.SetProgressValue(UIS.progressBar9, 0); if (Dummy.SampleAccess == "/") { UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy.LeftSideAccess = FactorActivation.FactorActivationFx(Dummy.LeftSideAccess, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy.RightSideAccess = FactorActivation.FactorActivationFx(Dummy.RightSideAccess, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); /* try * { * Dummy.LeftSideAccess.ThreadAccess = Dummy; * Dummy.RightSideAccess.ThreadAccess = Dummy; * } * catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } */ UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy = NumberDivMul.NumberDivMulFx(Dummy, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); AddToTreeTreeLinkList COMMONFACTOR = FindSubFactor.FindSubFactorFx(Dummy.LeftSideAccess, Dummy.RightSideAccess); bool ENDLEFT = false; bool ENDRIGHT = false; AddToTree.Tree COMMONSUBFACORT = new AddToTree.Tree(null, false); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); while (!((COMMONFACTOR.ISEmpty())) && ((ENDLEFT && ENDRIGHT))) { CONTINUE = true; COMMONSUBFACORT = COMMONFACTOR.DELETEFromTreeFirstNode(); if (!ENDLEFT) { Dummy.LeftSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionLeftSideFx(Dummy.LeftSideAccess, COMMONSUBFACORT, ref ENDLEFT, FindSubFactor.FACTORLISTEDSAccess()); } if (!ENDRIGHT) { Dummy.RightSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionRightSideFx(Dummy.RightSideAccess, COMMONSUBFACORT, ref ENDRIGHT, FindSubFactor.NotExpectedAccess()); } Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); } UIS.SetProgressValue(UIS.progressBar9, 2147483647); if (!((IS.IsDivInNode(Dummy.LeftSideAccess)) || (IS.IsDivInNode(Dummy.RightSideAccess)))) { return(Dummy); } } if (Dummy.LeftSideAccess != null) { Dummy.LeftSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorCalculatorFx(Dummy.LeftSideAccess, ref CONTINUE, ref UIS); } if (Dummy.RightSideAccess != null) { Dummy.RightSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorCalculatorFx(Dummy.RightSideAccess, ref CONTINUE, ref UIS); } return(Dummy); }
static public AddToTree.Tree KnownIntegralFormullaFx(AddToTree.Tree Dummy) { try { if ((Dummy.LeftSideAccess != null) && (Dummy.RightSideAccess != null) && (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) && (Dummy.SampleAccess == "/") && (Dummy.RightSideAccess.SampleAccess == "x")) { AddToTree.Tree Ln = new AddToTree.Tree("Ln", false); Ln.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess), null); Ln.LeftSideAccess.ThreadAccess = Ln; Ln.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess), Ln.CopyNewTree(Ln)); Ln.LeftSideAccess.ThreadAccess = Ln; Ln.RightSideAccess.ThreadAccess = Ln; Ln.SampleAccess = "*"; Dummy = Ln; } else if ((Dummy.LeftSideAccess.SampleAccess.ToLower() == "x") && (Dummy.RightSideAccess == null) && (Dummy.SampleAccess.ToLower() == "ln")) { AddToTree.Tree Ln = new AddToTree.Tree("Ln", false); AddToTree.Tree X = new AddToTree.Tree("X", false); Ln.SetLefTandRightCommonlySide(X.CopyNewTree(X), null); Ln.LeftSideAccess.ThreadAccess = Ln; Ln.SetLefTandRightCommonlySide(X.CopyNewTree(X), Ln.CopyNewTree(Ln)); Ln.LeftSideAccess.ThreadAccess = Ln; Ln.RightSideAccess.ThreadAccess = Ln; Ln.SampleAccess = "*"; Ln.SetLefTandRightCommonlySide(Ln.CopyNewTree(Ln), X); Ln.LeftSideAccess.ThreadAccess = Ln; Ln.RightSideAccess.ThreadAccess = Ln; Ln.SampleAccess = "-"; Dummy = Ln; } else if (true) { Dummy = null; } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); Dummy = null; } return(Dummy); }
static private AddToTree.Tree TrasmisionActionHole(AddToTree.Tree Dummy) { //ERROR13107142 :This code cuased to an infinite loop.refer to page 182. if (Dummy == null) { return(Dummy); } TransmisionToDeleteingMinusPluse.TrasmisionActionHole(Dummy.LeftSideAccess); TransmisionToDeleteingMinusPluse.TrasmisionActionHole(Dummy.RightSideAccess); try { bool ABLE = false; AddToTree.Tree CurrentObject = Dummy; AddToTree.Tree NODE = Dummy; AddToTree.Tree FIRST = Dummy; while ((IS.IsOperator(FIRST.SampleAccess)) && (FIRST.SampleAccess != "/") && (FIRST.SampleAccess != "^") && (FIRST.ThreadAccess != null)) { FIRST = FIRST.ThreadAccess; } int DeepLeft = 0; while ((NODE.LeftSideAccess != null) && (IS.IsOperator(NODE.SampleAccess)) && (NODE.SampleAccess != "/") && (NODE.SampleAccess != "^")) { NODE = NODE.LeftSideAccess; DeepLeft++; } //ERRORCORECTION9872423784 :The ERRORCUASE713040 Correction.refer to page 182. if (NODE.LeftSideAccess != null) { if (NODE.LeftSideAccess.LeftSideAccess != null) { ABLE = true; } } if (ABLE) { if (DeepLeft > 1) { AddToTree.Tree Last = NODE.CopyNewTree(NODE.ThreadAccess); Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, FIRST); AddToTree.Tree Holder = Dummy.RightSideAccess; Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, Last.LeftSideAccess); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, Last)) { Dummy = Dummy.LeftSideAccess; } Dummy.LeftSideAccess = Holder; Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; while ((Dummy.ThreadAccess != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, CurrentObject))) { Dummy = Dummy.ThreadAccess; } } } ABLE = false; NODE = Dummy; FIRST = Dummy; while ((IS.IsOperator(FIRST.SampleAccess)) && (FIRST.SampleAccess != "^") && (FIRST.SampleAccess != "/") && (FIRST.ThreadAccess != null)) { FIRST = FIRST.ThreadAccess; } int DeepRight = 0; while ((NODE.RightSideAccess != null) && (IS.IsOperator(NODE.SampleAccess)) && (NODE.SampleAccess != "/") && (NODE.SampleAccess != "^")) { NODE = NODE.RightSideAccess; DeepRight++; } //ERRORCORECTION9872423784 :The ERRORCUASE713040 Correction.refer to page 182. if (NODE.RightSideAccess != null) { if (NODE.RightSideAccess.RightSideAccess != null) { ABLE = false; } } if (ABLE) { if (DeepRight > 1) { AddToTree.Tree Last = NODE.CopyNewTree(NODE.ThreadAccess); Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, FIRST); AddToTree.Tree Holder = Dummy.LeftSideAccess; Dummy.SetLefTandRightCommonlySide(Last.RightSideAccess, Dummy.RightSideAccess); Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, Last)) { Dummy = Dummy.RightSideAccess; } Dummy.RightSideAccess = Holder; Dummy.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess.ThreadAccess = Dummy; while ((Dummy.ThreadAccess != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, CurrentObject))) { Dummy = Dummy.ThreadAccess; } } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } return(Dummy); }
static AddToTree.Tree SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, out bool Suitable, out bool MinuseTruePlusFalse, out bool SimplifiedTrueOtherWiseFalse) { if (Dummy == null) { Suitable = false; MinuseTruePlusFalse = false; SimplifiedTrueOtherWiseFalse = false; return(Dummy); } try { if (IS.IsMinuseOrPluse(Dummy.SampleAccess)) { if (Dummy.FINDTreeWithThreadConsideration(ToSimplified, Dummy.LeftSideAccess) == null) { if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, ToSimplified)) { try { if ((ToSimplified.ThreadAccess.SampleAccess == "+") && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; //LOCATION81726487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } } else if ((ToSimplified.ThreadAccess.SampleAccess == "-") && (Dummy.ThreadAccess.SampleAccess == "+")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = false; //LOCATION81987526487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } } else if (Dummy.FINDTreeWithThreadConsideration(ToSimplified, Dummy.RightSideAccess) == null) { if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, ToSimplified)) { try { if ((ToSimplified.ThreadAccess.SampleAccess == "+") && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; //LOCATION81726487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } } else if ((ToSimplified.ThreadAccess.SampleAccess == "-") && (Dummy.SampleAccess == "+")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = false; //LOCATION81987526487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } } } } Suitable = true; } else { Suitable = false; MinuseTruePlusFalse = false; SimplifiedTrueOtherWiseFalse = false; return(Dummy); } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } LocalSearchMinusPlusEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(Dummy.LeftSideAccess, ToSimplified, out Suitable, out MinuseTruePlusFalse, out SimplifiedTrueOtherWiseFalse); LocalSearchMinusPlusEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(Dummy.RightSideAccess, ToSimplified, out Suitable, out MinuseTruePlusFalse, out SimplifiedTrueOtherWiseFalse); return(Dummy); }
static AddToTree.Tree SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, ref bool Suitable, ref bool MinuseTruePlusFalse, ref bool SimplifiedTrueOtherWiseFalse, ref float Num) { if (Dummy == null) { return(Dummy); } try { if (IS.IsMinuseOrPluse(Dummy.SampleAccess)) { if (EqualToObject.IsEqual(Dummy.LeftSideAccess, ToSimplified)) { if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)) { Num = (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess); try { if ((ToSimplified.ThreadAccess.ThreadAccess == null) && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; //LOCATION81726487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqual(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLeftAndRightSide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqual(Dummy.LeftSideAccess, HOLDER)) { // Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy; // Dummy.LeftSideAccess = Dummy.LeftSideAccess.RightSideAccess; Dummy.LeftSideAccess.SetLeftAndRightSide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } Suitable = true; return(Dummy); } else if ((ToSimplified.ThreadAccess.ThreadAccess != null) && (Dummy.ThreadAccess.SampleAccess == "-")) { if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "+") && (Dummy.ThreadAccess.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; //LOCATION81987526487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqual(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLeftAndRightSide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqual(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLeftAndRightSide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } Suitable = true; return(Dummy); } else if ((ToSimplified.ThreadAccess.ThreadAccess != null) && (Dummy.ThreadAccess.SampleAccess == "+")) { if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "-") && (Dummy.ThreadAccess.SampleAccess == "+")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = false; //LOCATION81987526487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqual(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLeftAndRightSide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqual(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLeftAndRightSide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } Suitable = true; return(Dummy); } } } } catch (NullReferenceException t) { } } else if (EqualToObject.IsEqual(Dummy.RightSideAccess, ToSimplified)) { if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) { Dummy.RightSideAccess.SampleAccess = null; try { Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess); if ((ToSimplified.ThreadAccess.ThreadAccess == null) && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; //LOCATION81726487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqual(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLeftAndRightSide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqual(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLeftAndRightSide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } Suitable = true; return(Dummy); } else if ((ToSimplified.ThreadAccess.ThreadAccess != null) && (Dummy.SampleAccess == "-")) { if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "+") && (Dummy.SampleAccess == "-")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = true; //LOCATION81987526487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqual(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy; Dummy.RightSideAccess = Dummy.RightSideAccess.LeftSideAccess; } else if (EqualToObject.IsEqual(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLeftAndRightSide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } Suitable = true; return(Dummy); } else if ((ToSimplified.ThreadAccess.ThreadAccess != null) && (Dummy.SampleAccess == "+")) { if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "-") && (Dummy.SampleAccess == "+")) { SimplifiedTrueOtherWiseFalse = true; MinuseTruePlusFalse = false; //LOCATION81987526487 :refer to page 265. AddToTree.Tree HOLDER = Dummy.CopyTree(Dummy); Dummy = Dummy.ThreadAccess; if (EqualToObject.IsEqual(Dummy.RightSideAccess, HOLDER)) { Dummy.RightSideAccess.SetLeftAndRightSide(null, null); Dummy.RightSideAccess.SampleAccess = null; } else if (EqualToObject.IsEqual(Dummy.LeftSideAccess, HOLDER)) { Dummy.LeftSideAccess.SetLeftAndRightSide(null, null); Dummy.LeftSideAccess.SampleAccess = null; } Suitable = true; return(Dummy); } } } } catch (NullReferenceException t) { } } } } } else { return(Dummy); } } catch (NullReferenceException t) { } LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.LeftSideAccess, ToSimplified, ref Suitable, ref MinuseTruePlusFalse, ref SimplifiedTrueOtherWiseFalse, ref Num); LocalSearchMinusPlusWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.RightSideAccess, ToSimplified, ref Suitable, ref MinuseTruePlusFalse, ref SimplifiedTrueOtherWiseFalse, ref Num); return(Dummy); }
static AddToTree.Tree RepeatedlyDeletedAction(AddToTree.Tree Dummy) { if (Dummy == null) { return(Dummy); } DeleteingMinusPluseTree.RepeatedlyDeletedAction(Dummy.LeftSideAccess); DeleteingMinusPluseTree.RepeatedlyDeletedAction(Dummy.RightSideAccess); AddToTree.Tree Current = Dummy; AddToTree.Tree CurrentTow = Dummy.LeftSideAccess; if (CurrentTow != null) { while (IS.IsMinuseOrPluse(Dummy.SampleAccess)) { if (CurrentTow != null) { while (IS.IsMinuseOrPluse(CurrentTow.SampleAccess)) { if (((Dummy.SampleAccess == "+") && (CurrentTow.SampleAccess == "-")) || ((Dummy.SampleAccess == "-") && (CurrentTow.SampleAccess == "+"))) { if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, CurrentTow.RightSideAccess)) { //Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy,Dummy); String A = Dummy.SampleAccess; if (Dummy != null) { if (Dummy.ThreadAccess == null) { Dummy = Dummy.LeftSideAccess; Dummy.ThreadAccess = null; } else { Dummy.ThreadAccess.LeftSideAccess = Dummy.LeftSideAccess; Dummy.LeftSideAccess.ThreadAccess = Dummy.ThreadAccess; } } if (A == "+") { while ((!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, CurrentTow.RightSideAccess)) && (Dummy.SampleAccess != "-")) { Dummy = Dummy.LeftSideAccess; } } if (A == "-") { while ((!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, CurrentTow.RightSideAccess)) && (Dummy.SampleAccess != "+")) { Dummy = Dummy.LeftSideAccess; } } //Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, CurrentTow); if (Dummy.ThreadAccess == null) { Dummy = Dummy.LeftSideAccess; Dummy.ThreadAccess = null; } else { Dummy.ThreadAccess.LeftSideAccess = Dummy.LeftSideAccess; Dummy.LeftSideAccess.ThreadAccess = Dummy.ThreadAccess; } //if (Dummy.ThreadAccess != null) //Dummy.ThreadAccess.LeftSideAccess = Dummy.LeftSideAccess; //Dummy = AddToTree.Tree.DeleteTree(Dummy, CurrentTow); CurrentTow = Dummy.LeftSideAccess; } } CurrentTow = CurrentTow.LeftSideAccess; } } Dummy = Dummy.LeftSideAccess; CurrentTow = Dummy.LeftSideAccess; } } //Dummy= Dummy; while ((!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Current)) && (Dummy.ThreadAccess != null)) { Dummy = Dummy.ThreadAccess; } CurrentTow = Dummy.RightSideAccess; if (CurrentTow != null) { while (IS.IsMinuseOrPluse(Dummy.SampleAccess)) { if (CurrentTow != null) { while (IS.IsMinuseOrPluse(CurrentTow.SampleAccess)) { if (((Dummy.SampleAccess == "+") && (CurrentTow.SampleAccess == "-")) || ((Dummy.SampleAccess == "-") && (CurrentTow.SampleAccess == "+"))) { if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, CurrentTow.LeftSideAccess)) { //Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, Dummy); String A = Dummy.SampleAccess; if (Dummy.ThreadAccess == null) { Dummy = Dummy.RightSideAccess; Dummy.ThreadAccess = null; } else { Dummy.ThreadAccess.RightSideAccess = Dummy.RightSideAccess; Dummy.RightSideAccess.ThreadAccess = Dummy.ThreadAccess; } if (A == "+") { while ((!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, CurrentTow.LeftSideAccess)) && (Dummy.SampleAccess != "-")) { Dummy = Dummy.RightSideAccess; } } if (A == "-") { while ((!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, CurrentTow.RightSideAccess)) && (Dummy.SampleAccess != "+")) { Dummy = Dummy.RightSideAccess; } } if (Dummy.ThreadAccess == null) { Dummy = Dummy.RightSideAccess; Dummy.ThreadAccess = null; } else { Dummy.ThreadAccess.RightSideAccess = Dummy.RightSideAccess; Dummy.RightSideAccess.ThreadAccess = Dummy.ThreadAccess; } } } CurrentTow = CurrentTow.RightSideAccess; } } Dummy = Dummy.RightSideAccess; CurrentTow = Dummy.RightSideAccess; } } return(Dummy); }