3 #include <machine/machine.h>
4 #include <transition/FSM/finiteStateMachineTransition.h>
26 typename TransitionType_,
29 template <
typename...>
class TransitionContainer_ = std::vector,
30 template <
typename...>
class InitialStateContainer_ = std::vector
48 typename TransitionType_,
50 template <
typename...>
class TransitionContainer_,
51 template <
typename...>
class InitialStateContainer_
53 class FiniteStateMachine<TransitionType_, true, acceptingStyle, TransitionContainer_, InitialStateContainer_> :
54 public Machine<TransitionType_, true, acceptingStyle, TransitionContainer_, InitialStateContainer_>{
58 using typename Machine_::IsAccepting;
60 using typename Machine_::IsAlternating;
73 static_assert(std::is_same_v<StateType, typename TransitionType::StateType>);
74 static_assert(std::is_same_v<StorageType, typename TransitionType::StorageType>);
75 static_assert(std::is_same_v<TransitionType, TransitionType_>);
76 static_assert(std::is_same_v<ApplyHelperType, typename TransitionType::ApplyHelperType>);
77 static_assert(std::is_same_v<ApplyHelperType, std::monostate>);
78 static_assert(std::is_same_v<IsDeterministic, std::true_type>);
79 static_assert(std::is_same_v<
TransitionContainer, TransitionContainer_<std::pair<const TransitionType&, ApplyHelperType>>>);
81 static_assert(std::is_same_v<
OptionalHelpedTransition, std::optional<std::pair<const TransitionType&, ApplyHelperType>>>);
84 "StorageType should be a word.");
86 "TransitionType must be a derived class of FiniteStateMachineTransition");
119 return this->getMatchingTransitionFromCurrentLetter(state, storage.front_opt());
152 typename TransitionType_,
154 template <
typename...>
class TransitionContainer_,
155 template <
typename...>
class InitialStateContainer_
157 class FiniteStateMachine<TransitionType_, false, acceptingStyle, TransitionContainer_, InitialStateContainer_> :
158 public Machine<TransitionType_, false, acceptingStyle, TransitionContainer_, InitialStateContainer_> {
162 using typename Machine_::IsAccepting;
164 using typename Machine_::IsAlternating;
177 static_assert(std::is_same_v<StateType, typename TransitionType::StateType>);
178 static_assert(std::is_same_v<StorageType, typename TransitionType::StorageType>);
179 static_assert(std::is_same_v<TransitionType, TransitionType_>);
180 static_assert(std::is_same_v<ApplyHelperType, typename TransitionType::ApplyHelperType>);
181 static_assert(std::is_same_v<ApplyHelperType, std::monostate>);
182 static_assert(std::is_same_v<IsDeterministic, std::false_type>);
183 static_assert(std::is_same_v<
TransitionContainer, TransitionContainer_<std::pair<const TransitionType&, ApplyHelperType>>>);
185 static_assert(std::is_same_v<
OptionalHelpedTransition, std::optional<std::pair<const TransitionType&, ApplyHelperType>>>);
188 "StorageType should be a word.");
190 "TransitionType must be a derived class of FiniteStateMachineTransition");
223 return this->getMatchingTransitionsFromCurrentLetter(state, storage.front_opt());