Пример #1
0
        /// <summary>
        /// Return the AutomataBDD of the Channel Input
        /// </summary>
        /// <param name="channelName">Channel's name</param>
        /// <param name="channelEventIndex"></param>
        /// <param name="guard">Guard expression of the channel input</param>
        /// <param name="exps">List of input expression to the channel</param>
        /// <param name="guardOfTick"></param>
        /// <param name="P1">AutomataBDD of process P1 after the channel input</param>
        /// <param name="model"></param>
        /// <returns></returns>
        public static AutomataBDD ChannelInputPrefixing(string channelName, int channelEventIndex, Expression guard, List <Expression> exps, Expression assignmentExp, Expression guardOfTick, AutomataBDD P1,
                                                        Model model)
        {
            AutomataBDD result = AutomataBDD.ChannelInputPrefixing(channelName, channelEventIndex, guard, exps,
                                                                   assignmentExp, P1, model);

            EventPrefixEncodeTick(guardOfTick, P1, model, result);

            //
            return(result);
        }
        public override AutomataBDD EncodeComposition(BDDEncoder encoder)
        {
            AutomataBDD processAutomataBDD = this.Process.Encode(encoder);

            if (encoder.model.mapChannelToSize.ContainsKey(this.ChannelName))
            {
                int channelEventIndex = encoder.GetChannelIndex(this.ChannelName, BDDEncoder.EventChannelInfo.EventType.ASYNC_CHANNEL_INPUT);

                //
                return(AutomataBDD.ChannelInputPrefixing(this.ChannelName, channelEventIndex, this.GuardExpression, new List <Expression>(this.ExpressionList), AssignmentExpr, processAutomataBDD, encoder.model));
            }
            else
            {
                List <Expression> expressionList = (this.ExpressionList != null) ? new List <Expression>(this.ExpressionList) : new List <Expression>();
                int channelEventIndex            = encoder.GetEventIndex(this.ChannelName, expressionList.Count);

                //
                return(AutomataBDD.SyncChannelInputPrefixing(channelEventIndex, this.GuardExpression, expressionList, processAutomataBDD, encoder.model));
            }
        }