U
    L?h                     @   sL   d Z ddlmZ ddlmZ ddlmZmZmZ efddZ	efdd	Z
d
S )z) Branching Strategies to Traverse a Tree     )product)	basic_fns   )chainidentitydo_onec                    s   t t t fddS )z< Apply a rule down a tree running it on the top nodes first c                    s   t t | S N)salltop_down)exprbrulefns R/var/www/html/venv/lib/python3.8/site-packages/sympy/strategies/branch/traverse.py<lambda>
       ztop_down.<locals>.<lambda>)r   r   r   r   r   r   r   r
      s    
r
   c                    s,   t |jd\ fdd}|S )z$ Strategic all - apply rule to args )opnewchildrenleafc                 3   sH   | r| V  n4| }t t |  }|D ]}|f| V  q.d S r   )r   map)r   ZmyopZargssargsr   r   r   r   r   r   r   all_rl   s    zsall.<locals>.all_rl)r   get)r   r   r   r   r   r   r	      s    r	   N)__doc__	itertoolsr   Zsympy.strategies.utilr   corer   r   r   r
   r	   r   r   r   r   <module>   s
   