/opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc/__pycache__/KnuthBendix.cpython-311.pyc (13176B)
§
eéä(îÒÓ0ã ód — d Z ddlZ G d„ d¦ « Zd„ Zd„ Z G d„ d¦ « Zd „ Zd
„ Zd„ ZdS )a¥
An implementation of the Knuth-Bendix algorithm,
as described in (1), p. 143.
For determining if two paths in a category are equal.
The algorithm as given here,
takes a set of equations in the form of a sequence:
E = [(a, b), (c, d) ...]
where a, b, c, d are 'paths'.
Paths are given as strings, for example:
E = [ ('fhk', 'gh'), ('m', 'kkm') ]
means that the path 'fhk' equals 'gh' and 'm' equals 'kkm'.
Each arrow in the path is here a single character. If longer arrow
names are required, a delimiter string can be specified as in:
kb(E, delim='.')
The paths must then be given by the delimiter between each arrow;
E = [ ('h_arrow.g_arrow', 'g_arrow.k_arrow') ... ]
The function kb(E) returns an object, say A, which is
o callable: A(a, b)->boolean determines if two paths given by a, b are equal.
o has a method A.reduce(a)->pathstring, which reduces a path to normal form.
An optional parameter to kb, max_iterations, determines the maximum
number of iterations the algorithm should try making the reduction
system 'confluent'. The algorithm is not guaranteed to terminate
with a confluent system in a finite number of iterations, so if the
number of iterations needed exceeds max_iterations an exception
(ValueError) will be raised. The default is 100.
References
(1)
@book{walters91categories,
title={Categories and Computer Science},
author={R. F. C. Walters},
publisher={Cambridge University Press},
location={Cambridge},
year=1991}
(2)
@book{grimaldi94discrete,
author="Ralph P. Grimaldi".
title="Discrete and Combinatorial Mathematics: An Applied Introduction",
publisher="Addison-Wesley",
location="Readin, Massachusetts",
year=1994
}
é Nc óH — e Zd Zd
d„Zd„ Zd„ Zd„ Zd„ Zd„ Zdd
„Z d„ Z
d„ Zd S )ÚKnuthBendixÚ éd c óH — g | _ || _ |D ]g\ }}|r*| |¦ « }| |¦ « }| ||¦ « r||}}| j ||f¦ « Œh| |¦ « | ¦ « d S ©N)Ú
reductionsÚdelimÚ
wrap_delimÚgtÚappendÚmake_confluentÚsort)ÚselfÚEr
Úmax_iterationsÚaÚbs úi/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib64/python3.11/site-packages/guppy/etc/KnuthBendix.pyÚ__init__zKnuthBendix.__init__D s¬ € ؈ŒØˆŒ
Øð +ð +‰DˆAˆqØð
'Ø—O’O AÑ&Ô&�Ø—O’O AÑ&Ô&�Ø�wŠw�q˜!‰}Œ}ð
ؘ!�1�ØŒO×"Ò" A q 6Ñ*Ô*Ð*Ð*Ø×Ò˜NÑ+Ô+Ð+Ø� Š ‰Œˆˆˆó c óZ — | |¦ « | |¦ « k S r ©Úreduce)r ÚxÚys r Ú__call__zKnuthBendix.__call__Q s! € Ø�{Š{˜1‰~Œ~ §¢¨Q¡¤Ò/Ð/r c óÒ — | j }|rt |¦ « }t |¦ « }n*| |¦ « }| |¦ « }||k rdS ||k rdS ||k S )Né r )r
ÚlenÚcount)r r r r
ÚlaÚlbs r r zKnuthBendix.gtT sl € Ø”
ˆØð Ý�Q‘”ˆBÝ�Q‘”ˆBˆBà—’˜‘”ˆBØ—’˜‘”ˆBØ
�Š7ˆ7Ø�1Ø
�Š7ˆ7Ø�1Ø�1Šuˆr c
óø ‡ — ˆ fd„}i }t |¦ « D �]P}d‰ _ t ‰ j ¦ « }|D �][\ }}|D �]Q\ }} |||| f}
|
|v rŒd||
<