コード例 #1
0
ファイル: FairThread.cs プロジェクト: vu111293/pat-design
 public FairThread(Dictionary <string, LocalPair> scc, Stack <LocalPair> tStack, FairnessType fairType, Dictionary <string, List <string> > OutgoingTransitionTable)
 {
     this.SCC          = scc;
     this.TaskStack    = tStack;
     this.FairnessType = fairType;
     //this.BA = BA;
     this.OutgoingTransitionTable = OutgoingTransitionTable;
 }
コード例 #2
0
ファイル: FairThread.cs プロジェクト: nhannhan159/PAT
 public FairThread(Dictionary<string, LocalPair> scc, Stack<LocalPair> tStack, FairnessType fairType, Dictionary<string, List<string>> OutgoingTransitionTable)
 {
     this.SCC = scc;
     this.TaskStack = tStack;
     this.FairnessType = fairType;
     //this.BA = BA;
     this.OutgoingTransitionTable = OutgoingTransitionTable;
 }
コード例 #3
0
        /// <summary>
        /// The GUI initialization method is invoked before the verification so that the verification options are passed
        /// into the assertion.
        /// </summary>
        /// <param name="target">The model checking form or null in the console mode</param>
        /// <param name="behavior"></param>
        /// <param name="engine"></param>
        public override void UIInitialize(ISynchronizeInvoke target, int behavior, int engine)
        {
            base.UIInitialize(target, behavior, engine);

            hasFairness = true;
            switch (SelectedBahaviorName)
            {
            case Constants.COMPLETE_BEHAVIOR:
                FairnessType = FairnessType.NO_FAIRNESS;
                hasFairness  = false;
                break;

            case Constants.BEHAVIOR_EVENT_LEVEL_WEAK_FAIRNESS:
                FairnessType = FairnessType.EVENT_LEVEL_WEAK_FAIRNESS;
                break;

            case Constants.BEHAVIOR_EVENT_LEVEL_STRONG_FAIRNESS:
                FairnessType = FairnessType.EVENT_LEVEL_STRONG_FAIRNESS;
                break;

            case Constants.BEHAVIOR_PROCESS_LEVEL_WEAK_FAIRNESS:
                FairnessType = FairnessType.PROCESS_LEVEL_WEAK_FAIRNESS;
                break;

            case Constants.BEHAVIOR_PROCESS_LEVEL_STRONG_FAIRNESS:
                FairnessType = FairnessType.PROCESS_LEVEL_STRONG_FAIRNESS;
                break;

            case Constants.BEHAVIOR_GLOBAL_FAIRNESS:
                FairnessType = FairnessType.GLOBAL_FAIRNESS;
                break;
            }

            CalculateParticipatingProcess = FairnessType == FairnessType.PROCESS_LEVEL_WEAK_FAIRNESS || FairnessType == FairnessType.PROCESS_LEVEL_STRONG_FAIRNESS || MustAbstract;

            if (!IsSafety)
            {
                IsNegateLiveness = hasFairness || LivenessChecking.isLiveness(BA);
                if (!IsNegateLiveness)
                {
                    //direct decide the verification result if possible.
                    if (!BA.HasAcceptState)
                    {
                        VerificationOutput.VerificationResult = VerificationResultType.VALID;
                    }
                }
            }
            else
            {
                //direct decide the verification result if possible.
                if (!BA.HasAcceptState)
                {
                    VerificationOutput.VerificationResult = VerificationResultType.INVALID;
                }
            }
        }
コード例 #4
0
ファイル: TarjanThread.cs プロジェクト: vu111293/pat-design
 public TarjanThread(ConfigurationBase initialStep, BuchiAutomata ba, PATThreadPool threadPool, FairnessType FairnessType)
 {
     this.initialStep        = initialStep;
     this.VerificationResult = VerificationResultType.UNKNOWN;
     this.BA           = ba;
     this.ThreadPool   = threadPool;
     this.FairnessType = FairnessType;
     this.FairSCC      = null;
     this.JobFinished  = false;
 }
コード例 #5
0
ファイル: TarjanThread.cs プロジェクト: nhannhan159/PAT
 public TarjanThread(ConfigurationBase initialStep, BuchiAutomata ba, PATThreadPool threadPool, FairnessType FairnessType)
 {
     this.initialStep = initialStep;
     this.VerificationResult = VerificationResultType.UNKNOWN;
     this.BA = ba;
     this.ThreadPool = threadPool;
     this.FairnessType = FairnessType;
     this.FairSCC = null;
     this.JobFinished = false;
 }
コード例 #6
0
        //public void SetEnabledEngaged(IEnumerable<ConfigurationBase> steps, FairnessType fairness)
        public void SetEnabled(IEnumerable <ConfigurationBase> steps, FairnessType fairness)
        {
            switch (fairness)
            {
            case FairnessType.EVENT_LEVEL_STRONG_FAIRNESS:
            case FairnessType.EVENT_LEVEL_WEAK_FAIRNESS:
                //for (int i = 0; i < steps.Length; i++)
                foreach (var step in steps)
                {
                    Enabled.Add(step.Event);
                }
                //Engaged.Add(configuration.Event);
                break;

            case FairnessType.PROCESS_LEVEL_STRONG_FAIRNESS:
            case FairnessType.PROCESS_LEVEL_WEAK_FAIRNESS:
                foreach (var step in steps)
                {
                    Debug.Assert(step.ParticipatingProcesses != null);

                    foreach (string proc in step.ParticipatingProcesses)
                    {
                        if (!Enabled.Contains(proc))
                        {
                            Enabled.Add(proc);
                        }
                    }
                }

                //Debug.Assert(configuration.ParticipatingProcesses != null);

                //    foreach (string proc in configuration.ParticipatingProcesses)
                //    {
                //        if (!Engaged.Contains(proc))
                //        {
                //            Engaged.Add(proc);
                //        }
                //    }
                break;

            case FairnessType.GLOBAL_FAIRNESS:
                foreach (var step in steps)
                {
                    Enabled.Add(step.GetIDWithEvent());
                }
                //Engaged.Add(configuration.GetIDWithEvent());
                break;
            }
        }
コード例 #7
0
        /// <summary>
        /// The following method returns an ID of the configruation with the participating process if process-level fairness is invovled.
        /// </summary>
        /// <param name="fairness"></param>
        /// <returns></returns>
        public string GetCompressedState(FairnessType fairness)
        {
            if (fairness == FairnessType.PROCESS_LEVEL_STRONG_FAIRNESS || fairness == FairnessType.PROCESS_LEVEL_WEAK_FAIRNESS)
            {
                if (configuration.ParticipatingProcesses == null)
                {
                    return(configuration.GetIDWithEvent() + Constants.SEPARATOR + state);
                }

                string participateProcesses = "";

                foreach (string item in configuration.ParticipatingProcesses)
                {
                    participateProcesses += item + Constants.SEPARATOR;
                }

                return(configuration.GetIDWithEvent() + Constants.SEPARATOR + participateProcesses + state);
            }

            return(configuration.GetIDWithEvent() + Constants.SEPARATOR + state);
        }
コード例 #8
0
        //public void SetEnabledEngaged(IEnumerable<ConfigurationBase> steps, FairnessType fairness)
        public void SetEnabled(IEnumerable<ConfigurationBase> steps, FairnessType fairness)
        {
            switch (fairness)
            {
                case FairnessType.EVENT_LEVEL_STRONG_FAIRNESS:
                case FairnessType.EVENT_LEVEL_WEAK_FAIRNESS:
                    //for (int i = 0; i < steps.Length; i++)
                    foreach (var step in steps)
                    {
                        Enabled.Add(step.Event);
                    }
                    //Engaged.Add(configuration.Event);
                    break;
                case FairnessType.PROCESS_LEVEL_STRONG_FAIRNESS:
                case FairnessType.PROCESS_LEVEL_WEAK_FAIRNESS:
                    foreach (var step in steps)
                    {
                        Debug.Assert(step.ParticipatingProcesses != null);

                        foreach (string proc in step.ParticipatingProcesses)
                        {
                            if (!Enabled.Contains(proc))
                            {
                                Enabled.Add(proc);
                            }
                        }
                    }

                    //Debug.Assert(configuration.ParticipatingProcesses != null);

                    //    foreach (string proc in configuration.ParticipatingProcesses)
                    //    {
                    //        if (!Engaged.Contains(proc))
                    //        {
                    //            Engaged.Add(proc);
                    //        }
                    //    }
                    break;
                case FairnessType.GLOBAL_FAIRNESS:
                    foreach (var step in steps)
                    {
                        Enabled.Add(step.GetIDWithEvent());
                    }
                    //Engaged.Add(configuration.GetIDWithEvent());
                    break;
            }
        }
コード例 #9
0
        /// <summary>
        /// The following method returns an ID of the configruation with the participating process if process-level fairness is invovled.
        /// </summary>
        /// <param name="fairness"></param>
        /// <returns></returns>
        public string GetCompressedState(FairnessType fairness)
        {
            if (fairness == FairnessType.PROCESS_LEVEL_STRONG_FAIRNESS || fairness == FairnessType.PROCESS_LEVEL_WEAK_FAIRNESS)
            {
                if (configuration.ParticipatingProcesses == null)
                {
                    return configuration.GetIDWithEvent() + Constants.SEPARATOR + state;

                }

                string participateProcesses = "";

                foreach (string item in configuration.ParticipatingProcesses)
                {
                    participateProcesses += item + Constants.SEPARATOR;
                }

                return configuration.GetIDWithEvent() + Constants.SEPARATOR + participateProcesses + state;
            }

            return configuration.GetIDWithEvent() + Constants.SEPARATOR + state;
        }
コード例 #10
0
ファイル: AssertionLTL.cs プロジェクト: nhannhan159/PAT
        /// <summary>
        /// The GUI initialization method is invoked before the verification so that the verification options are passed
        /// into the assertion.
        /// </summary>
        /// <param name="target">The model checking form or null in the console mode</param>
        /// <param name="behavior"></param>
        /// <param name="engine"></param>
        public override void UIInitialize(ISynchronizeInvoke target, int behavior, int engine)
        {
            base.UIInitialize(target, behavior, engine);

            hasFairness = true;
            switch (SelectedBahaviorName)
            {
                case Constants.COMPLETE_BEHAVIOR:
                    FairnessType = FairnessType.NO_FAIRNESS;
                    hasFairness = false;
                    break;
                case Constants.BEHAVIOR_EVENT_LEVEL_WEAK_FAIRNESS:
                    FairnessType = FairnessType.EVENT_LEVEL_WEAK_FAIRNESS;
                    break;
                case Constants.BEHAVIOR_EVENT_LEVEL_STRONG_FAIRNESS:
                    FairnessType = FairnessType.EVENT_LEVEL_STRONG_FAIRNESS;
                    break;
                case Constants.BEHAVIOR_PROCESS_LEVEL_WEAK_FAIRNESS:
                    FairnessType = FairnessType.PROCESS_LEVEL_WEAK_FAIRNESS;
                    break;
                case Constants.BEHAVIOR_PROCESS_LEVEL_STRONG_FAIRNESS:
                    FairnessType = FairnessType.PROCESS_LEVEL_STRONG_FAIRNESS;
                    break;
                case Constants.BEHAVIOR_GLOBAL_FAIRNESS:
                    FairnessType = FairnessType.GLOBAL_FAIRNESS;
                    break;
            }

            CalculateParticipatingProcess = FairnessType == FairnessType.PROCESS_LEVEL_WEAK_FAIRNESS || FairnessType == FairnessType.PROCESS_LEVEL_STRONG_FAIRNESS || MustAbstract;

            if (!IsSafety)
            {
                IsNegateLiveness = hasFairness || LivenessChecking.isLiveness(BA);
                if (!IsNegateLiveness)
                {
                    //direct decide the verification result if possible.
                    if (!BA.HasAcceptState)
                    {
                        VerificationOutput.VerificationResult = VerificationResultType.VALID;
                    }
                }
            }
            else
            {
                //direct decide the verification result if possible.
                if (!BA.HasAcceptState)
                {
                    VerificationOutput.VerificationResult = VerificationResultType.INVALID;
                }
            }
        }