o
    oÇhŸ  ã                   @   s`   d Z ddlmZ ddlmZmZ efdd„Zefdd„Zefdd	„Zefd
d„Z	efdd„Z
dS )zStrategies to Traverse a Tree.é    )Ú	basic_fns)ÚchainÚdo_onec                    ó   t ˆ‡ ‡fd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©ÚfnsÚrule© úm/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/sympy/strategies/traverse.pyÚ<lambda>   ó    ztop_down.<locals>.<lambda>©r   ©r   r   r   r   r   r
      ó   r
   c                    ó   t ‡ ‡fdd„ˆƒS )z>Apply a rule down a tree running it on the bottom nodes first.c                    r   r   ©r	   Ú	bottom_upr   r   r   r   r      r   zbottom_up.<locals>.<lambda>r   r   r   r   r   r      r   r   c                    r   )z+Apply a rule down a tree - stop on success.c                    r   r   r   r   r   r   r   r      r   ztop_down_once.<locals>.<lambda>©r   r   r   r   r   Útop_down_once   r   r   c                    r   )z)Apply a rule up a tree - stop on success.c                    r   r   r   r   r   r   r   r      r   z bottom_up_once.<locals>.<lambda>r   r   r   r   r   Úbottom_up_once   r   r   c                    s,   t |jdƒ\‰‰‰ ‰‡ ‡‡‡‡fdd„}|S )z#Strategic all - apply rule to args.)ÚopÚnewÚchildrenÚleafc                    s.   ˆ| ƒr| S t ˆˆ | ƒƒ}ˆˆ| ƒg|¢R Ž S r   )Úmap)r   Ú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__Úsympy.strategies.utilr   Úsympy.strategies.corer   r   r
   r   r   r   r	   r   r   r   r   Ú<module>   s    