コード例 #1
0
        public ExecutionState GetNextState()
        {
            ExecutionState state = UnderlyingScheduler.GetNextState();

            while (state != null)
            {
                if (!CheckLoopBoundExceeded(state))
                {
                    // Still in bounds.
                    return(state);
                }
                // Bound exceeded
                // Get location for termination
                var currentInstruction = state.Mem.Stack.Last().CurrentInstruction;
                // FIXME: This is an implementation detail of the Executor that we shouldn't
                // have to deal with.
                if (currentInstruction.Current == null)
                {
                    currentInstruction.MoveNext();
                }

                var progLocation    = currentInstruction.Current.GetProgramLocation();
                var terminationType = new TerminatedWithDisallowedLoopBound(progLocation, LoopBound);
                // Kill state and let the Executor call us to remove the states.
                Executor.TerminateState(/*state=*/ state, /*type=*/ terminationType, /*removeFromStateScheduler=*/ true);

                // Try another state
                state = UnderlyingScheduler.GetNextState();
            }
            return(null);
        }
コード例 #2
0
        public ExecutionState GetNextState()
        {
            Debug.Assert(EscapingBlocks != null, "Escaping blocks not set");

            if (LoopEscapingStates.Count > 0)
            {
                return(LoopEscapingStates.Peek());
            }

            return(UnderlyingScheduler.GetNextState());
        }
コード例 #3
0
        public ExecutionState GetNextState()
        {
            while (GetNumberOfStates() > 0)
            {
                var state = UnderlyingStateScheduler.GetNextState();

                if (!TerminateIfDepthExceeded(state))
                {
                    return(state);
                }
                else
                {
                    UnderlyingStateScheduler.RemoveState(state);
                }
            }

            Debug.Assert(GetNumberOfStates() == 0, "Expected no states to remain");
            return(null);
        }