
    sg                     H    d Z ddlmZ ddlmZ ddlmZmZmZ efdZ	efdZ
y)	z) Branching Strategies to Traverse a Tree     )product)	basic_fns   )chainidentitydo_onec                 B     t        t         t               fd      S )z< Apply a rule down a tree running it on the top nodes first c                 <     t        t                    |       S N)salltop_down)exprbrulefnss    S/var/www/html/venv/lib/python3.12/site-packages/sympy/strategies/branch/traverse.py<lambda>ztop_down.<locals>.<lambda>
   s    =d8E3#7=dC     )r   r   r   )r   r   s   ``r   r   r      s    x(CE Er   c                 X     t        |j                  d      \   fd}|S )z$ Strategic all - apply rule to args )opnewchildrenleafc              3      K    |       r|  y  |       }t        t         |              }|D ]  } |g|   y wr   )r   map)	r   myopargssargsr   r   r   r   r   s	       r   all_rlzsall.<locals>.all_rl   sP     :Jd8DS78E '$&&&'s   AA)r   get)r   r   r   r   r   r   r   s   `  @@@@r   r   r      s.    !#''+LMBXt' ' Mr   N)__doc__	itertoolsr   sympy.strategies.utilr   corer   r   r   r   r    r   r   <module>r%      s)    /  + ) ) " E  r   