示例#1
0
        /// <summary>
        /// Executes the last cut in a loop
        /// </summary>
        /// <param name="LoopStart">Loop start node</param>
        /// <param name="currentNode">Analysed node</param>
        /// <returns>true if cut was made</returns>
        private bool executeLastCutInLoop(InductiveMinerGraphNode LoopStart, InductiveMinerGraphNode currentNode)
        {
            if (currentNode.FollowerList.Count > 0)
            {
                if (currentNode.GetMyDirectNodes().Contains(LoopStart))
                {
                    var query = from search in currentNode.FollowerList
                                where search.ToNode == LoopStart
                                select search;

                    InductiveMinerRow deleteRow = query.FirstOrDefault();
                    currentNode.FollowerList.Remove(deleteRow);

                    return(true);
                }
                else
                {
                    foreach (InductiveMinerRow row in currentNode.FollowerList)
                    {
                        if (executeLastCutInLoop(LoopStart, row.ToNode))
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
        /// <summary>
        /// Executes the last cut in a loop
        /// </summary>
        /// <param name="LoopStart">Loop start node</param>
        /// <param name="currentNode">Analysed node</param>
        /// <returns>true if cut was made</returns>
        private bool executeLastCutInLoop(InductiveMinerGraphNode LoopStart, InductiveMinerGraphNode currentNode)
        {
            if (currentNode.FollowerList.Count > 0)
            {
                if (currentNode.GetMyDirectNodes().Contains(LoopStart))
                {
                    var query = from search in currentNode.FollowerList
                                where search.ToNode == LoopStart
                                select search;

                    InductiveMinerRow deleteRow = query.FirstOrDefault();
                    currentNode.FollowerList.Remove(deleteRow);

                    return true;
                }
                else
                {
                    foreach (InductiveMinerRow row in currentNode.FollowerList)
                    {
                        if (executeLastCutInLoop(LoopStart, row.ToNode))
                        {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
示例#3
0
        /// <summary>
        /// Recursive procedure to identify sequence cuts
        /// </summary>
        /// <param name="graphNode">Analyzed node</param>
        /// <author>Krystian Zielonka, Bernd Nottbeck</author>
        private bool CheckXorCut(InductiveMinerGraphNode graphNode)
        {
            List <InductiveMinerGraphNode> followerList = graphNode.GetMyDirectNodes();
            List <InductiveMinerRow>       deleteList   = new List <InductiveMinerRow>();

            bool bo       = false;
            bool foundone = false;
            bool goOn     = true;

            if (graphNode.FollowerList.Count > 1)
            {
                List <InductiveMinerRow> .Enumerator e = graphNode.FollowerList.GetEnumerator();
                e.MoveNext();

                do
                {
                    if (!e.Current.ToNode.FollowerContains(followerList))
                    {
                        if (foundone)
                        {
                            goOn = false;
                            deleteList.Add(e.Current);
                        }
                        foundone = true;
                    }

                    if (goOn)
                    {
                        goOn = e.MoveNext();
                    }
                } while (goOn);
                e.Dispose();

                foreach (InductiveMinerRow deleteRow in deleteList)
                {
                    newStart.AddDirectFollower(deleteRow.ToNode);

                    foreach (InductiveMinerRow row in deleteRow.ToNode.EventualFollowerList)
                    {
                        if (!newStart.GetMyEventualNodes().Contains(row.ToNode))
                        {
                            newStart.EventualFollowerList.Add(new InductiveMinerRow(newStart, row.ToNode));
                        }
                    }

                    graphNode.WasCut = true;
                    graphNode.DeleteFollower(deleteRow);


                    bo = true;
                }

                if (bo)
                {
                    newStart.ReBuildeEventualFollower(null);
                    newStart.CleanUpHelperList(null);


                    graphNode.ReBuildeEventualFollower(null);
                    graphNode.CleanUpHelperList(null);
                }
                return(bo);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// Recursive procedure to identify sequence cuts 
        /// </summary>
        /// <param name="graphNode">Analyzed node</param>
        /// <author>Krystian Zielonka, Bernd Nottbeck</author>
        private bool CheckXorCut(InductiveMinerGraphNode graphNode)
        {
            List<InductiveMinerGraphNode> followerList = graphNode.GetMyDirectNodes();
            List<InductiveMinerRow> deleteList = new List<InductiveMinerRow>();

            bool bo = false;
            bool foundone = false;
            bool goOn = true;
            if (graphNode.FollowerList.Count > 1)
            {
                List<InductiveMinerRow>.Enumerator e = graphNode.FollowerList.GetEnumerator();
                e.MoveNext();

                do
                {
                    if (!e.Current.ToNode.FollowerContains(followerList))
                    {
                        if (foundone)
                        {
                            goOn = false;
                            deleteList.Add(e.Current);
                        }
                        foundone = true;
                    }

                    if (goOn)
                    {
                        goOn = e.MoveNext();
                    }

                } while (goOn);
                e.Dispose();

                foreach (InductiveMinerRow deleteRow in deleteList)
                {
                    newStart.AddDirectFollower(deleteRow.ToNode);

                    foreach (InductiveMinerRow row in deleteRow.ToNode.EventualFollowerList)
                    {
                        if (!newStart.GetMyEventualNodes().Contains(row.ToNode))
                            newStart.EventualFollowerList.Add(new InductiveMinerRow(newStart, row.ToNode));

                    }

                    graphNode.WasCut = true;
                    graphNode.DeleteFollower(deleteRow);

                    bo = true;
                }

                if (bo)
                {
                    newStart.ReBuildeEventualFollower(null);
                    newStart.CleanUpHelperList(null);

                    graphNode.ReBuildeEventualFollower(null);
                    graphNode.CleanUpHelperList(null);
                }
                return bo;
            }
            else return false;
        }