Пример #1
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            //List<Configuration> returnList = new List<Configuration>();

            for (int i = 0; i < Processes.Count; i++)
            {
                Process process            = Processes[i];
                List <Configuration> list1 = new List <Configuration>();
                process.SyncInput(eStep, 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);
                            step.Process = interleave;
                            list.Add(step);
                        }
                    }
                }
            }

            //return returnList;
        }
Пример #2
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            //List<Configuration> returnList = new List<Configuration>();
            //List<Configuration> list1 = new List<Configuration>();
            FirstProcess.SyncInput(eStep, 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;
                }
                //list.Add(list1[i]);
                list[i] = step;
            }

            SecondProcess.SyncInput(eStep, list);
            //list1 =
            //for (int i = 0; i < list1.Count; i++)
            //{
            //    list.Add(list1[i]);
            //}

            //return returnList;
        }
Пример #3
0
 public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
 {
     for (int i = 0; i < Processes.Count; i++)
     {
         List <Configuration> list1 = new List <Configuration>();
         Processes[i].SyncInput(eStep, list1);
         list.AddRange(list1);
     }
 }
Пример #4
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            Process.SyncInput(eStep, list);
            for (int i = 0; i < list.Count; i++)
            {
                list[i].Process = new Hiding(list[i].Process, HidingAlphabets);
            }

            //return list;
        }
Пример #5
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            ExpressionValue v = EvaluatorDenotational.Evaluate(Condition, eStep.GlobalEnv);

            if ((v as BoolConstant).Value)
            {
                Process.SyncInput(eStep, list);
            }

            //return new List<Configuration>(0);
        }
Пример #6
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            ExpressionValue v = EvaluatorDenotational.Evaluate(Condition, eStep.GlobalEnv);

            if ((v as BoolConstant).Value)
            {
                Process.SyncInput(eStep, list);
            }

            //return new List<Configuration>(0);
        }
Пример #7
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            Process.SyncInput(eStep, list);
            for (int i = 0; i < list.Count; i++)
            {
                list[i].Process  = new AtomicProcess(list[i].Process, true);
                list[i].IsAtomic = Started;
            }

            //return returnlist;
        }
Пример #8
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            if (FirstProcess is Skip || (FirstProcess is AtomicProcess && (FirstProcess as AtomicProcess).Process is Skip))
            {
                SecondProcess.SyncInput(eStep, list);
                return;
            }

            FirstProcess.SyncInput(eStep, list);

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

            //return list;
        }
Пример #9
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            //List<Configuration> list = new List<Configuration>(1);
            if (eStep.ChannelName == ChannelName && eStep.Expressions.Length == ExpressionList.Length)
            {
                Dictionary <string, Expression> mapping = new Dictionary <string, Expression>(eStep.Expressions.Length);

                for (int i = 0; i < ExpressionList.Length; i++)
                {
                    Expression v = eStep.Expressions[i];

                    if (ExpressionList[i] is Variable)
                    {
                        mapping.Add(ExpressionList[i].ExpressionID, v);
                    }
                    else
                    {
                        if (v.ExpressionID != ExpressionList[i].ExpressionID)
                        {
                            return;
                        }
                    }
                }

                Expression      guard = GuardExpression.ClearConstant(mapping);
                ExpressionValue value = EvaluatorDenotational.Evaluate(guard, eStep.GlobalEnv);

                if ((value as BoolConstant).Value)
                {
                    Configuration vm;
                    if (mapping.Count > 0)
                    {
                        vm = new Configuration(Process.ClearConstant(mapping), null, null, eStep.GlobalEnv, false);
                    }
                    else
                    {
                        vm = new Configuration(Process, null, null, eStep.GlobalEnv, false);
                    }

                    list.Add(vm);
                }
            }

            //return list;
        }
Пример #10
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            //List<Configuration> list = new List<Configuration>(1);
            if (eStep.ChannelName == ChannelName && eStep.Expressions.Length == ExpressionList.Length)
            {
                Dictionary <string, Expression> mapping = new Dictionary <string, Expression>(eStep.Expressions.Length);

                for (int i = 0; i < ExpressionList.Length; i++)
                {
                    Expression v = eStep.Expressions[i];

                    if (ExpressionList[i] is Variable)
                    {
                        mapping.Add(ExpressionList[i].ExpressionID, v); //.GetID()
                    }
                    else
                    {
                        if (v.ExpressionID != ExpressionList[i].ExpressionID) //.GetID()
                        {
                            return;
                        }
                    }
                }

                Configuration vm;
                if (mapping.Count > 0)
                {
                    vm = new Configuration(Process.ClearConstant(mapping), null, null, eStep.GlobalEnv, false);
                }
                else
                {
                    vm = new Configuration(Process, null, null, eStep.GlobalEnv, false);
                }

                list.Add(vm);
            }

            //return list;
        }
Пример #11
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;
        }
Пример #12
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
        {
            //List<Configuration> returnList = new List<Configuration>();

            for (int i = 0; i < Processes.Count; i++)
            {
                Process process            = Processes[i];
                List <Configuration> list1 = new List <Configuration>();
                process.SyncInput(eStep, 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 IndexInterleave(newProcess);
                    list.Add(step);
                }
            }

            //return returnList;
        }
Пример #13
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            //List<Configuration> returnList = new List<Configuration>();
            //List<Configuration> list1 = new List<Configuration>();
            FirstProcess.SyncInput(eStep, 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;
                }
                //list.Add(list1[i]);
                list[i] = step;
            }

            SecondProcess.SyncInput(eStep, list);
            //list1 =
            //for (int i = 0; i < list1.Count; i++)
            //{
            //    list.Add(list1[i]);
            //}

            //return returnList;
        }
Пример #14
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;
        }
Пример #15
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            //List<Configuration> returnList = new List<Configuration>();

            for (int i = 0; i < Processes.Count; i++)
            {
                Process process = Processes[i];
                List<Configuration> list1 = new List<Configuration>();
                process.SyncInput(eStep, 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);
                            step.Process = interleave;
                            list.Add(step);
                        }
                    }
                }
            }

            //return returnList;
        }
Пример #16
0
 public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
 {
     GetProcess(eStep.GlobalEnv).SyncInput(eStep, list);
 }
Пример #17
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            if (FirstProcess is Skip || (FirstProcess is AtomicProcess && (FirstProcess as AtomicProcess).Process is Skip))
            {
                SecondProcess.SyncInput(eStep, list);
                return;
            }

            FirstProcess.SyncInput(eStep, list);

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

            //return list;
        }
Пример #18
0
 /// <summary>
 /// returns all the possible synchoronous input process on the given channel
 /// </summary>
 /// <returns></returns>
 public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
 {
 }
Пример #19
0
 public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
 {
     for (int i = 0; i < Processes.Count; i++)
     {
         List<Configuration> list1 = new List<Configuration>();
         Processes[i].SyncInput(eStep, list1);
         list.AddRange(list1);
     }
 }
Пример #20
0
 /// <summary>
 /// returns all the possible synchoronous input process on the given channel
 /// </summary>
 /// <returns></returns>
 public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
 {
 }
Пример #21
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            //List<Configuration> returnList = new List<Configuration>();

            for (int i = 0; i < Processes.Count; i++)
            {
                Process process = Processes[i];
                List<Configuration> list1 = new List<Configuration>();
                process.SyncInput(eStep, 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.Add(step);
                }
            }

            //return returnList;
        }
Пример #22
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            Process.SyncInput(eStep,list);
            for (int i = 0; i < list.Count; i++)
            {
                list[i].Process = new Hiding(list[i].Process, HidingAlphabets);
            }

            //return list;
        }
Пример #23
0
 /// <summary>
 /// returns all the possible synchoronous input process on the given channel
 /// </summary>
 /// <returns></returns>
 public virtual void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
 {
 }
Пример #24
0
 public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
 {
     GetProcess(eStep.GlobalEnv).SyncInput(eStep, list);
 }
Пример #25
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            //List<Configuration> list = new List<Configuration>(1);
            if (eStep.ChannelName == ChannelName && eStep.Expressions.Length == ExpressionList.Length)
            {
                Dictionary<string, Expression> mapping = new Dictionary<string, Expression>(eStep.Expressions.Length);

                for (int i = 0; i < ExpressionList.Length; i++)
                {
                    Expression v = eStep.Expressions[i];

                    if (ExpressionList[i] is Variable)
                    {
                        mapping.Add(ExpressionList[i].ExpressionID, v); //.GetID()
                    }
                    else
                    {
                        if (v.ExpressionID != ExpressionList[i].ExpressionID) //.GetID()
                        {
                            return ;
                        }
                    }
                }

                Configuration vm;
                if (mapping.Count > 0)
                {
                    vm = new Configuration(Process.ClearConstant(mapping), null, null, eStep.GlobalEnv, false);
                }
                else
                {
                    vm = new Configuration(Process, null, null, eStep.GlobalEnv, false);
                }

                list.Add(vm);
            }

            //return list;
        }
Пример #26
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            //List<Configuration> list = new List<Configuration>(1);
            if (eStep.ChannelName == ChannelName && eStep.Expressions.Length == ExpressionList.Length)
            {
                Dictionary<string, Expression> mapping = new Dictionary<string, Expression>(eStep.Expressions.Length);

                for (int i = 0; i < ExpressionList.Length; i++)
                {
                    Expression v = eStep.Expressions[i];

                    if (ExpressionList[i] is Variable)
                    {
                        mapping.Add(ExpressionList[i].ExpressionID, v);
                    }
                    else
                    {
                        if (v.ExpressionID != ExpressionList[i].ExpressionID)
                        {
                            return ;
                        }
                    }
                }

                Expression guard = GuardExpression.ClearConstant(mapping);
                ExpressionValue value = EvaluatorDenotational.Evaluate(guard, eStep.GlobalEnv);

                if ((value as BoolConstant).Value)
                {
                    Configuration vm;
                    if (mapping.Count > 0)
                    {
                        vm = new Configuration(Process.ClearConstant(mapping), null, null, eStep.GlobalEnv, false);
                    }
                    else
                    {
                        vm = new Configuration(Process, null, null, eStep.GlobalEnv, false);
                    }

                    list.Add(vm);
                }
            }

            //return list;
        }
Пример #27
0
 /// <summary>
 /// returns all the possible synchoronous input process on the given channel
 /// </summary>
 /// <returns></returns>
 public virtual void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
 {
 }
Пример #28
0
        public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
        {
            Process.SyncInput(eStep, list);
            for (int i = 0; i < list.Count; i++)
            {
                list[i].Process = new AtomicProcess(list[i].Process, true);
                list[i].IsAtomic = Started;
            }

            //return returnlist;
        }