ó
¡¼™\c           @  st   d  Z  d d l m Z m Z d d l m Z d d l m Z d d l m	 Z	 m
 Z
 m Z e d „ Z e d „ Z d	 S(
   s)    Branching Strategies to Traverse a Tree iÿÿÿÿ(   t   print_functiont   division(   t   product(   t	   basic_fnsi   (   t   chaint   identityt   do_onec           s"   t  t ˆ  t ƒ ‡  ‡ f d †  ƒ S(   s<    Apply a rule down a tree running it on the top nodes first c           s   t  t ˆ  ˆ ƒ ˆ ƒ |  ƒ S(   N(   t   sallt   top_down(   t   expr(   t   brulet   fns(    s?   lib/python2.7/site-packages/sympy/strategies/branch/traverse.pyt   <lambda>   t    (   R   R   R   (   R
   R   (    (   R
   R   s?   lib/python2.7/site-packages/sympy/strategies/branch/traverse.pyR   
   s    c           s=   t  | j d ƒ \ ‰ ‰ ‰ ‰ ‡  ‡ ‡ ‡ ‡ f d †  } | S(   s$    Strategic all - apply rule to args t   opt   newt   childrent   leafc         3  s^   ˆ |  ƒ r |  VnF ˆ |  ƒ } t  t ˆ  ˆ |  ƒ ƒ Œ  } x | D] } ˆ | | Œ VqB Wd  S(   N(   R   t   map(   R	   t   myopt   argsst   args(   R
   R   R   R   R   (    s?   lib/python2.7/site-packages/sympy/strategies/branch/traverse.pyt   all_rl   s    (   R   R   R   R   (   R   t   get(   R
   R   R   (    (   R
   R   R   R   R   s?   lib/python2.7/site-packages/sympy/strategies/branch/traverse.pyR      s    N(   t   __doc__t
   __future__R    R   t	   itertoolsR   t   sympy.strategies.utilR   t   coreR   R   R   R   R   (    (    (    s?   lib/python2.7/site-packages/sympy/strategies/branch/traverse.pyt   <module>   s   