Пример #1
0
        public override HashSet <string> GetAlphabets(Dictionary <string, string> visitedDefinitionRefs)
        {
            if (FirstProcess is Skip || (FirstProcess is AtomicProcess && (FirstProcess as AtomicProcess).Process is Skip))
            {
                return(SecondProcess.GetAlphabets(visitedDefinitionRefs));
            }

            HashSet <string> list = SecondProcess.GetAlphabets(visitedDefinitionRefs);

            list.UnionWith(FirstProcess.GetAlphabets(visitedDefinitionRefs));
            return(list);
        }
Пример #2
0
        public override HashSet <string> GetAlphabets(Dictionary <string, string> visitedDefinitionRefs)
        {
            if (Specification.CollectDataOperationEvent == true && Event.ToString() != Constants.TAU)
            {
                HashSet <string> set = Process.GetAlphabets(visitedDefinitionRefs);
                set.Add(Event.BaseName);

                return(set);
            }
            else
            {
                return(Process.GetAlphabets(visitedDefinitionRefs));
            }
        }
        public override HashSet <string> GetAlphabets(Dictionary <string, string> visitedDefinitionRefs)
        {
            HashSet <string> list = SecondProcess.GetAlphabets(visitedDefinitionRefs);

            list.UnionWith(FirstProcess.GetAlphabets(visitedDefinitionRefs));
            return(list);
        }
Пример #4
0
        /// <summary>
        /// To Perform the static analysis on a single definition first.
        /// </summary>
        public void StaticAnalysis()
        {
            MustAbstract = Process.MustBeAbstracted();

            Channels = Process.GetChannels();

            GlobalVars = Process.GetGlobalVariables();

            if (AlphabetEvents != null)
            {
                if (AlphabetEvents.ContainsVariable())
                {
                    AlphabetsCalculable = false;
                    Alphabets           = null;
                }
                else
                {
                    Alphabets           = new HashSet <string>(new EventCollection(AlphabetEvents).EventNames);
                    AlphabetsCalculable = true;
                }
            }
            else
            {
                if (AlphabetsCalculable)
                {
                    //to check why is null here? forget the reason le.
                    Alphabets = Process.GetAlphabets(null);
                }
            }
        }
Пример #5
0
        public override HashSet <string> GetAlphabets(Dictionary <string, string> visitedDefinitionRefs)
        {
            HashSet <string> returnlist = Process.GetAlphabets(visitedDefinitionRefs);

            foreach (string alphabet in HidingAlphabets.EventNames)
            {
                returnlist.Remove(alphabet);
            }

            return(returnlist);
        }
Пример #6
0
        public override HashSet <string> GetAlphabets(Dictionary <string, string> visitedDefinitionRefs)
        {
            HashSet <string> toReturn = new HashSet <string>();

            for (int i = 0; i < Processes.Length; i++)
            {
                Process process = Processes[i];
                toReturn.UnionWith(process.GetAlphabets(visitedDefinitionRefs));
            }

            return(toReturn);
        }
Пример #7
0
        public override HashSet <string> GetAlphabets(Dictionary <string, string> visitedDefinitionRefs)
        {
            HashSet <string> list = Process.GetAlphabets(visitedDefinitionRefs);

            if (Specification.CollectDataOperationEvent == null)
            {
                if (Event.ExpressionList != null)
                {
                    foreach (Expression expression in Event.ExpressionList)
                    {
                        if (expression.HasVar)
                        {
                            StringBuilder sb = new StringBuilder();
                            sb.AppendLine("ERROR - PAT FAILED to calculate the alphabet.");
                            sb.AppendLine("CAUSE - Event " + Event + " contains global variables!");
                            sb.AppendLine(
                                "REMEDY - 1) Avoid using global variables in events 2) Or manually specify the alphabet of the relevant process using the following syntax: \n\r\t #alphabet someProcess {X}; \n\rwhere X is a set of event names.");
                            throw new RuntimeException(sb.ToString());
                        }
                    }
                }

                string name = Event.GetEventID(null);

                if (name != Constants.TAU && !list.Contains(name))
                {
                    list.Add(name);
                }
            }
            else if (Specification.CollectDataOperationEvent == false && Event.ToString() != Constants.TAU)
            {
                HashSet <string> set = Process.GetAlphabets(visitedDefinitionRefs);
                set.Add(Event.BaseName);

                return(set);
            }
            return(list);
        }
Пример #8
0
        public override HashSet <string> GetAlphabets(Dictionary <string, string> visitedDefinitionRefs)
        {
            if (Processes == null)
            {
                return(IndexedProcessDefinition.Process.GetAlphabets(visitedDefinitionRefs));
            }

            HashSet <string> toReturn = new HashSet <string>();

            for (int i = 0; i < Processes.Count; i++)
            {
                Process process = Processes[i];
                toReturn.UnionWith(process.GetAlphabets(visitedDefinitionRefs));
            }
            return(toReturn);
        }
Пример #9
0
 public override HashSet <string> GetAlphabets(Dictionary <string, string> visitedDefinitionRefs)
 {
     return(Process.GetAlphabets(visitedDefinitionRefs));
 }