Пример #1
0
 private void RemoveTransitiveEdges()
 {
     V_0 = this.GenerateNodeToIndex();
     V_1 = this.GeenrateAdjacencyMatrix(V_0);
     this.WarsawTransitiveClosure(V_1);
     V_2 = this.inferenceGraph.GetEnumerator();
     try
     {
         while (V_2.MoveNext())
         {
             V_3 = V_2.get_Current();
             V_4 = this.inferenceGraph.GetEnumerator();
             try
             {
                 while (V_4.MoveNext())
                 {
                     V_5 = V_4.get_Current();
                     V_6 = this.inferenceGraph.GetEnumerator();
                     try
                     {
                         while (V_6.MoveNext())
                         {
                             V_7  = V_6.get_Current();
                             V_8  = V_0.get_Item(V_3);
                             V_9  = V_0.get_Item(V_5);
                             V_10 = V_0.get_Item(V_7);
                             if (!V_1[V_8, V_9] || !V_1[V_9, V_10] || V_3.get_IsHardNode() && V_7.get_IsHardNode() || !V_3.get_SubTypes().Contains(V_7))
                             {
                                 continue;
                             }
                             this.RemoveSubtype(V_3, V_7);
                         }
                     }
                     finally
                     {
                         if (V_6 != null)
                         {
                             V_6.Dispose();
                         }
                     }
                 }
             }
             finally
             {
                 if (V_4 != null)
                 {
                     V_4.Dispose();
                 }
             }
         }
     }
     finally
     {
         if (V_2 != null)
         {
             V_2.Dispose();
         }
     }
     return;
 }
Пример #2
0
        private void MergeWithSingleChild()
        {
            V_0 = false;
            do
            {
                V_1 = null;
                V_2 = this.inferenceGraph.GetEnumerator();
                try
                {
                    while (V_2.MoveNext())
                    {
                        V_3 = V_2.get_Current();
                        if (V_3.get_IsHardNode() || V_3.get_CanAssignTo().get_Count() != 1 || V_3.get_SubTypes().get_Count() != 0)
                        {
                            continue;
                        }
                        V_4 = null;
                        V_5 = V_3.get_CanAssignTo().GetEnumerator();
                        try
                        {
                            if (V_5.MoveNext())
                            {
                                V_4 = V_5.get_Current();
                            }
                        }
                        finally
                        {
                            if (V_5 != null)
                            {
                                V_5.Dispose();
                            }
                        }
                        stackVariable27    = new ClassHierarchyNode[2];
                        stackVariable27[0] = V_3;
                        stackVariable27[1] = V_4;
                        V_1 = (ICollection <ClassHierarchyNode>)stackVariable27;
                        V_0 = true;
                        goto Label0;
                    }
                }
                finally
                {
                    if (V_2 != null)
                    {
                        V_2.Dispose();
                    }
                }
Label0:
                if (!V_0)
                {
                    continue;
                }
                this.MergeNodes(V_1);
            }while (V_0);
            return;
        }
Пример #3
0
        private void MergeSingleChildConstraints()
        {
            V_0 = true;
            while (V_0)
            {
                V_1 = null;
                V_0 = false;
                V_2 = this.inferenceGraph.GetEnumerator();
                try
                {
                    while (V_2.MoveNext())
                    {
                        V_3 = V_2.get_Current();
                        if (V_3.get_SubTypes().get_Count() != 1 || V_3.get_IsHardNode())
                        {
                            continue;
                        }
                        V_4                = V_3.get_SubTypes().First <ClassHierarchyNode>();
                        stackVariable21    = new ClassHierarchyNode[2];
                        stackVariable21[0] = V_3;
                        stackVariable21[1] = V_4;
                        V_1                = stackVariable21;
                        V_0                = true;
                        goto Label0;
                    }
                }
                finally
                {
                    if (V_2 != null)
                    {
                        V_2.Dispose();
                    }
                }
Label0:
                if (!V_0)
                {
                    continue;
                }
                this.MergeNodes(V_1);
            }
            return;
        }
Пример #4
0
        private bool MergeSingleParent(Func <ClassHierarchyNode, bool> chooseParentPred)
        {
            V_0 = false;
            V_1 = null;
            V_2 = this.inferenceGraph.GetEnumerator();
            try
            {
                while (V_2.MoveNext())
                {
                    V_3 = V_2.get_Current();
                    if (V_3.get_IsHardNode() || V_3.get_SubTypes().get_Count() != 1)
                    {
                        continue;
                    }
                    V_4 = V_3.get_SubTypes().First <ClassHierarchyNode>();
                    if (!chooseParentPred.Invoke(V_4))
                    {
                        continue;
                    }
                    V_0                = true;
                    stackVariable23    = new ClassHierarchyNode[2];
                    stackVariable23[0] = V_3;
                    stackVariable23[1] = V_4;
                    V_1                = stackVariable23;
                    goto Label0;
                }
            }
            finally
            {
                if (V_2 != null)
                {
                    V_2.Dispose();
                }
            }
Label0:
            if (V_0)
            {
                this.MergeNodes(V_1);
            }
            return(V_0);
        }
Пример #5
0
        private void ReplaceMultipleParentDependencies()
        {
            V_0 = false;
            do
            {
                V_0 = false;
                V_1 = null;
                V_2 = this.inferenceGraph.GetEnumerator();
                try
                {
                    while (V_2.MoveNext())
                    {
                        V_3 = V_2.get_Current();
                        V_4 = true;
                        if (V_3.get_IsHardNode())
                        {
                            continue;
                        }
                        V_6 = V_3.get_SubTypes().GetEnumerator();
                        try
                        {
                            while (V_6.MoveNext())
                            {
                                if (V_6.get_Current().get_IsHardNode())
                                {
                                    continue;
                                }
                                V_4 = false;
                                goto Label1;
                            }
                        }
                        finally
                        {
                            if (V_6 != null)
                            {
                                V_6.Dispose();
                            }
                        }
Label1:
                        if (!V_4 || V_3.get_SubTypes().get_Count() == 0)
                        {
                            continue;
                        }
                        V_0                = true;
                        V_5                = this.FindLowestCommonAncestor(V_3.get_SubTypes());
                        stackVariable32    = new ClassHierarchyNode[2];
                        stackVariable32[0] = V_3;
                        stackVariable32[1] = V_5;
                        V_1                = (ICollection <ClassHierarchyNode>)stackVariable32;
                        goto Label0;
                    }
                }
                finally
                {
                    if (V_2 != null)
                    {
                        V_2.Dispose();
                    }
                }
Label0:
                if (!V_0)
                {
                    continue;
                }
                this.MergeNodes(V_1);
            }while (V_0);
            return;
        }
Пример #6
0
        private bool MergeWithLowestCommonAncestor()
        {
            V_0 = false;
            V_1 = null;
            V_2 = this.inferenceGraph.GetEnumerator();
            try
            {
                while (V_2.MoveNext())
                {
                    V_3 = V_2.get_Current();
                    if (V_3.get_IsHardNode())
                    {
                        continue;
                    }
                    V_0 = true;
                    V_4 = new HashSet <ClassHierarchyNode>();
                    V_5 = V_3.get_SubTypes().GetEnumerator();
                    try
                    {
                        while (V_5.MoveNext())
                        {
                            V_6 = V_5.get_Current();
                            if (V_6.get_IsClassNode())
                            {
                                dummyVar0 = V_4.Add(V_6);
                            }
                            else
                            {
                                V_0 = false;
                                goto Label1;
                            }
                        }
                    }
                    finally
                    {
                        if (V_5 != null)
                        {
                            V_5.Dispose();
                        }
                    }
Label1:
                    if (!V_0)
                    {
                        continue;
                    }
                    V_7 = this.FindLowestCommonAncestor(V_4);
                    if (V_7 == null || V_7 == V_3)
                    {
                        V_0 = false;
                    }
                    else
                    {
                        stackVariable35    = new ClassHierarchyNode[2];
                        stackVariable35[0] = V_7;
                        stackVariable35[1] = V_3;
                        V_1 = stackVariable35;
                        goto Label0;
                    }
                }
            }
            finally
            {
                if (V_2 != null)
                {
                    V_2.Dispose();
                }
            }
Label0:
            if (V_0)
            {
                this.MergeNodes(V_1);
            }
            return(V_0);
        }