Beispiel #1
0
 /// <summary>
 ///   Prints a progress report if necessary.
 /// </summary>
 public void ReportProgress()
 {
     if (InterlockedExtensions.ExchangeIfGreaterThan(ref NextReport, StateCount, NextReport + ReportStateCountDelta))
     {
         Report();
     }
 }
Beispiel #2
0
        /// <summary>
        ///   Checks whether the model's invariant holds for all states.
        /// </summary>
        internal void Check()
        {
            try
            {
                while (_context.LoadBalancer.LoadBalance(_index))
                {
                    int state;
                    if (!_stateStack.TryGetState(out state))
                    {
                        continue;
                    }

                    CallStateDetectionEventInDebugMode(state);

                    HandleTransitions(Model.GetSuccessorTransitions(_context.States[state]), state, isInitial: false);

                    InterlockedExtensions.ExchangeIfGreaterThan(ref _context.LevelCount, _stateStack.FrameCount, _stateStack.FrameCount);
                    _context.ReportProgress();
                }
            }
            catch (Exception e)
            {
                _context.LoadBalancer.Terminate();
                _context.Exception = e;

                if (!(e is OutOfMemoryException))
                {
                    CreateCounterExample(endsWithException: true, addAdditionalState: true);
                }
            }
        }