Пример #1
0
        public ExecutionState(StateImpl s, TraversalInfo predecessor, Via bt,
            bool MustFingerprint)
            : base(s, StateType.ExecutionState, predecessor, bt)
        {
            Debug.Assert(ProcessInfo != null &&
                        ProcessInfo.Length == NumProcesses);

            stateImpl = s;
            hasMultipleSuccessors = NumSuccessors() > 1;
            receipt = s.CheckIn();

            if (!ZingerConfiguration.DoRandomSampling)
            {
                if (MustFingerprint)
                {
                    this.fingerprint = s.Fingerprint;
                    this.IsFingerPrinted = true;
                }
                else
                {
                    this.fingerprint = null;
                    this.IsFingerPrinted = false;
                }
            }
        }
Пример #2
0
        public ExecutionState(StateImpl s, TraversalInfo predecessor, Via bt)
            : base(s, StateType.ExecutionState, predecessor, bt)
        {
            Debug.Assert(ProcessInfo != null &&
                ProcessInfo.Length == NumProcesses);
            hasMultipleSuccessors = NumSuccessors() > 1;
            stateImpl = s;
            currProcess = 0;
            receipt = s.CheckIn();

            #if true
            //dont fingerprint during random sampling
            if (!ZingerConfiguration.DoRandomSampling)
            {
                if (ZingerConfiguration.FingerprintSingleTransitionStates)
                {
                    if (this.NumProcesses > 1)
                    {
                        this.fingerprint = s.Fingerprint;
                        this.IsFingerPrinted = true;
                    }
                    else
                    {
                        // Fingerprint with probability p
                        if (ZingerUtilities.rand.NextDouble() <= ZingerConfiguration.NonChooseProbability)
                        {
                            this.fingerprint = s.Fingerprint;
                            this.IsFingerPrinted = true;
                        }
                        else
                        {
                            this.fingerprint = null;
                            this.IsFingerPrinted = false;
                        }
                    }
                }
                else
                {
                    this.fingerprint = s.Fingerprint;
                    this.IsFingerPrinted = true;
                }
            }
            #endif
        }
Пример #3
0
 internal override void deOrphanize(StateImpl s)
 {
     Debug.Assert(numChoices == s.NumChoices);
     receipt = s.CheckIn();
     Predecessor.Successor = this;
 }
Пример #4
0
        public ChooseState(StateImpl s, TraversalInfo predecessor,
            Via bt, bool MustFingerprint)
            : base(s, StateType.ChooseState, predecessor, bt)
        {
            numChoices = s.NumChoices;
            stateImpl = s;
            hasMultipleSuccessors = s.NumChoices > 1;

            receipt = s.CheckIn();
            if (!ZingerConfiguration.DoRandomSampling)
            {
                if (MustFingerprint)
                {
                    fingerprint = s.Fingerprint;
                    this.IsFingerPrinted = true;
                }
                else
                {
                    this.fingerprint = null;
                    this.IsFingerPrinted = false;
                }
            }
        }
Пример #5
0
        public ChooseState(StateImpl s,
            TraversalInfo predecessor, Via bt)
            : base(s, StateType.ChooseState, predecessor, bt)
        {
            numChoices = s.NumChoices;
            hasMultipleSuccessors = s.NumChoices > 1;

            stateImpl = s;

            receipt = s.CheckIn();
            if (!ZingerConfiguration.DoRandomSampling)
            {
                if (ZingerConfiguration.FingerprintSingleTransitionStates)
                {
                    if (this.NumChoices > 1)
                    {
                        this.fingerprint = s.Fingerprint;
                        this.IsFingerPrinted = true;
                    }
                    else
                    {
                        // Fingerprint with probability p
                        if (ZingerUtilities.rand.NextDouble() <= ZingerConfiguration.NonChooseProbability)
                        {
                            this.fingerprint = s.Fingerprint;
                            this.IsFingerPrinted = true;
                        }
                        else
                        {
                            this.fingerprint = null;
                            this.IsFingerPrinted = false;
                        }
                    }
                }
                else
                {
                    this.fingerprint = s.Fingerprint;
                    this.IsFingerPrinted = true;
                }
            }
        }
Пример #6
0
 internal override void deOrphanize(StateImpl s)
 {
     receipt = s.CheckIn();
     Predecessor.Successor = this;
 }
Пример #7
0
        public TerminalState(StateImpl s, TraversalInfo pred, Via bt,
            bool MustFingerprint)
            : base(s, StateType.TerminalState, pred, bt)
        {
            hasMultipleSuccessors = false;
            if (s.IsErroneous)
            {
                IsErroneous = true;
                Error = s.Exception;
            }
            else if (s.IsFailedAssumption)
            {
                IsFailedAssumption = true;
                Error = s.Exception;
            }
            else if (s.IsValidTermination)
            {
                IsValidTermination = true;
            }

            stateImpl = s;
            receipt = s.CheckIn();

            if (MustFingerprint)
            {
                this.fingerprint = s.Fingerprint;
                this.IsFingerPrinted = true;
            }
            else
            {
                this.fingerprint = null;
                this.IsFingerPrinted = false;
            }
        }
Пример #8
0
        public TerminalState(StateImpl s, TraversalInfo pred, Via bt)
            : base(s, StateType.TerminalState, pred, bt)
        {
            hasMultipleSuccessors = false;
            if (s.IsErroneous)
            {
                IsErroneous = true;
                Error = s.Exception;
            }
            else if (s.IsFailedAssumption)
            {
                IsFailedAssumption = true;
                Error = s.Exception;
            }
            else if (s.IsValidTermination)
            {
                IsValidTermination = true;
            }

            stateImpl = s;

            receipt = s.CheckIn();

            #if true
            if (ZingerConfiguration.FingerprintSingleTransitionStates)
            {
                // Fingerprint with probability p
                if (ZingerUtilities.rand.NextDouble() <= ZingerConfiguration.NonChooseProbability)
                {
                    this.fingerprint = s.Fingerprint;
                    this.IsFingerPrinted = true;
                }
                else
                {
                    this.fingerprint = null;
                    this.IsFingerPrinted = false;
                }
            }
            else
            {
                this.fingerprint = s.Fingerprint;
                this.IsFingerPrinted = true;
            }
            #endif
        }