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; }
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; }
/// <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; } } }
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; }
//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; } }
/// <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); }
//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; } }
/// <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; }