K i ,GddZGddZy)ceZdZdZddZdZy)Statea- A representation of a state managed by a ``StateMachine``. Attributes: name (instance of FreeGroupElement or string) -- State name which is also assigned to the Machine. transisitons (OrderedDict) -- Represents all the transitions of the state object. state_type (string) -- Denotes the type (accept/start/dead) of the state. rh_rule (instance of FreeGroupElement) -- right hand rule for dead state. state_machine (instance of StateMachine object) -- The finite state machine that the state belongs to. NcP||_i|_||_|d|_||_y)N)name transitions state_machine state_typerh_rule)selfrrr r s m/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/combinatorics/rewritingsystem_fsm.py__init__zState.__init__ s+ *$Q- c"||j|<y)aZ Add a transition from the current state to a new state. Keyword Arguments: letter -- The alphabet element the current state reads to make the state transition. state -- This will be an instance of the State object which represents a new state after in the transition after the alphabet is read. N)r)r letterstates r add_transitionzState.add_transitions$) rNN)__name__ __module__ __qualname____doc__r rrr rrs  )rrc$eZdZdZdZddZdZy) StateMachinez Representation of a finite state machine the manages the states and the transitions of the automaton. Attributes: states (dictionary) -- Collection of all registered `State` objects. name (str) -- Name of the state machine. cT||_||_i|_|jddy)Nstarts)r )rautomaton_alphabetstates add_state)r rrs r r zStateMachine.__init__(s( "4  w3/rNc>t||||}||j|<y)ax Instantiate a state object and stores it in the 'states' dictionary. Arguments: state_name (instance of FreeGroupElement or string) -- name of the new states. state_type (string) -- Denotes the type (accept/start/dead) of the state added. rh_rule (instance of FreeGroupElement) -- right hand rule for dead state. N)rr)r state_namer r new_states r r zStateMachine.add_state.s"*dJ@ "+ Jrc d|jzS)Nz%s)r)r s r __repr__zStateMachine.__repr__;styy!!rr)rrrrr r r%rrr rrs0 ,"rrN)rrrrr r&s))<""r