Esempio n. 1
0
 public Configuration(Process p, string e, string displayName, Valuation globalEnv, bool isDataOperation)
 {
     Process = p;
     Event = e;
     GlobalEnv = globalEnv;
     DisplayName = displayName;
     IsDataOperation = isDataOperation;
 }
Esempio n. 2
0
        public DataOperationPrefix(Event e, Expression assignment, Process process, string[] localvar)
        {
            Event = e;
            AssignmentExpr = assignment;
            Process = process;
            LocalVariables = localvar;

            ProcessID = DataStore.DataManager.InitializeProcessID(Event.GetID() + "{" + AssignmentExpr.ExpressionID + "}" + Constants.EVENTPREFIX + Process.ProcessID);
        }
Esempio n. 3
0
        public ConditionalChoice(Process firstProcess, Process secondProcess, Expression conditionExpression)
        {
            FirstProcess = firstProcess;
            SecondProcess = secondProcess;
            ConditionalExpression = conditionExpression;

            ProcessID = DataStore.DataManager.InitializeProcessID(FirstProcess.ProcessID + Constants.CONDITIONAL_CHOICE +
                                                                      conditionExpression.ExpressionID + Constants.CONDITIONAL_CHOICE +
                                                                      SecondProcess.ProcessID);
        }
Esempio n. 4
0
        //=========================Fileds for Static Analysis================================
        public Definition(string name, string[] vars, Process process)
        {
            Name = name;
            Process = process;
            LocalVariables = vars;

            SubDefinitions = new List<Definition>();
            SubDefinitionNames = new List<string>();

            Channels = new List<string>();
            GlobalVars = new List<string>();

            AlphabetsCalculable = true;
            Alphabets = new HashSet<string>();
        }
Esempio n. 5
0
        public ChannelInput(string evtName, Expression[] exp, Process process)
        {
            ChannelName = evtName;

            ExpressionList = exp;
            Process = process;

            StringBuilder ID = new StringBuilder();
            ID.Append(ChannelName);
            ID.Append("?");
            ID.Append(Common.Classes.Ultility.Ultility.PPIDListDot(ExpressionList));
            ID.Append(Constants.EVENTPREFIX);
            ID.Append(Process.ProcessID);
            ProcessID = DataStore.DataManager.InitializeProcessID(ID.ToString());
        }
Esempio n. 6
0
        public Sequence(Process firstProcess, Process secondProcess)
        {
            FirstProcess = firstProcess;
            SecondProcess = secondProcess;

            if (FirstProcess is Skip || (FirstProcess is AtomicProcess && (FirstProcess as AtomicProcess).Process is Skip))
            {
                ProcessID = SecondProcess.ProcessID;
            }
            else if (FirstProcess is Stop || (FirstProcess is AtomicProcess && (FirstProcess as AtomicProcess).Process is Stop))
            {
                ProcessID = Constants.STOP;
            }
            else
            {
                ProcessID = DataStore.DataManager.InitializeProcessID(Constants.SEQUENTIAL + FirstProcess.ProcessID + Constants.SEPARATOR + SecondProcess.ProcessID);
            }
        }
Esempio n. 7
0
        public CaseProcess(Process[] processes, Expression[] conds)
        {
            Processes = processes;
            Conditions = conds;

            //generate the process ID
            StringBuilder IDBuilder = new StringBuilder(Constants.CASE);
            for (int i = 0; i < Processes.Length; i++)
            {
                //IDBuilder.Append(DataStore.DataManager.InitializeProcessID(Conditions[i].GetID()));
                IDBuilder.Append(Conditions[i].ExpressionID);
                IDBuilder.Append(Constants.CASECONDITIONAL);
                IDBuilder.Append(Processes[i].ProcessID);
                IDBuilder.Append(";");
            }

            ProcessID = DataStore.DataManager.InitializeProcessID(IDBuilder.ToString());
        }
Esempio n. 8
0
        public AtomicProcess(Process process, bool started)
        {
            if (process is AtomicProcess)
            {
                Process = (process as AtomicProcess).Process;
            }
            else
            {
                Process = process;
            }

            Started = started;

            if(started)
            {
                ProcessID = DataStore.DataManager.InitializeProcessID(Constants.ATOMIC_STARTED + Process.ProcessID);
            }
            else
            {
                ProcessID = DataStore.DataManager.InitializeProcessID(Constants.ATOMIC_NOTSTARTED + Process.ProcessID);
            }
        }
Esempio n. 9
0
        public Hiding(Process process, EventCollection alphabets)
        {
            if (process is Hiding)
            {
                Process = (process as Hiding).Process;
                List<Event> events = new List<Event>((process as Hiding).HidingAlphabets);

                foreach (Event item in alphabets)
                {
                    if (!events.Contains(item))
                    {
                        events.Add(item);
                    }
                }

                HidingAlphabets = new EventCollection(events);
            }
            else {
                Process = process;
                HidingAlphabets = alphabets;
            }

            ProcessID = DataStore.DataManager.InitializeProcessID(Constants.HIDING + Process.ProcessID + Constants.SEPARATOR + HidingAlphabets.ProcessID);
        }
Esempio n. 10
0
 public Interrupt(Process firstProcess, Process secondProcess)
 {
     FirstProcess = firstProcess;
     SecondProcess = secondProcess;
     ProcessID = DataStore.DataManager.InitializeProcessID(FirstProcess.ProcessID + Constants.INTERRUPT + SecondProcess.ProcessID);
 }
Esempio n. 11
0
 public Definition ClearConstant(Dictionary<string, Expression> constMapping)
 {
     Process = Process.ClearConstant(constMapping);
     return this;
 }
 public ConfigurationWithChannelData(Process p, string e, string hiddenEvent, Valuation globalEnv, bool isDataOperation, string name, Expression[] expressions)
     : base(p, e, hiddenEvent, globalEnv, isDataOperation)
 {
     ChannelName = name;
     Expressions = expressions;
 }
Esempio n. 13
0
 public GuardProcess(Process process, Expression cond)
 {
     Process = process;
     Condition = cond;
     ProcessID = DataStore.DataManager.InitializeProcessID("[" + cond.ExpressionID + "]" + Process.ProcessID);
 }
Esempio n. 14
0
 public EventPrefix(Event e, Process process)
 {
     Event = e;
     Process = process;
     ProcessID = DataStore.DataManager.InitializeProcessID(Event.GetID() + Constants.EVENTPREFIX + Process.ProcessID);
 }