� ��g���X�dZddlmZddlmZmZefd�Zefd�Zefd�Zefd�Z efd�Z d S) zStrategies to Traverse a Tree.�)� basic_fns)�chain�do_onec�.���t���fd���S)z;Apply a rule down a tree running it on the top nodes first.c�R��tt�������|��S�N��sall�top_down��expr�fns�rules ���i/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/strategies/traverse.py�<lambda>ztop_down.<locals>.<lambda>s&���$B�D��$��)<�)<�c�$B�$B�4�$H�$H���r�rrs``rr r s!���� ��H�H�H�H�H� I� I�Irc�.���t��fd����S)z>Apply a rule down a tree running it on the bottom nodes first.c�R��tt�������|��Sr�r � bottom_upr s ��rrzbottom_up.<locals>.<lambda> s&���=�d�9�T�3�#7�#7��=�=�d�C�C�rrrs``rrr s!���� �C�C�C�C�C�T� J� J�Jrc�.���t���fd���S)z+Apply a rule down a tree - stop on success.c�R��tt�������|��Srr r s ��rrztop_down_once.<locals>.<lambda>s&���%C�T�(�4��*=�*=�s�%C�%C�D�%I�%I�r�rrs``r� top_down_oncers!���� �$�I�I�I�I�I� J� J�Jrc�.���t��fd����S)z)Apply a rule up a tree - stop on success.c�R��tt�������|��Srrr s ��rrz bottom_up_once.<locals>.<lambda>s&���>�t�I�d�C�$8�$8�#�>�>�t�D�D�rrrs``r�bottom_up_oncers!���� �D�D�D�D�D�d� K� K�Krc�V������t|jd��\���������fd�}|S)z#Strategic all - apply rule to args.)�op�new�children�leafc�t���|��r|St��|����}��|��g|�R�Sr)�map)r �argsr#r$r"r!rs �����r�all_rlzsall.<locals>.all_rlsO��� �4��:�:� (��K��t�X�X�d�^�^�,�,�D��3�r�r�$�x�x�'�$�'�'�'� 'r)r&�get)rrr(r#r$r"r!s` @@@@rr r sV�������!�#�'�+L�M�M��B��X�t�(�(�(�(�(�(�(�(�(� �MrN) �__doc__�sympy.strategies.utilr�sympy.strategies.corerrr rrrr �rr�<module>r.s���$�$�+�+�+�+�+�+�/�/�/�/�/�/�/�/�!�J�J�J�J� "�K�K�K�K� &�K�K�K�K� '�L�L�L�L� � � � � � � r
Memory