ok

Mini Shell

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

�

�܋fZ^��4�ddlZddlmZddlmZGd�de��ZGd�d��ZeZ	Gd�d	e	��Z
d
�ZGd�de
��Zd
�Z
e	�ed��Zd�ZGd�de
��ZGd�de��Zd�Zd�Zd�d�d�gZd�ZGd�de
��ZGd�de��ZGd�de
��ZGd �d!e��ZGd"�d#e��Zd$�ZGd%�d&e��ZGd'�d(e��Zd)�ZGd*�d+��Z e��Z!d,�Z"dS)-�N)�chooserects)�iterpermutec��eZdZdS)�
InfiniteErrorN)�__name__�
__module__�__qualname__���_/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/guppy/etc/RE.pyrrs�������Drrc� �eZdZd�Zd�Zd�ZdS)�	WordsMemoc�>�||_||_i|_d|_dS�Nr)�re�ch�xs�N)�selfrrs   r�__init__zWordsMemo.__init__s"���������������rc�t�||jvr#|j�||��|j|<|j|S�N)rr�get_words_of_length_memoized�rrs  r�get_words_of_lengthzWordsMemo.get_words_of_lengths8���D�G�����=�=�a��F�F�D�G�A�J��w�q�z�rc��g}t|dz��D]0}|�|��}|r|�||f���1|S�N�)�ranger�append)rr�xsu�irs     r�get_words_of_length_uptoz"WordsMemo.get_words_of_length_uptosY��
���q��s���	$�	$�A��)�)�!�,�,�B��
$��
�
�A�r�7�#�#�#���
rN)rrr	rrr#r
rrrrsA������������
�
�
�
�
rrc��eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�ZdS)�REz.^$*+?{}\[]|()c��t|t��rt||��St|t	|����Sr)�
isinstancer%�concat�
Concatenation�Single��a�bs  r�__add__z
RE.__add__As8���a����	/��!�Q�<�<�� ��F�1�I�I�.�.�.rc��|s?|dkrt|��S|dkrt|��S|dkrt|��Std���)N)�*)�+)�?z8Argument to regular expression must be '*' or '+' or '?')�
KleeneClosure�PositiveClosure�EpsilonOrOne�
ValueError)r,�args�kwdss   r�__call__zRE.__call__Gse���	'��v�~�~�$�Q�'�'�'�����&�q�)�)�)�����#�A���&��F�H�H�	Hrc�H�t|jt|��f��Sr)�hash�_name�tuple�rs r�__hash__zRE.__hash__Rs���T�Z��t���-�.�.�.rc�b�|j|jkot|��t|��kSr�r<r=r+s  r�__eq__z	RE.__eq__Us,����1�7�"�%��a���E�!�H�H�$�	&rc��|j|jkr t|��t|��kS|j|jkSrrAr+s  r�__lt__z	RE.__lt__Ys7���7�a�g�����8�8�e�A�h�h�&�&��7�Q�W�$�$rc�"�t||��Sr)�Unionr+s  r�__or__z	RE.__or___s���Q��{�{�rc�B�d}|D]}||���z
}�|Sr��get_num_closures�r�nsrs   rrJzRE.get_num_closuresbs3��
���	(�	(�B��"�%�%�'�'�'�B�B��	rc�B�d}|D]}||���z
}�|Sr��get_num_symsrKs   rrOzRE.get_num_symshs1��
���	$�	$�B��"�/�/�#�#�#�B�B��	rc�B�d}|D]}||���z
}�|Sr��get_sum_sym_lengthsrKs   rrRzRE.get_sum_sym_lengthsns3��
���	+�	+�B��"�(�(�*�*�*�B�B��	rc�:�d�|D��}t||��S)Nc�6�g|]}|�����Sr
)�get_words_memo��.0�xs  r�
<listcomp>z%RE.get_words_memo.<locals>.<listcomp>us$��
/�
/�
/�Q�a��� � �
/�
/�
/r�r)rrs  rrUzRE.get_words_memots%��
/�
/�$�
/�
/�
/����r�"�"�"rc�T�|���}|�|��Sr)rUr)rrrs   rrzRE.get_words_of_lengthxs'��
�
 �
 �
"�
"���%�%�a�(�(�(rc�0��|j�fd�|D���S)Nc�&��g|]
}�|����Sr
r
�rWrX�fs  �rrYz"RE.mapchildren.<locals>.<listcomp>}s!���3�3�3����!���3�3�3r)�	__class__�rr_s `r�mapchildrenzRE.mapchildren|s'����t�~�3�3�3�3�d�3�3�3�4�4rc�6�|�t��Sr)�
mappedrepr�
regexpnamer>s r�
regexpformz
RE.regexpforms�����z�*�*�*rc�.�|�d���S)Nc�*�|���Sr��reversed�rXs r�<lambda>zRE.reversed.<locals>.<lambda>�s��!�*�*�,�,�r)rbr>s rrjzRE.reversed�s����� 6� 6�7�7�7rc�$���fd���|��S)Nc����t|t��r9|tur.t|dt��r|dd�}t|�S|S|����S�Nrr)r'�Seq�Epsilonr=rb)rX�wsr_s  �rr_zRE.rempretup.<locals>.f�s`����!�S�!�!�
��G�#�#�
�1�Q�4��(?�(?�#��1�2�2��B���8�O��H��=�=��#�#�#rr
ras @r�	rempretupzRE.rempretup�s+���	$�	$�	$�	$�	$��q��w�w�rc�>�g}|�|j��|Sr)�
apseqatomsr )r�sas  r�seqatomszRE.seqatoms�s ��
������	�"�"�"��	rc�V���i�g���fd�}|�|��t��S)Nc�H��|�vrd�|<��|��dSdSr�r )rX�d�uss ��r�apzRE.sequni.<locals>.ap�s/�����z�z���!���	�	�!�������zr)�apseqrF)rr}r{r|s  @@r�sequniz	RE.sequni�sG������
��	�	�	�	�	�	�	
�
�
�2�����b�z�r� c��|�t��}|dkr(|�|�d����}|S)Nr�)rdre�join�split)r�conc�rs   r�shformz	RE.shform�s<���O�O�J�'�'���3�;�;��	�	�!�'�'�#�,�,�'�'�A��rc��|Srr
�rr,�ks   r�
simplifiedz
RE.simplified�����rc�2�d�}|�|��S)Nc�0�|dkrdSt|��S)N��())�strrks rr_zRE.simulform.<locals>.f�s���B�w�w��t��q�6�6�Mr)rdras  r�	simulformzRE.simulform�s%��	�	�	����q�!�!�!rN)r�)rrr	�_re_specialr.r9r?rBrDrGrJrOrRrUrrbrfrjrsrwrr�r�r�r
rrr%r%(sO������.$�K�/�/�/�	H�	H�	H�/�/�/�&�&�&�%�%�%�������������#�#�#�)�)�)�5�5�5�+�+�+�8�8�8�
�
�
����
	�	�	��������"�"�"�"�"rr%c��|dkrdStj}g}t|��D] }||dzvrd}|�|���!d�|��S)Nr�r�z', )r%r�r�r r�)�s�special�ren�cs    rrere�sf���B�w�w��t��n�G�
�C�
��V�V�������
����A��
�
�1�
�
�
�
�
�7�7�3�<�<�rc�d�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�ZdS)rprc�J�|stSt�||��Sr)rq�REBASE�__new__)�clas�symbolss  rr�zSeq.__new__�s#���	��N��~�~�d�G�,�,�,rc�`�|jj�dd�d�|D�����d�S)N�(z, c��g|]}|���Sr
r
rVs  rrYz Seq.__repr__.<locals>.<listcomp>�s��>Y�>Y�>Y�q�q�q�>Y�>Y�>Yr�))r`rr�r>s r�__repr__zSeq.__repr__�s:���>�2�2�2�D�I�I�>Y�>Y�TX�>Y�>Y�>Y�4Z�4Z�4Z�4Z�[�[rc��||��dSrr
�rr}s  rr~z	Seq.apseq����
��4�����rc�@�|D]}|t|�����dSr)r*�rr}rXs   rruzSeq.apseqatoms�s0���	�	�A��B�v�a�y�y�M�M�M�M�	�	rc��dSrr
r>s rrJzSeq.get_num_closures�s���qrc� �t|��Sr��lenr>s rrOzSeq.get_num_syms�s���4�y�y�rc�R�d}|D]!}|tt|����z
}�"|Sr)r�r�)rr�rXs   rrRzSeq.get_sum_sym_lengths�s3��
���	�	�A�
��S��V�V����A�A��rc�"�t|d��S)Nr
rZr>s rrUzSeq.get_words_memo�s����r�"�"�"rc�2�|t|��kr|gSgSrr��rr�memos   rrz Seq.get_words_of_length_memoized�s����D�	�	�>�>��6�M��Irc��|Srr
rs  r�limitedzSeq.limited�r�rc�`��|s�d��Sd��fd�|D����S)Nr�r�c�(��g|]}�|�����Sr
r
r^s  �rrYz"Seq.mappedrepr.<locals>.<listcomp>�s#���6�6�6�A���1����6�6�6r)r�ras `rrdzSeq.mappedrepr�s?����	��1�R�5�5�L��x�x�6�6�6�6��6�6�6�7�7�7rc�\�t|��}|���|j|�Sr)�list�reverser`�rr�s  rrjzSeq.reversed�s)����J�J��	�	�	�����t�~�q�!�!rc��|gSrr
r>s r�
unionsplittedzSeq.unionsplitted��	���v�
rN)rrr	�	_priorityr<r�r�r~rurJrOrRrUrr�rdrjr�r
rrrprp�s��������I��E�-�-�-�
\�\�\����������������#�#�#�������8�8�8�
"�"�"�
����rrpc�D�t�t|f��Sr)r�r�rp)�symbols rr*r*�s���>�>�#��y�)�)�)rr
c��d�|D��}t|��dkr|stS|dSt�t|��S)Nc�$�g|]
}|tu�|��Sr
)rqrVs  rrYzconcat.<locals>.<listcomp>s"��0�0�0�!�q��/�/�A�/�/�/r�r)r�rqr�r�r))r7s rr(r(�sN��0�0�t�0�0�0�D�
�4�y�y�1�}�}��	��N��A�w���>�>�-��.�.�.rc�R�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
S)r)r��Concatc��t|��dkr|stS|dSt�||��S)Nr�r)r�rqr�r��r�r7s  rr�zConcatenation.__new__s;���t�9�9�q�=�=��
�����7�N��~�~�d�D�)�)�)rc��g}|D]0}|�}|j|jkrd|�d�}|�|���1d�|��S)Nr�r�z + �r�r r��r�rsrr�s    rr�zConcatenation.__repr__s[��
���	�	�B���A��|�d�n�,�,�,��a�a�M���I�I�a�L�L�L�L��z�z�"�~�~�rc��d�|D��}dgt|��z}	g}t|��D]4\}}|||D] }|tur|�|���!�5|t	|���d}t|��D]2\}}	|	dz
}	|	t||��krd}	|	||<|	dkrn�3dS��)Nc�6�g|]}|�����Sr
)rrVs  rrYz'Concatenation.apseq.<locals>.<listcomp>s ��(�(�(�a�q�x�x�z�z�(�(�(rrr)r��	enumeraterqr rp)
rr}�uns�ixsrr"r|rX�j�ixs
          rr~zConcatenation.apseqs���(�(�4�(�(�(���c�#�c�(�(�l��	��B�$�S�>�>�
%�
%���B��C��F��%�%�A���'�'��	�	�!�����%�
�B�s�B�x�L�L�L��A�"�3���
�
���2��a�����S��V���$�$��B���A����7�7��E����!	rc�:�|D]}|�|���dSr�rur�s   rruzConcatenation.apseqatoms1�0���	�	�A�
�L�L������	�	rc�������g�|jD]*}��|�������+g�i������fd���gdd���S)Nc���|t�	��krC|�kr9t|�D]1}t|��}|�
vr��|��d�
|<�0dSdS�	|D]%\}}||z�kr�||gz|dz||z���&dSr)r�r�simple_Concatenationr )�xxr"�n�toconcr��mrXr�ads�chxs�seenrs       �����rr�z7Concatenation.get_words_of_length_memoized.<locals>.ads<s�����C��I�I�~�~���6�6�"-�r�"2�+�+��3�F�;�;���t�+�+��I�I�d�O�O�O�)*�D��J���6�+�+�!��G�4�4�D�A�q��1�u��z�z���B�!��H�a�!�e�Q��U�3�3�3��4�4rr)rr r#)rrr�rr�r�r�rs `  @@@@rrz*Concatenation.get_words_of_length_memoized5s�����������'�	8�	8�B��K�K��3�3�A�6�6�7�7�7�7�
����	4�	4�	4�	4�	4�	4�	4�	4�	4�	��B��1�
�
�
��	rc�.��t�fd�|D���S)Nc�:��g|]}|������Sr
�r��rWrXrs  �rrYz)Concatenation.limited.<locals>.<listcomp>Ms#���:�:�:��q�y�y��|�|�:�:�:r)r)rs `rr�zConcatenation.limitedLs#����:�:�:�:�T�:�:�:�;�;rc��g}|D]B}|�|��}|j|jkrd|�d�}|�|���Cd�|��S)Nr�r�r��rdr�r r��rr_r�rr�s     rrdzConcatenation.mappedreprOse��
���	�	�B��
�
�a� � �A��|�d�n�,�,�,��a�a�M���I�I�a�L�L�L�L��x�x��|�|�rc�V�d�|D��}|���|j|�S)Nc�6�g|]}|�����Sr
rirVs  rrYz*Concatenation.reversed.<locals>.<listcomp>Ys ��(�(�(�a�Q�Z�Z�\�\�(�(�(r)r�r`r�s  rrjzConcatenation.reversedXs1��(�(�4�(�(�(��	�	�	�����t�~�q�!�!rc������fd�|D��}g}|D].}|���D]�|������/t|��S)Nc�*��g|]}|j�i�����Sr
�r�)rWrXr,r�s  ��rrYz,Concatenation.simplified.<locals>.<listcomp>^s*���4�4�4�!����a�%�1�%�%�4�4�4r)rwr r�)rr,r�r�rvr�s ``   rr�zConcatenation.simplified]so����4�4�4�4�4�t�4�4�4��
���	�	�A��Z�Z�\�\�
�
���	�	�!�����
�#�B�'�'�'rc���g}g}t|��D]C\}}|���}t|��dkr|�||f���D|s|gSdgt|��z}t	|��}	g}d}	t|��D]M\}
\}}|�||	|���||
}|�||��|dz}	�N|�||	d���|�t
|���d}
t|��D]8\}
}|dz
}|t||
d��krd}|||
<|dkrn�9|S��Nrr)r�r�r�r r��extendr()r�runsr�r"rXr|r�rr�i0r�r�s            rr�zConcatenation.unionsplittedes���������o�o�	$�	$�F�Q�����"�"�B��2�w�w��{�{��
�
�A�r�7�#�#�#���	��6�M��c�#�c�(�(�l��
�$�Z�Z��	��B��B�'��n�n�
�
�
��7�A�r��	�	�"�R��T�(�#�#�#���V���	�	�"�R�&�!�!�!���U����I�I�b����g�����K�K����$�$�$��A�"�3���
�
���2��a�����S��V�A�Y���'�'��B���A����7�7��E����)	rN)rrr	r�r<r�r�r~rurr�rdrjr�r�r
rrr)r)s��������I��E�*�*�*�������*������.<�<�<����"�"�"�
(�(�(�����rr)c��eZdZd�ZdS)�SimplifiedConcatenationc��|Srr
r�s   rr�z"SimplifiedConcatenation.simplified�r�rN�rrr	r�r
rrr�r���#����������rr�c��i}g}d}|D]k}|�e|jdkr|d|krt|��}n>|jdkr|d|krt|��}n|�|�|��|}�l|�|�|��|S)Nr0r)r<r4r )r�r��nconc�w0�ws     r�
conclosurer��s���
�D��E�	
�B�
����
�>���3����a�D�B�J�J�#�B�'�'����(�c�/�/��Q�%�1�*�*�#�A�&�&����>��L�L��$�$�$�
���	�~�
���R�����Lrc��t|��dkr|}t|��}g}d}d}|t|��k�r||}t|t��s|dz
}|�|���L|}|t|��kr4t||t��sn|dz
}|t|��k�4||dzkr|�|��n[g}t||��D],}||}|�t|�����-|�t|���|}|t|��k��t|��dkr	t|�S|r|dStSr�)
r�r�r'rpr rr�r�r)rq)r��conc0r�r"r��e�symsr�s        rr�r��s|��
�4�y�y�1�}�}����$�����E�	�A�	�A�
�c�$�i�i�-�-���G���!�S�!�!�	�
��F�A��L�L��O�O�O��
���#�d�)�)�m�m��d�1�g�s�+�+�
��
��F�A��#�d�)�)�m�m�
��A��:�:��L�L��O�O�O�O��D��1�a�[�[�
%�
%����G�����D��G�G�$�$�$�$��L�L��d��$�$�$�
��'�c�$�i�i�-�-�(�5�z�z�A�~�~��e�$�$�	���Q�x���rc�*�|���SrrNrks rrlrl�s��Q�^�^�
�
�rc�*�|���SrrIrks rrlrl�s��Q�
�
�
!�
!�rc�*�|���SrrQrks rrlrl�s��Q�
"�
"�
$�
$�rc�*�t|t��}d}	t|��dkr\|djdkst|dj��dkr-g}|djD]}|r|�|���d}�n�g}|D]�}|���}|���}t|��}|tur|j
dkr|g|z}n||gz}|r|�|��nd}t|dt��rJ���t|t��}��t|��dkrd�|D��}	t|	�}n|rt|d��}nd}|r|�t|��}nt}|S)Nrr���c�,�g|]}t|����Sr
)r�)rW�lines  rrYzsimpleunion.<locals>.<listcomp>�s!��9�9�9�d�#�D�)�)�9�9�9r)r�gaugesr��width�linesr �get_common_part�
get_uncommons�simpleunionrq�dirr'r��SimplifiedUnionr��simple_EpsilonOrOne)
r�choosen�have_epsilonr|rr�r��olines�u�nuss
          rr	r	�s����%��(�(�G��L�*��w�<�<�1���'�!�*�"2�a�"7�"7�3�w�q�z�?O�;P�;P�TU�;U�;U��B���
�(�
%�
%���%��I�I�d�O�O�O�O�#$�L�L��
���
	/�
	/�A��$�$�&�&�D��_�_�&�&�F��F�#�#�A������5�B�;�;��3�t�8�D�D��1�#�:�D��
!��	�	�$����� ��!�"�R�&�#�.�.�.�.�.�.��b�&�)�)��3*�6�2�w�w��{�{�9�9�b�9�9�9���S�!���	�� ��A��'�'��������=�#�A�&�&�A�A��A��Hrc�N�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zdd
�Zd�Z
d	S)
rF�c�8�t�||��Sr�r�r�r�s  rr�z
Union.__new__s���~�~�d�D�)�)�)rc��g}|D]/}|�}|j|jkrd|z}|�|���0d�|��S�N�(%s)� | r�r�s    rr�zUnion.__repr__sV��
���	�	�B���A��|�d�n�,�,��Q�J���I�I�a�L�L�L�L��z�z�"�~�~�rc�:�|D]}|�|���dSr)r~)rr}r�s   rr~zUnion.apseq
s,���	�	�A�
�G�G�B�K�K�K�K�	�	rc�:�|D]}|�|���dSrr�r�s   rruzUnion.apseqatomsr�rc��g}i}|jD]8}|�|��D] }||vrd||<|�|���!�9|Sr)rrr )rrr�rr�rrXs       rrz"Union.get_words_of_length_memoizedsh��
�����'�	!�	!�B��+�+�A�.�.�
!�
!���D�=�=��D��G��I�I�a�L�L�L��
!��	rc�z���fd�|D��}t|��D]\}}|||ur|j|�cS�|S)Nc�:��g|]}|������Sr
r�r�s  �rrYz!Union.limited.<locals>.<listcomp> s#���*�*�*��q�y�y��|�|�*�*�*r)r�r`)rr�unir"rXs `   rr�z
Union.limitedsc���*�*�*�*�T�*�*�*���c�N�N�	,�	,�D�A�q���Q����%�t�~�s�+�+�+�+� ��rc��g}|D]B}|�|���}|j|jkrd|z}|�|���Cd�|��Srr�r�s     rrdzUnion.mappedrepr&sc��
���	�	�B��
�
�a�(�(�(�A��|�d�n�,�,��Q�J���I�I�a�L�L�L�L��z�z�"�~�~�rNc�x�|�d�|���D��}d�|D��}t|��S)Nc�6�g|]}|�����Sr
r�rVs  rrYz$Union.simplified.<locals>.<listcomp>1s ��A�A�A�q�A�L�L�N�N�A�A�Arc�6�g|]}|�����Sr
)rw)rWr,s  rrYz$Union.simplified.<locals>.<listcomp>7s ��
)�
)�
)�q�a�j�j�l�l�
)�
)�
)r)r�r	)rr7r,r�rs     rr�zUnion.simplified/sG���<�A�A�D�,>�,>�,@�,@�A�A�A�D�*�
)�D�
)�
)�
)���2���rc�|�g}|D]6}|�t|��������7|Sr)r�r�r�)rr|rXs   rr�zUnion.unionsplitted:sB��
���	/�	/�A��I�I�d�1�?�?�,�,�-�-�.�.�.�.��	rr)rrr	r�r<r�r�r~rurr�rdr�r�r
rrrFrF�s��������I��E�*�*�*�������������������	�	�	�	�����rrFc��eZdZd�ZdS)rc��|Srr
r�s   rr�zSimplifiedUnion.simplifiedBr�rNr�r
rrrrAr�rrc�6�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�Calledrc�:�t�||f��Srr)r��args  rr�zCalled.__new__Is���~�~�d�S�F�+�+�+rc�\�|d}|�}|j|jkrd|z}|�d|j�d�S)Nrrr�r�)r�r<)rrr�s   rr�zCalled.__repr__Ls?��
�!�W���B��
�<�$�.�(�(���
�A��1�1�d�j�j�j�)�)rc��||��dSrr
r�s  rruzCalled.apseqatomsSr�rc�<�d|d���zSr�rIr>s rrJzCalled.get_num_closuresVs���4��7�+�+�-�-�-�-rc���|d}|�|��}|j|jks(t|t��rt	|��dkrd|z}|�|j��S)Nrrr)rdr�r'rpr�r<)rr_rr�s    rrdzCalled.mappedreprYsf��
�!�W���M�M�!�����L�4�>�)�)��b�#�&�&�
*�+.�r�7�7�Q�;�;���
�A���D�J�J�'�'rc�N�|�|dj|i|����Sr)r`r�r�s   rr�zCalled.simplifiedas+���~�~�0�d�1�g�0�!�9�q�9�9�:�:�:rN)
rrr	r�r�r�rurJrdr�r
rrr(r(Fss�������I�,�,�,�*�*�*����.�.�.�(�(�(�;�;�;�;�;rr(c��eZdZd�Zd�ZdS)�Closurec���|dkrtgS|dkr |jd�d��Sg}i}td|��D]h}|�|��}|�||z
��}|D]6}|D]1}	t	||	f��}
|
|vr|�|
��d||
<�2�7�i|jd�|��D] }||vr|�|��d||<�!|Sro)rqrrrr�r )rrr�rr�r"r,r-�ai�bi�aibirXs            rrz$Closure.get_words_of_length_memoizedfs*����6�6��9����6�6��7�1�:�1�1�!�4�4�4�
�����q�!���	'�	'�A��(�(��+�+�A��(�(��1��-�-�A��
'�
'���'�'�B�/��R��9�9�D��4�'�'��	�	�$����%&��T�
��	'�
'�����/�/��2�2�	�	�A���}�}��	�	�!������Q����	rc��|gSrr
r>s rr�zClosure.unionsplitted|r�rN)rrr	rr�r
rrr1r1es2���������,����rr1c�$�eZdZdZd�Zd�Zd�ZdS)r3r0c� �td���)Nz@apseq: Regular expression is infinite: contains a Kleene Closure�rr�s  rr~zKleeneClosure.apseq�s���N�P�P�	Prc���|dkrtS|d�|��}g}t|dz��D]$}|g|z}|�t	|����%t|�Sro)rqr�rr r)rF)rr�clrr"r�s      rr�zKleeneClosure.limited�sr����6�6��N�
�!�W�_�_�Q�
�
�����q��s���	/�	/�A��T�!�V�F��J�J�}�f�-�.�.�.�.��c�{�rc�B�t|dj|i|����Sr)�simple_KleeneClosurer�r�s   rr�zKleeneClosure.simplified�s'��#�$6�D��G�$6��$?�Q�$?�$?�@�@�@rN)rrr	r<r~r�r�r
rrr3r3�sN�������E�P�P�P����A�A�A�A�Arr3c�`�|jdkrt|d��St|��S)Nr1r)r<r=r3rks rr=r=�s-���w�#�~�~�#�A�a�D�)�)�)�����rc�*�eZdZdZd�Zd�Zd�Zd�ZdS)r4r1c� �td���)NzBapseq: Regular expression is infinite: contains a Positive Closurer9r�s  rr~zPositiveClosure.apseq�s���P�R�R�	Rrc��|d�|��t|d���|��dSr)rur=r�s  rruzPositiveClosure.apseqatoms�s@���Q����2�����T�!�W�%�%�0�0��4�4�4�4�4rc��|dkr |jd�|��St�|||��Sr�)rrr1rr�s   rrz,PositiveClosure.get_words_of_length_memoized�s=����6�6��7�1�:�1�1�!�4�4�4��3�3�D�!�T�B�B�Brc��|d�|��}t|d���|��}t||��Sr)r�r3r))rrr,r-s    rr�zPositiveClosure.limited�sF����G�O�O�A�����$�q�'�"�"�*�*�1�-�-���Q��"�"�"rN)rrr	r<r~rurr�r
rrr4r4�s[�������E�R�R�R�5�5�5�C�C�C�
#�#�#�#�#rr4c�0�eZdZdZd�Zd�Zd�Zd�Zd�ZdS)r5r2c�\�|t��|d�|��dSr)rqr~r�s  rr~zEpsilonOrOne.apseq�s+��
��7�����Q��
�
�b�����rc�^�|dkrtgS|jd�|��Sr)rqrrr�s   rrz)EpsilonOrOne.get_words_of_length_memoized�s-����6�6��9���w�q�z�-�-�a�0�0�0rc�z�|d�|��}||dur|�|��}|Sr)r�r`)rrrXs   rr�zEpsilonOrOne.limited�s<����G�O�O�A�����D��G����>�>�!�$�$�D��rc�B�t|dj|i|����Sr)rr�r�s   rr�zEpsilonOrOne.simplified�s'��"�#5�4��7�#5�q�#>�A�#>�#>�?�?�?rc�b�tgt|d�����zSr)rqr�r�r>s rr�zEpsilonOrOne.unionsplitted�s'���y�4��Q�� 5� 5� 7� 7�8�8�8�8rN)	rrr	r<r~rr�r�r�r
rrr5r5�sg�������E����1�1�1�
���@�@�@�9�9�9�9�9rr5c�n�|jdkrt|��S|jdkr|St|��S)Nr1r0)r<r=r5rks rrr�s;��	�w�#�~�~�#�A�&�&�&�	�w�#�~�~�����?�?�rc�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�
RegularSystemc�>�||_||_d|_||_dS)N� 358f0eca5c34bacdfbf6a8ac0ccf84bc)�table�Start�Final�final_states)rrOrPrRs    rrzRegularSystem.__init__�s%����
���
�7��
�(����rc	�����fd�}d�}�����j}�jg�jz}|��j��|D]�}||vr�t
||��d�d�d���||}g}|D]8}||vr2|�|||���d||�������9|r#t
d�|������t
����dS)Nc�d��	�j|}n#t$rt|��}YnwxYw|Sr)�names�KeyErrorr�)�state�namers  �r�	statenamez#RegularSystem.pp.<locals>.statename�sE���
"��z�%�(�����
"�
"�
"��5�z�z����
"�����Ks�
�-�-c�P�|���}|jdkrd|�d�}|S)Nrr�r�)r�r�)�transrXs  r�	transnamez#RegularSystem.pp.<locals>.transname�s2���?�?�$�$�D����"�"�"�!%���'���Krz>3z = r�)�endr)�setup_names�XrP�orderr rQ�printr�)	rrYr\r_r�Xk�Tk�es�Xjs	`        r�ppzRegularSystem.pp�s?���	�	�	�	�	�	�	�	�	
�������F���j�\�$�*�
$��
�	�	�$�*�����	�	�B���{�{���i�i��m�m�m�m�m�-�3�7�7�7�7��2��B��B��
L�
L����8�8��I�I���2�b�6�):�):�):�):�I�I�b�M�M�M�J�K�K�K���
��e�j�j��n�n�%�%�%�%������	�	rc�B�|j}|j}|j}|iix|_}t	|�����D]�\}}ix||<}t	|�����D];\}}	|�|	g���t|�����<t	|�����D]C\}	}
t|
��dkr|
�
��t|
�}
n|
d}
|
||	<�D||vr
t||<��dSr�)
rOrRrQr_r��items�
setdefaultr r*r��sortrFrq)rrOrRrQr_�Xi�transitions�Tir�re�Aijs           r�setup_equationszRegularSystem.setup_equationss'���
���(���
���R�[� ����#�E�K�K�M�M�2�2�	$�	$�O�B���O�A�b�E�B� $�[�%6�%6�%8�%8� 9� 9�
=�
=�����
�
�b�"�%�%�,�,�V�F�^�^�<�<�<�<�����
�
�+�+�
�
���C��s�8�8�a�<�<��H�H�J�J�J���+�C�C��a�&�C���2����\�!�!�#��5�	��	$�	$rc������	�
�d�}�fd�}�fd��
��	�
fd�}|g�	|j�|j�|j�|�������fd��D��}|�t	j|�����||_dS)Nc��d}||i}|g}|r>|}g}|dz
}|D]0}||vr�||D] }||vr|�|��|||<�!�1|�>|Srorz)r_�startr"�S�news�oldnewsr��ts        r�distsz(RegularSystem.setup_order.<locals>.distss����A���
�A��7�D��

%������Q��� �%�%�A���z�z� ��q�T�%�%���A�:�:� �K�K��N�N�N�#$�A�a�D��%��

%��Hrc����|Srr
)rX�start_distss �r�start_distancez1RegularSystem.setup_order.<locals>.start_distance(s
����q�>�!rc�����i����fd�}|S)Nc�`��|�vr�|Sd}�|D]}|�|��z
}�|�|<|S)Ngr
)rXr��yr_r_r�s   ���r�gz2RegularSystem.setup_order.<locals>.sumt.<locals>.g.sN�����9�9���7�N����1����A����1���I�A�A���Q���rr
)r_r~r�r_s` @�r�sumtz'RegularSystem.setup_order.<locals>.sumt+s4������D�
�
�
�
�
�
�
��Hrc�j��||urdSt�|��t�|��z
}|r|Sd}|dkri	�|}n9#t$r,��|dz
��}��|��YnwxYw||��||��z
}|r|S|dz
}|dk�i||k||kz
S)Nr�
r)r��
IndexErrorr )rXr}r�r"r_r_�sumdistsrs     ���r�cmp3z'RegularSystem.setup_order.<locals>.cmp38s�����A�v�v��q��A�a�D�	�	�C��!��I�I�%�A��
����A��b�&�&�'� ���A�A��!�'�'�'���X�a��c�]�+�+�A��O�O�A�&�&�&�&�&�'�����A�a�D�D�1�1�Q�4�4�K�����H��Q����b�&�&���E�a�!�e�$�$s�A	�	3A?�>A?c�$��g|]}|�u�|�u�
|��
Sr
r
)rWrXrQrPs  ��rrYz-RegularSystem.setup_order.<locals>.<listcomp>Xs&���M�M�M�q�1�E�>�>�a�u�n�n��n�n�nr)�key)r_rPrQrj�	functools�
cmp_to_keyr`)rrwrzr�r`rQrPr_ryr�rs     @@@@@@r�setup_orderzRegularSystem.setup_orders���������	�	�	�"	"�	"�	"�	"�	"�	�	�	�	�	�	%�	%�	%�	%�	%�	%�	%�6#�#���F���
���
���e�A�u�o�o��M�M�M�M�M�K�M�M�M��
�
�
�y�+�D�1�1�
�2�2�2���
�
�
rc��	|jn$#t$r|���YnwxYwi|_d|j|j<t|j��D]\}}d|dzz|j|<�d|j|j<dS)N�X0zX%drrQ)r`�AttributeErrorr�rUrPr�rQ)rr"r�s   rr^zRegularSystem.setup_names\s���	��J�J�J���	�	�	���������	������
�!%��
�4�:���d�j�)�)�	*�	*�D�A�q�!�Q�q�S�M�D�J�q�M�M�!(��
�4�:���s�
�+�+c��|���|���|j}|j}|j}t|j��}|r�|���}||}||vrG||}||=|d��}t|�����D]\}	}
||
z}|||	<�||=t|�����D]m\}}
|
�	|��}|��|
|=t|�����D]+\}}||z}|
�	|��}|�||z}||
|<�,�n|��|||S)Nr0)
ror�r_rPrQr�r`�poprh�get)rr_rPrQ�todorbrc�Akk�AkkStarrk�Aki�Bkire�Tj�Bjk�Xji�Tk_Xji�Cji�Bjis                   r�solvezRegularSystem.solvehs���	
�������������F���
���
���D�J�����'	"������B��2��B��R�x�x���f���r�F��#�c�(�(��#�B�H�H�J�J�/�/�!�!�G�B��!�C�-�C� �B�r�F�F�
�"���q�w�w�y�y�/�/�

"�

"���B��f�f�R�j�j���;���r�F�#'����
�
�#3�#3�"�"�K�C����<�C��&�&��+�+�C���!�C�i��!�B�s�G�G�"�E�'	"�X��x���rN)	rrr	rrfror�r^r�r
rrrLrL�ss������)�)�)�!�!�!�F$�$�$�&D�D�D�L
)�
)�
)�9�9�9�9�9rrLc�j�t|j|j|j��}|���Sr)rLrO�start_staterRr�)�fsa�RSs  r�SolveFSAr��s(��	�s�y�#�/�3�3C�	D�	D�B�
�8�8�:�:�r)#r��guppy.etc.RE_Rectr�guppy.etc.IterPermuter�	Exceptionrrr=r�r%rerpr*r�rqr(r)r�r�r�rr	rFrr(r1r3r=r4r5rrL�Nothingr�r
rr�<module>r�s�������)�)�)�)�)�)�-�-�-�-�-�-�	�	�	�	�	�I�	�	�	���������4
��G"�G"�G"�G"�G"��G"�G"�G"�T
�
�
�6�6�6�6�6�"�6�6�6�r*�*�*��.�.��b�
!�
!��/�/�/�|�|�|�|�|�B�|�|�|�~�����m����
���2 � � �H��!�!�$�$�
��+
�+
�+
�\A�A�A�A�A�B�A�A�A�H�����e����
;�;�;�;�;�R�;�;�;�>�����f����6A�A�A�A�A�G�A�A�A�*���#�#�#�#�#�g�#�#�#�,9�9�9�9�9�6�9�9�9�2
�
�
�I�I�I�I�I�I�I�I�X�%�'�'������r

Zerion Mini Shell 1.0