Exemplo n.º 1
0
        /// <summary>
        ///   Gets all transitions towards successor states of <paramref name="state" />.
        /// </summary>
        /// <param name="state">The state the successors should be returned for.</param>
        public override TransitionCollection GetSuccessorTransitions(byte *state)
        {
            BeginExecution();
            ChoiceResolver.PrepareNextState();

            while (ChoiceResolver.PrepareNextPath())
            {
                RuntimeModel.Deserialize(state);
                ExecuteTransition();

                GenerateTransition();
            }

            return(EndExecution());
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Gets all initial transitions of the model.
        /// </summary>
        public override TransitionCollection GetInitialTransitions()
        {
            BeginExecution();
            ChoiceResolver.PrepareNextState();

            fixed(byte *state = RuntimeModel.ConstructionState)
            {
                while (ChoiceResolver.PrepareNextPath())
                {
                    RuntimeModel.Deserialize(state);
                    ExecuteInitialTransition();

                    GenerateTransition();
                }
            }

            return(EndExecution());
        }
Exemplo n.º 3
0
		/// <summary>
		///   Replays the transition of the counter example with the zero-baesd <paramref name="transitionIndex" />.
		/// </summary>
		/// <param name="choiceResolver">The choice resolver that should be used to resolve nondeterministic choices.</param>
		/// <param name="transitionIndex">The zero-based index of the transition that should be replayed.</param>
		internal unsafe void Replay(ChoiceResolver choiceResolver, int transitionIndex)
		{
			if (StepCount == 0)
				return;

			choiceResolver.Clear();
			choiceResolver.PrepareNextState();
			choiceResolver.SetChoices(_replayInfo[transitionIndex]);

			fixed (byte* state = _states[transitionIndex])
				RuntimeModel.Deserialize(state);

			if (transitionIndex == 0)
				RuntimeModel.ExecuteInitialStep();
			else
				RuntimeModel.ExecuteStep();

			RuntimeModel.NotifyFaultActivations();
		}