Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
        static AddToTree.Tree MulDivisionSorterFxAction(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS, ref bool CONTINUE)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            AddToTree.Tree Holder = Dummy;
            Dummy.LeftSideAccess = MulDivisionSorter.MulDivisionSorterFxAction(Dummy.LeftSideAccess, ref UIS, ref CONTINUE);
            try
            {
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.LeftSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.LeftSideAccess;
                }
                else
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.RightSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.RightSideAccess;
                }
            }
            catch (NullReferenceException t)
            { ExceptionClass.ExceptionClassMethod(t); }
            Dummy.RightSideAccess = MulDivisionSorter.MulDivisionSorterFxAction(Dummy.RightSideAccess, ref UIS, ref CONTINUE);
            try
            {
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.LeftSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.LeftSideAccess;
                }
                else
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.RightSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.RightSideAccess;
                }
            }
            catch (NullReferenceException t)
            { ExceptionClass.ExceptionClassMethod(t); }
            int INCREASE = 2147483647 / 12;

            UIS.SetProgressValue(UIS.progressBar13, 0);

            AddToTree.Tree Current = new AddToTree.Tree(null, false);

            bool BREAK = false;

            UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);
            while ((Dummy != null) && (Dummy.RightSideAccess != null))
            {
                AddToTree.Tree HolderCurrent = Dummy;
                if (MULATED.FINDTreeWithThreadConsideration(Dummy))
                {
                    break;
                }
                if (IS.IsFunction(Dummy.SampleAccess))
                {
                    break;
                }
                Current = Dummy.RightSideAccess;
                if (!IS.IsDiv(Current.SampleAccess))
                {
                    break;
                }
                if (IS.IsOperator(Dummy.SampleAccess) && (!((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "/"))))
                {
                    BREAK = true;
                }

                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                if (!BREAK)
                {
                    while ((Current != null) && (Current.RightSideAccess != null))
                    {
                        if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Current))
                        {
                            break;
                        }
                        if (IS.IsFunction(Current.SampleAccess))
                        {
                            break;
                        }
                        //ERRORCORECTION1982748234 :Refer to page 249.
                        if (!((Dummy.SampleAccess == "*") && (Current.SampleAccess == "/")))
                        {
                            break;
                        }
                        if (MULATED.FINDTreeWithThreadConsideration(Current))
                        {
                            break;
                        }
                        if (MULATED.FINDTreeWithThreadConsideration(Dummy))
                        {
                            break;
                        }
                        if (IS.IsOperator(Dummy.SampleAccess) && (!((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "/"))))
                        {
                            BREAK = true;//LOCATION98174723742 :Rfer to page 249.
                        }
                        //ERROR1892386124 :The Same node of Current and Dummy node.refer to page 238.
                        if (!BREAK)//ERRORCORECTION897123 :The ERROR31704152 corrected.
                        {
                            if ((Current.SampleAccess == "/") && (Dummy.SampleAccess == "*"))
                            {
                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                if (Dummy.FINDTreeWithThreadConsideration(Current, Dummy) != null)
                                {
                                    break;
                                }
                                CONTINUE = true;
                                AddToTree.Tree LOCAL = Dummy;
                                //ERROR1928749712 :The *** Mraked edited.refer to page 256.
                                AddToTree.Tree MUL = new AddToTree.Tree("*", false);
                                MUL.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess), Current.CopyNewTree(Current.LeftSideAccess));

                                MUL.ThreadAccess = null;

                                MUL.LeftSideAccess.ThreadAccess  = MUL;
                                MUL.RightSideAccess.ThreadAccess = MUL;

                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                AddToTree.Tree Contained = Dummy;

                                while (!(EqualToObject.IsEqualWithThreadConsiderationCommonly(Current, Dummy)))
                                {
                                    Dummy = Dummy.RightSideAccess;
                                }
                                //====

                                //LOCATION30415071.refer to page 256.
                                //ERRORCORECTION9318279 :The invalid leftside assignment.refer to page 218.
                                Dummy = Dummy.ThreadAccess;
                                //ERROR92834876 :The Division node is located at left side of Mul and in othere is located at right side.refer to page 336.

                                /*Dummy.RightSideAccess.LeftSideAccess = MUL;
                                 * Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess;
                                 * Dummy.RightSideAccess.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 * Dummy.RightSideAccess.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 */
                                //ERRORCORECTION19208734 :The Above Error.(ERROR92834876)refer to page 336.
                                Dummy.RightSideAccess.LeftSideAccess = MUL;
                                Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess;
                                Dummy.RightSideAccess.LeftSideAccess.LeftSideAccess.ThreadAccess  = Dummy.RightSideAccess.LeftSideAccess;
                                Dummy.RightSideAccess.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;

                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);



                                //while ((Dummy.ThreadAccess != null) && (!(EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy,LOCAL))))
                                //  Dummy = Dummy.ThreadAccess;

                                //LOCATION30415071.refer to page 256.
                                //ERRORCORECTION9318279 :The invalid leftside assignment.refer to page 218.
                                if (Dummy.ThreadAccess != null)
                                {
                                    //Dummy = Dummy.ThreadAccess;
                                    //Dummy.RightSideAccess = Dummy.LeftSideAccess.LeftSideAccess;
                                    //ERRORCUASED817263 :Refer to page 244.
                                    //Dummy.ThreadAccess = A;
                                    //Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                    Dummy.RightSideAccess.ThreadAccess = Dummy.ThreadAccess;
                                    Dummy = Dummy.RightSideAccess;
                                }
                                else
                                {
                                    Dummy = Dummy.RightSideAccess;
                                    Dummy.ThreadAccess = null;
                                }
                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                MULATED.ADDToTree(Dummy);
                                MULATED.ADDToTree(Current);
                                //Holder = Dummy;
                                //        while ((Dummy != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy,LOCAL)))
                                //          Dummy = Dummy.RightSideAccess;
                                break;
                            }
                        }
                        Current = Current.RightSideAccess;
                    }
                }
                if (BREAK)
                {
                    break;
                }
                if (!CONTINUE)
                {
                    if (Dummy.RightSideAccess != null)
                    {
                        Dummy = Dummy.RightSideAccess;
                    }
                }
                else
                {
                    break;
                }
                //               if (Dummy.RightSideAccess != null)
                //             Current = Dummy.RightSideAccess;
            }

            UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

            //while ((Dummy.ThreadAccess != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Holder)))
            //       Dummy = Dummy.ThreadAccess;


            Current = Dummy.LeftSideAccess;

            while ((Dummy != null) && (Dummy.LeftSideAccess != null))
            {
                if (MULATED.FINDTreeWithThreadConsideration(Dummy))
                {
                    break;
                }
                if (IS.IsFunction(Dummy.SampleAccess))
                {
                    break;
                }
                Current = Dummy.LeftSideAccess;
                if (!IS.IsDiv(Current.SampleAccess))
                {
                    break;
                }
                AddToTree.Tree HolderCurrent = Dummy;
                if (IS.IsOperator(Dummy.SampleAccess) && (!((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "/"))))
                {
                    BREAK = true;
                }
                if (!BREAK)
                {
                    while ((Current != null) && (Current.LeftSideAccess != null))
                    {
                        if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Current))
                        {
                            break;
                        }
                        if (MULATED.FINDTreeWithThreadConsideration(Current))
                        {
                            break;
                        }
                        //ERRORCORECTINO1782647 :On four Section of while added thwe non function condition.refre to page 226.
                        if (IS.IsFunction(Current.SampleAccess))
                        {
                            break;
                        }
                        if (MULATED.FINDTreeWithThreadConsideration(Dummy))
                        {
                            break;
                        }
                        if (IS.IsOperator(Dummy.SampleAccess) && (!((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "/"))))
                        {
                            BREAK = true;
                        }
                        //ERRORCORECTION1982748234 :Refer to page 249.
                        if (!((Dummy.SampleAccess == "*") && (Current.SampleAccess == "/")))
                        {
                            break;  //LOCATION98174723741 :Refer to page 249
                        }
                        if (!BREAK) //ERRORCORECTION897123 :The ERROR31704152 corrected.
                        {
                            if ((Current.SampleAccess == "/") && (Dummy.SampleAccess == "*"))
                            {
                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                if (Dummy.FINDTreeWithThreadConsideration(Current, Dummy) != null)
                                {
                                    break;
                                }
                                CONTINUE = true;
                                AddToTree.Tree LOCAL = Dummy;
                                AddToTree.Tree MUL   = new AddToTree.Tree("*", false);
                                MUL.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess), Current.CopyNewTree(Current.LeftSideAccess));

                                MUL.ThreadAccess = null;

                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                MUL.LeftSideAccess.ThreadAccess  = MUL;
                                MUL.RightSideAccess.ThreadAccess = MUL;

                                AddToTree.Tree Contained = Dummy;

                                while (!(EqualToObject.IsEqualWithThreadConsiderationCommonly(Current, Dummy)))
                                {
                                    Dummy = Dummy.LeftSideAccess;
                                }
                                //ERRRORCORECTION1297192 :Replacement mul on non-proper location.reer to page 218.

                                //Dummy = Dummy.LeftSideAccess;

                                //                        Dummy.LeftSideAccess = MUL;
                                //                      Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                //                    Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.LeftSideAccess;
                                //                  Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess;
                                Dummy = Dummy.ThreadAccess;
                                //ERROR92834876 :The Division node is located at left side of Mul and in othere is located at right side.refer to page 336.

                                /*Dummy.RightSideAccess.LeftSideAccess = MUL;
                                 * Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess;
                                 * Dummy.RightSideAccess.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 * Dummy.RightSideAccess.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 */
                                //ERRORCORECTION19208734 :The Above Error.(ERROR92834876)refer to page 336.
                                Dummy.LeftSideAccess.LeftSideAccess = MUL;
                                Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess;
                                Dummy.LeftSideAccess.LeftSideAccess.LeftSideAccess.ThreadAccess  = Dummy.LeftSideAccess.LeftSideAccess;
                                Dummy.LeftSideAccess.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess.LeftSideAccess;

                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);



                                //while ((Dummy.ThreadAccess != null) && (!(EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy,LOCAL))))
                                //  Dummy = Dummy.ThreadAccess;

                                //LOCATION30415071.refer to page 256.
                                //ERRORCORECTION9318279 :The invalid leftside assignment.refer to page 218.
                                if (Dummy.ThreadAccess != null)
                                {
                                    //Dummy = Dummy.ThreadAccess;
                                    //Dummy.RightSideAccess = Dummy.LeftSideAccess.LeftSideAccess;
                                    //ERRORCUASED817263 :Refer to page 244.
                                    //Dummy.ThreadAccess = A;
                                    //Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                    Dummy.LeftSideAccess.ThreadAccess = Dummy.ThreadAccess;
                                    Dummy = Dummy.LeftSideAccess;
                                }
                                else
                                {
                                    Dummy = Dummy.LeftSideAccess;
                                    Dummy.ThreadAccess = null;
                                }
                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                MULATED.ADDToTree(Dummy);
                                MULATED.ADDToTree(Current);
                                //Holder = Dummy;
                                //while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy,Contained))
                                //  Dummy = Dummy.ThreadAccess;
                                break;
                            }
                        }
                        Current = Current.LeftSideAccess;
                    }
                }
                if (BREAK)
                {
                    break;
                }
                if (!CONTINUE)
                {
                    if (Dummy.LeftSideAccess != null)
                    {
                        Dummy = Dummy.LeftSideAccess;
                    }
                }
                else
                {
                    break;
                }
                //
                //if (Dummy.LeftSideAccess != null)
                //  Current = Dummy.LeftSideAccess;
            }
            //while ((Dummy.ThreadAccess != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Holder)))
            //  Dummy = Dummy.ThreadAccess;
            //ERROCORECTION198274896 :The Thread become null and the extra mulated nodes dose not removed.refer to page 336.
            try
            {
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.LeftSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.LeftSideAccess;
                }
                else
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.RightSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.RightSideAccess;
                }
            }
            catch (NullReferenceException t)
            { ExceptionClass.ExceptionClassMethod(t); }
            UIS.SetProgressValue(UIS.progressBar13, 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);
        }
Esempio n. 5
0
        static AddToTree.Tree RepeatedlyDeletedAction(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            DeletingMultaplification.RepeatedlyDeletedAction(Dummy.LeftSideAccess, ref UIS);
            DeletingMultaplification.RepeatedlyDeletedAction(Dummy.RightSideAccess, ref UIS);
            AddToTree.Tree Current    = Dummy;
            AddToTree.Tree CurrentTow = Dummy.LeftSideAccess;
            //int INCREASE = 2147483647 / 9;

            try
            {
                UIS.SetProgressValue(UIS.progressBar14, 0);
                if (CurrentTow != null)
                {
                    if (Dummy != null)
                    {
                        while ((IS.IsMul(Dummy.SampleAccess)))
                        {
                            if (!DELETED.FINDTreeWithThreadConsideration(Dummy))
                            {
                                if (!EqualToObject.IsEqualWithThreadConsiderationCommonly(CurrentTow, Dummy))
                                {
                                    if (CurrentTow != null)
                                    {
                                        while ((IS.IsMul(CurrentTow.SampleAccess)) && (CurrentTow != null))
                                        {
                                            if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess))
                                            {
                                                if (IS.IsNumber(CurrentTow.LeftSideAccess.SampleAccess))
                                                {
                                                    ///bool LeftTrueRightFalse = false;
                                                    ///if (EqualToObject.IsEqualWithThreadConsiderationCommonly(CurrentTow.ThreadAccess.LeftSideAccess, CurrentTow))
                                                    ///LeftTrueRightFalse = true;
                                                    ///else
                                                    //if (EqualToObject.IsEqualWithThreadConsiderationCommonly(CurrentTow.ThreadAccess.RightSideAccess, CurrentTow))
                                                    //  LeftTrueRightFalse = false;
                                                    AddToTree.Tree HOLDE           = Dummy;
                                                    AddToTree.Tree DummyCurrentTow = Dummy.LeftSideAccess;
                                                    Dummy.SetLefTandRightCommonlySide(CurrentTow.RightSideAccess, Dummy.RightSideAccess);
                                                    Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                    while (Dummy.ThreadAccess != null)
                                                    {
                                                        Dummy = Dummy.ThreadAccess;
                                                    }
                                                    Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, CurrentTow);
                                                    Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, DummyCurrentTow);
                                                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                                                    while (Dummy.ThreadAccess != null)
                                                    {
                                                        Dummy = Dummy.ThreadAccess;
                                                    }
                                                    Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDE);
                                                    DELETED.ADDToTree(Dummy);
                                                }
                                            }



                                            if (IS.ISindependenceVaribale(Dummy.LeftSideAccess.SampleAccess))
                                            {
                                                if (IS.IsNumber(CurrentTow.LeftSideAccess.SampleAccess))
                                                {
                                                    if ((IS.IsPower(CurrentTow.RightSideAccess.SampleAccess)) || (IS.ISindependenceVaribale(CurrentTow.RightSideAccess.SampleAccess)))
                                                    {
                                                        if ((IS.ISindependenceVaribale(CurrentTow.RightSideAccess.LeftSideAccess.SampleAccess)) || (IS.IsNumber(CurrentTow.RightSideAccess.RightSideAccess.SampleAccess)))
                                                        {
                                                            AddToTree.Tree HOLDE           = Dummy;
                                                            AddToTree.Tree DummyCurrentTow = Dummy.LeftSideAccess;
                                                            Dummy.SetLefTandRightCommonlySide(CurrentTow.LeftSideAccess, Dummy.RightSideAccess);
                                                            Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                            while (Dummy.ThreadAccess != null)
                                                            {
                                                                Dummy = Dummy.ThreadAccess;
                                                            }
                                                            Dummy = CurrentTow;
                                                            Dummy.SetLefTandRightCommonlySide(DummyCurrentTow, Dummy.RightSideAccess);
                                                            Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                            while (Dummy.ThreadAccess != null)
                                                            {
                                                                Dummy = Dummy.ThreadAccess;
                                                            }
                                                            while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, HOLDE))
                                                            {
                                                                Dummy = Dummy.LeftSideAccess;
                                                            }
                                                            DELETED.ADDToTree(Dummy);
                                                        }
                                                    }
                                                }
                                            }

                                            if (IS.ISindependenceVaribale(CurrentTow.RightSideAccess.SampleAccess))
                                            {
                                                if (IS.IsNumber(CurrentTow.LeftSideAccess.SampleAccess))
                                                {
                                                    if ((IS.IsPower(Dummy.LeftSideAccess.SampleAccess)) || (IS.ISindependenceVaribale(CurrentTow.RightSideAccess.SampleAccess)))
                                                    {
                                                        if ((IS.ISindependenceVaribale(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) || (IS.IsNumber(CurrentTow.RightSideAccess.RightSideAccess.SampleAccess)))
                                                        {
                                                            AddToTree.Tree HOLDE           = Dummy;
                                                            AddToTree.Tree DummyCurrentTow = Dummy.LeftSideAccess;
                                                            Dummy.SetLefTandRightCommonlySide(CurrentTow.LeftSideAccess, Dummy.RightSideAccess);
                                                            Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                            while (Dummy.ThreadAccess != null)
                                                            {
                                                                Dummy = Dummy.ThreadAccess;
                                                            }
                                                            Dummy = CurrentTow;
                                                            Dummy.SetLefTandRightCommonlySide(DummyCurrentTow, Dummy.RightSideAccess);
                                                            Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                            while (Dummy.ThreadAccess != null)
                                                            {
                                                                Dummy = Dummy.ThreadAccess;
                                                            }
                                                            while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, HOLDE))
                                                            {
                                                                Dummy = Dummy.LeftSideAccess;
                                                            }
                                                            DELETED.ADDToTree(Dummy);
                                                        }
                                                    }
                                                }
                                            }


                                            CurrentTow = CurrentTow.LeftSideAccess;
                                        }
                                    }
                                }
                            }
                            if (Dummy.LeftSideAccess == null)
                            {
                                break;
                            }
                            Dummy      = Dummy.LeftSideAccess;
                            CurrentTow = Dummy.LeftSideAccess;
                        }
                    }
                }
                //Dummy= Dummy;
                while ((!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Current)) && (Dummy.ThreadAccess != null))
                {
                    Dummy = Dummy.ThreadAccess;
                }
                CurrentTow = Dummy.RightSideAccess;

                UIS.SetProgressValue(UIS.progressBar14, 2147483647 / 2);

                if (CurrentTow != null)
                {
                    while (IS.IsMul(Dummy.SampleAccess))
                    {
                        if (CurrentTow != null)
                        {
                            while (IS.IsMul(CurrentTow.SampleAccess) && (CurrentTow != null))
                            {
                                if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess))
                                {
                                    if (IS.IsNumber(CurrentTow.LeftSideAccess.SampleAccess))
                                    {
                                        ///bool LeftTrueRightFalse = false;
                                        ///if (EqualToObject.IsEqualWithThreadConsiderationCommonly(CurrentTow.ThreadAccess.LeftSideAccess, CurrentTow))
                                        ///LeftTrueRightFalse = true;
                                        ///else
                                        //if (EqualToObject.IsEqualWithThreadConsiderationCommonly(CurrentTow.ThreadAccess.RightSideAccess, CurrentTow))
                                        //  LeftTrueRightFalse = false;
                                        AddToTree.Tree HOLDE           = Dummy;
                                        AddToTree.Tree DummyCurrentTow = Dummy.LeftSideAccess;
                                        Dummy.SetLefTandRightCommonlySide(CurrentTow.RightSideAccess, Dummy.RightSideAccess);
                                        Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                        while (Dummy.ThreadAccess != null)
                                        {
                                            Dummy = Dummy.ThreadAccess;
                                        }
                                        Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, CurrentTow);
                                        Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, DummyCurrentTow);
                                        Dummy.RightSideAccess.ThreadAccess = Dummy;
                                        while (Dummy.ThreadAccess != null)
                                        {
                                            Dummy = Dummy.ThreadAccess;
                                        }
                                        Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDE);
                                        DELETED.ADDToTree(Dummy);
                                    }
                                }


                                if (IS.ISindependenceVaribale(Dummy.LeftSideAccess.SampleAccess))
                                {
                                    if (IS.IsNumber(CurrentTow.LeftSideAccess.SampleAccess))
                                    {
                                        if ((IS.IsPower(CurrentTow.RightSideAccess.SampleAccess)) || (IS.ISindependenceVaribale(CurrentTow.RightSideAccess.SampleAccess)))
                                        {
                                            if ((IS.ISindependenceVaribale(CurrentTow.RightSideAccess.LeftSideAccess.SampleAccess)) || (IS.IsNumber(CurrentTow.RightSideAccess.RightSideAccess.SampleAccess)))
                                            {
                                                ///bool LeftTrueRightFalse = false;
                                                ///if (EqualToObject.IsEqualWithThreadConsiderationCommonly(CurrentTow.ThreadAccess.LeftSideAccess, CurrentTow))
                                                ///LeftTrueRightFalse = true;
                                                ///else
                                                //if (EqualToObject.IsEqualWithThreadConsiderationCommonly(CurrentTow.ThreadAccess.RightSideAccess, CurrentTow))
                                                //  LeftTrueRightFalse = false;
                                                AddToTree.Tree HOLDE           = Dummy;
                                                AddToTree.Tree DummyCurrentTow = Dummy.LeftSideAccess;
                                                Dummy.SetLefTandRightCommonlySide(CurrentTow.LeftSideAccess, Dummy.RightSideAccess);
                                                Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                while (Dummy.ThreadAccess != null)
                                                {
                                                    Dummy = Dummy.ThreadAccess;
                                                }
                                                //Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, CurrentTow);
                                                Dummy = CurrentTow;
                                                Dummy.SetLefTandRightCommonlySide(DummyCurrentTow, Dummy.RightSideAccess);
                                                Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                while (Dummy.ThreadAccess != null)
                                                {
                                                    Dummy = Dummy.ThreadAccess;
                                                }
                                                //Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDE);
                                                while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, HOLDE))
                                                {
                                                    Dummy = Dummy.RightSideAccess;
                                                }
                                                DELETED.ADDToTree(Dummy);
                                            }
                                        }
                                    }
                                }


                                if (IS.ISindependenceVaribale(CurrentTow.RightSideAccess.SampleAccess))
                                {
                                    if (IS.IsNumber(CurrentTow.LeftSideAccess.SampleAccess))
                                    {
                                        if ((IS.IsPower(Dummy.LeftSideAccess.SampleAccess)) || (IS.ISindependenceVaribale(CurrentTow.RightSideAccess.SampleAccess)))
                                        {
                                            if ((IS.ISindependenceVaribale(Dummy.LeftSideAccess.LeftSideAccess.SampleAccess)) || (IS.IsNumber(CurrentTow.RightSideAccess.RightSideAccess.SampleAccess)))
                                            {
                                                AddToTree.Tree HOLDE           = Dummy;
                                                AddToTree.Tree DummyCurrentTow = Dummy.LeftSideAccess;
                                                Dummy.SetLefTandRightCommonlySide(CurrentTow.LeftSideAccess, Dummy.RightSideAccess);
                                                Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                while (Dummy.ThreadAccess != null)
                                                {
                                                    Dummy = Dummy.ThreadAccess;
                                                }
                                                Dummy = CurrentTow;
                                                Dummy.SetLefTandRightCommonlySide(DummyCurrentTow, Dummy.RightSideAccess);
                                                Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                                while (Dummy.ThreadAccess != null)
                                                {
                                                    Dummy = Dummy.ThreadAccess;
                                                }
                                                while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, HOLDE))
                                                {
                                                    Dummy = Dummy.LeftSideAccess;
                                                }
                                                DELETED.ADDToTree(Dummy);
                                            }
                                        }
                                    }
                                }


                                CurrentTow = CurrentTow.RightSideAccess;
                            }
                        }
                        if (Dummy.RightSideAccess == null)
                        {
                            break;
                        }
                        Dummy      = Dummy.RightSideAccess;
                        CurrentTow = Dummy.RightSideAccess;
                    }
                }
                while ((!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Current)) && (Dummy.ThreadAccess != null))
                {
                    Dummy = Dummy.ThreadAccess;
                }
            }
            catch (NullReferenceException t)
            {
                ExceptionClass.ExceptionClassMethod(t);
            }
            UIS.SetProgressValue(UIS.progressBar14, 2147483647);
            return(Dummy);
        }