예제 #1
0
        public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
        {
            //List<ConfigurationWithChannelData> returnList = new List<ConfigurationWithChannelData>();

            for (int i = 0; i < Processes.Count; i++)
            {
                Process process = Processes[i];
                List <ConfigurationWithChannelData> list1 = new List <ConfigurationWithChannelData>();
                process.SyncOutput(GlobalEnv, list1);

                foreach (ConfigurationWithChannelData pair in list1)
                {
                    Configuration step = pair;

                    List <Process> newProcess = new List <Process>(Processes.Count);
                    newProcess.AddRange(Processes);
                    newProcess[i] = step.Process;

                    step.Process = new IndexInterleave(newProcess);
                }

                list.AddRange(list1);
            }

            //return returnList;
        }
예제 #2
0
        public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
        {
            //List<ConfigurationWithChannelData> returnList = new List<ConfigurationWithChannelData>();

            for (int i = 0; i < Processes.Count; i++)
            {
                Process process = Processes[i];
                List <ConfigurationWithChannelData> list1 = new List <ConfigurationWithChannelData>();
                process.SyncOutput(GlobalEnv, list1);

                for (int j = 0; j < list1.Count; j++)
                {
                    Configuration step = list1[j];

                    List <Process> newProcess = new List <Process>(Processes.Count);
                    newProcess.AddRange(Processes);
                    newProcess[i] = step.Process;

                    step.Process = new IndexParallel(newProcess, Alphabets);
                }

                list.AddRange(list1);
            }
            //return returnList;
        }
예제 #3
0
 public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
 {
     Process.SyncOutput(GlobalEnv, list);
     foreach (ConfigurationWithChannelData step in list)
     {
         step.Process  = new AtomicProcess(step.Process, true);
         step.IsAtomic = Started;
     }
     //return steps;
 }
예제 #4
0
        public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
        {
            Process.SyncOutput(GlobalEnv, list);
            foreach (ConfigurationWithChannelData pair in list)
            {
                Configuration step = pair;
                step.Process = new Hiding(step.Process, HidingAlphabets);
            }

            //return returnlist;
        }
예제 #5
0
        public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
        {
            ExpressionValue v = EvaluatorDenotational.Evaluate(Condition, GlobalEnv);

            if ((v as BoolConstant).Value)
            {
                Process.SyncOutput(GlobalEnv, list);
            }

            //return new List<ConfigurationWithChannelData>(0);
        }
        public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
        {
            System.Diagnostics.Debug.Assert(list.Count == 0);

            ExpressionValue v = EvaluatorDenotational.Evaluate(ConditionalExpression, GlobalEnv);

            if ((v as BoolConstant).Value)
            {
                FirstProcess.SyncOutput(GlobalEnv, list);
            }
            else
            {
                SecondProcess.SyncOutput(GlobalEnv, list);
            }
        }
예제 #7
0
        public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
        {
            FirstProcess.SyncOutput(GlobalEnv, list);

            for (int i = 0; i < list.Count; i++)
            {
                Configuration step = list[i];
                if (step.Event != Constants.TERMINATION)
                {
                    Interrupt inter = new Interrupt(step.Process, SecondProcess);
                    step.Process = inter;
                }
            }

            SecondProcess.SyncOutput(GlobalEnv, list);

            //return returnList;
        }
예제 #8
0
        public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
        {
            if (FirstProcess is Skip || (FirstProcess is AtomicProcess && (FirstProcess as AtomicProcess).Process is Skip))
            {
                SecondProcess.SyncOutput(GlobalEnv, list);
                return;
            }

            FirstProcess.SyncOutput(GlobalEnv, list);

            for (int i = 0; i < list.Count; i++)
            {
                Configuration step = list[i];
                step.Process = new Sequence(step.Process, SecondProcess);
            }

            //return list;
        }
예제 #9
0
        public override void SyncOutput(Valuation GlobalEnv, List <ConfigurationWithChannelData> list)
        {
            //List<ConfigurationWithChannelData> returnList = new List<ConfigurationWithChannelData>();

            for (int i = 0; i < Processes.Count; i++)
            {
                Process process = Processes[i];
                List <ConfigurationWithChannelData> list1 = new List <ConfigurationWithChannelData>();
                process.SyncOutput(GlobalEnv, list1);

                if (list1.Count > 0)
                {
                    List <Dictionary <string, int> > nextProcessCounters =
                        Common.Classes.Ultility.Ultility.ProcessCounterDecrement(Common.Classes.Ultility.Ultility.CutNumber, ProcessesCounter, process.ProcessID, 1);

                    for (int j = 0; j < list1.Count; j++)
                    {
                        Configuration step = list1[j];

                        foreach (Dictionary <string, int> ints in nextProcessCounters)
                        {
                            List <Process> newProcess = new List <Process>(Processes);

                            Dictionary <string, int> listInstance = new Dictionary <string, int>(ints);
                            AddOneProcess(newProcess, step.Process, listInstance);
                            IndexInterleaveAbstract      interleave = new IndexInterleaveAbstract(newProcess, listInstance);
                            ConfigurationWithChannelData newStep    = new ConfigurationWithChannelData(interleave, step.Event, step.DisplayName, step.GlobalEnv, step.IsDataOperation, list1[j].ChannelName, list1[j].Expressions);
                            newStep.IsAtomic = step.IsAtomic;
                            list.Add(newStep);
                        }
                    }
                }
            }

            //return returnList;
        }