Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 16
0
 public override void SyncInput(ConfigurationWithChannelData eStep, List<Configuration> list)
 {
     GetProcess(eStep.GlobalEnv).SyncInput(eStep, list);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 24
0
 public override void SyncInput(ConfigurationWithChannelData eStep, List <Configuration> list)
 {
     GetProcess(eStep.GlobalEnv).SyncInput(eStep, list);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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;
        }