ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc/__pycache__/FSA.cpython-311.pyc

�

�܋f���<�Gd�d��ZGd�de��ZdS)c�^�eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�ZdS)�FiniteAutomaton�c�v�||_||_|jii|_g|_g|_i|_d|_dS�N�)�start_state�
dump_state�table�unresolved_composites�resolved_composites�composite_memo�
is_updated)�selfrr	s   �`/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/guppy/etc/FSA.py�__init__zFiniteAutomaton.__init__sB��&���$����o�r�*��
�%'��"�#%�� � ��������c�Z�|\}}||j�|i��|<d|_dSr)r
�
setdefaultr)r�xxx_todo_changeme�x�state�symbols     r�__setitem__zFiniteAutomaton.__setitem__s2��+����34��
���e�R�(�(��0�����rc���t|��dkr	|d}n-|D]}||jvr
i|j|<�|�|��}||||f<||jvri|j|<dSdS)Nr�)�lenr
�
new_composite)rrr�nexts�c�ns      r�add_transitionzFiniteAutomaton.add_transitions����u�:�:��?�?��a��A�A��
'�
'���D�J�&�&�$&�D�J�q�M���"�"�5�)�)�A���U�F�]���D�J����D�J�q�M�M�M��rc�*�	t|j|�����}n#t$rYdSwxYwg}|D]N\}}t	|t
��r|D]}|�||f����7|�||f���O|S)N�)�listr
�items�KeyError�
isinstance�CompositeState�append)rrr�ris�k�v�vis       r�
get_row_itemszFiniteAutomaton.get_row_itemss���	��T�Z��&�,�,�.�.�/�/�A�A���	�	�	��2�2�	�������	#�	#�D�A�q��!�^�,�,�
#��(�(�B��J�J��2�w�'�'�'�'�(��
�
�A�q�6�"�"�"�"��
s�,/�
=�=c��|jr�|j}g|_|D]�}i}g}|D]F}|�|��D].\}}|�|g���|���/�Gt	|�����D]5\}}|D]-}||j|vr|�|j��n�.�6t	|�����D]\}}|j||g|�R����|j��dSdS�N)	rr.rr)r$r%r
r	r!)r�
compositesr�ds�l�ar+r,s        r�make_deterministicz"FiniteAutomaton.make_deterministic+s_���(�	2��3�J�)+�D�&��
2�
2�������7�7�A� $� 2� 2�1� 5� 5�7�7���1��
�
�a��,�,�3�3�A�6�6�6�6�7� ������,�,�"�"�D�A�q��"�"���D�J�q�M�1�1��H�H�T�_�5�5�5�!�E�2��!������,�,�2�2�D�A�q�'�D�'��1�1�q�1�1�1�1�1�2��(�	2�	2�	2�	2�	2rc�|�i}t|j�����D]\}}|D]
\}}d||<��|Sr)r$r
r%)r�symsr�transr+r,s      r�get_all_input_symbolsz%FiniteAutomaton.get_all_input_symbols?sX���� ���!1�!1�!3�!3�4�4�	�	�L�E�5��
�
���1���Q���
��rc��|jSr0)r
�rs r�get_all_stateszFiniteAutomaton.get_all_statesFs
���z�rc��iSr0r#r;s r�get_all_final_statesz$FiniteAutomaton.get_all_final_statesIs���	rc��|jr|���t|j�����Sr0)rr5r$r
�valuesr;s r�get_compositeszFiniteAutomaton.get_compositesLs;���?�	&��#�#�%�%�%��D�'�.�.�0�0�1�1�1rc�b�i}i}t|j�����D]�\}}t|�����}|���t|��}|�|��}|�g}|||<|�|��|||<��||fSr0)r$r
r%�keys�sort�tuple�getr))r�tc�tckr+r,r8�kss       r�get_transition_classesz&FiniteAutomaton.get_transition_classesQs���
�������)�)�+�+�,�,�		�		�D�A�q�������N�N�E��J�J�L�L�L��%�L�L�E�������B��z�����5�	��I�I�a�L�L�L��C��F�F��3�w�rc�J���d�}d�}��fd�}�jr7��������x}�_d�_n�j}|\}}t	|�����}|�|�j��}	|||	��}
||
��}|S)Nc�F�����fd��i�|D]8}t|��D]&\}}||dzd�D]}||v||vkrd�||f<��'�9t������D]�}|\}}||}||}	g}
|D]n}||}|	|}
||
urX||
f}|�vr|
�|���4|
|f}|�vr|
�|���R�|}�|=|dur�|��n0�o|
D],}�|}|dur	|g}|�|<�|�|���-���S)Nc�J��|D]}|�vr�|}�|=|r�|���dSr0r#)r3�pq�l1�PS�psrmarks   ��rrQzCFiniteAutomaton.get_minimized_dfa.<locals>.markall.<locals>.psrmarkcsK����(�(�B��R�x�x���V���r�F��(�#�G�B�K�K�K��(�(rrr#)�	enumerater$rCr))�finals�tcvr
�Q�ip�p�qrN�dp�dq�dpsr4�dpa�dqa�dpadqa�dqadpar3rPrQs                 @@r�markallz2FiniteAutomaton.get_minimized_dfa.<locals>.markallbs�����
(�
(�
(�
(�
(�
(��B��
,�
,��&�q�\�\�,�,�E�B���r�!�t�u�u�X�,�,����K�Q�&�[�9�9�)+�B��1�v�J��,�,�
�2�7�7�9�9�o�o�
)�
)�����1��1�X���1�X�����)�)�A��Q�%�C��Q�%�C��#�~�~�"%�s���!�R�<�<��J�J�v�.�.�.�.�&)�3�Z�F�%��|�|� #�
�
�6� 2� 2� 2� 2�$&�r�F��$&�r�F�#$�B�;�;�$+�G�A�J�J�J� %��&�#&�)�)���v�J����7�7�!#��A�)*�B�v�J�J��H�H�R�L�L�L�L���Irc���i}|D]
}|D]}|g||<�	�|D]\\}}||}||}||urCt|��t|��kr||}}|�|��|D]}|||<��]|Sr0)r�extend)�QS�PQS�eqsrUrWrX�ep�eqs        r�combinez2FiniteAutomaton.get_minimized_dfa.<locals>.combine�s����C��
!�
!���!�!�A��S�C��F�F�!��

$�

$���1���V����V���R�<�<��2�w�w��R���(�(�!#�R�B���I�I�b�M�M�M��$�$��!#��A�����Jrc���i}i}d}t|�����D]6}t|��}||vr!d|z}|dz
}|d|f||<|D]}|||<��7��|�j��}i|_t|�����D]\\}	}
ix|j|
<}t�j|	�����D]\}}||||<�|	�
vr
d|j|
<�]|S)NrzMS%dr)r$r@�id�	__class__r�final_statesr
r%)re�csbyid�csbyas�irg�ideqr�s�fsa�cs0�cstr8r4rSrs             ��r�finalizez3FiniteAutomaton.get_minimized_dfa.<locals>.finalize�s1����F��F��A��3�:�:�<�<�(�(�
&�
&���"�v�v���v�%�%���
�A���F�A�#%�a�5�!�8�F�4�L��&�&��$%��q�	�	���.�.���(8�!9�:�:�C�!�C�� ������1�1�
.�
.���S�)+�+��	�#��� ���C��!6�!6�!8�!8�9�9�)�)�D�A�q�%�a�y�E�!�H�H��&�=�=�,-�C�$�S�)���Jrr)rr5rJ�_tctckr$r@r
)rrSr`rhru�tctckrGrHrTrPrerrs``          r�get_minimized_dfaz!FiniteAutomaton.get_minimized_dfaas�����.	�.	�.	�`	�	�	�.	�	�	�	�	�	�4�?�	 ��#�#�%�%�%�"&�"=�"=�"?�"?�?�E�D�K��D�O�O��K�E����C��2�9�9�;�;����
�W�V�S�$�*�
-�
-���g�c�2�����h�s�m�m���
rc�J�tttd�|D�����������}t	|��dkr|dS	|j|S#t$r)||j|<|j�|��|cYSwxYw)Nc��g|]}|df��S)rr#)�.0�args  r�
<listcomp>z1FiniteAutomaton.new_composite.<locals>.<listcomp>�s��&@�&@�&@�C��Q�x�&@�&@�&@rrr)	r(r$�dictrCrr
r&rr))r�args�css   rrzFiniteAutomaton.new_composite�s���
�D��&@�&@�4�&@�&@�&@�!A�!A�!F�!F�!H�!H�I�I�
J�
J���r�7�7�a�<�<���7�N�	��&�r�*�*���	�	�	�&(�D���#��&�-�-�b�1�1�1��I�I�I�	���s�"A/�/0B"�!B"c���t|j�����}|���t	d�t|��D����}|D]�}|j|}t
d|||fz��t|�����}|���|D]%}||}t
d||||fz���&��dS)Nc��g|]	\}}||f��
Sr#r#)r{rorqs   rr}z&FiniteAutomaton.pp.<locals>.<listcomp>�s ��5�5�5�t�q�!�Q��F�5�5�5rz%d: %sz   %r  -> #%d: %s)r$r
rCrDr~rR�print)rrI�numrqr+r�rr,s        r�ppzFiniteAutomaton.pp�s���
�$�*�/�/�#�#�
$�
$��
���	�	�	��5�5�y��}�}�5�5�5�6�6���	<�	<�A��
�1�
�A��(�c�!�f�a�[�(�)�)�)��a�f�f�h�h���B��G�G�I�I�I��
<�
<���a�D���)�Q��A���N�:�;�;�;�;�
<�	<�	<rN)r)�__name__�
__module__�__qualname__rrr!r.r5r9r<r>rArJrxrr�r#rrrrs��������������
������2�2�2�(���������2�2�2�
��� n�n�n�`	�	�	�<�<�<�<�<rrc��eZdZdS)r(N)r�r�r�r#rrr(r(�s�������Drr(N)rrEr(r#rr�<module>r�sj��f<�f<�f<�f<�f<�f<�f<�f<�R	�	�	�	�	�U�	�	�	�	�	r

Zerion Mini Shell 1.0