예제 #1
0
파일: dfa.py 프로젝트: sunx2/automata
 def _validate_transition_start_states(self):
     """Raise an error if transition start states are missing."""
     for state in self.states:
         if state not in self.transitions:
             raise exceptions.MissingStateError(
                 'transition start state {} is missing'.format(
                     state))
예제 #2
0
 def _validate_initial_state_transitions(self):
     """Raise an error if the initial state has no transitions defined."""
     if self.initial_state not in self.transitions:
         raise exceptions.MissingStateError(
             'initial state {} has no transitions defined'.format(
                 self.initial_state))