
    hX                     B    S SK Jr  S SKJrJrJr  S SKJr  S rS r	S r
g)   )rl)do_oneexhaustswitch)top_downc                     U (       a>  [        [        [        [        R                  /[        U R                  5       6 Q76 6 40 UD6$ S $ )aU  Full simultaneous exact substitution.

Examples
========

>>> from sympy.strategies.tools import subs
>>> from sympy import Basic, S
>>> mapping = {S(1): S(4), S(4): S(1), Basic(S(5)): Basic(S(6), S(7))}
>>> expr = Basic(S(1), Basic(S(2), S(3)), Basic(S(4), Basic(S(5))))
>>> subs(mapping)(expr)
Basic(4, Basic(2, 3), Basic(1, Basic(6, 7)))
c                     U $ )N )xs    N/var/www/html/shao/venv/lib/python3.13/site-packages/sympy/strategies/tools.py<lambda>subs.<locals>.<lambda>   s        )r   r   mapr   subszipitems)dkwargss     r   r   r      s:     	BGG >c1779o >?J6JJr   c            	      J    [        [        [        [        U 6 5      40 UD65      $ )zStrategy for canonicalization.

Explanation
===========

Apply each rule in a bottom_up fashion through the tree.
Do each one in turn.
Keep doing this until there is no change.
)r   r   r   )rulesr   s     r   canonr      s"     8GFEN3>v>??r   c                 "    [        [        U 5      $ )aC  Apply rules based on the expression type

inputs:
    ruletypes -- a dict mapping {Type: rule}

Examples
========

>>> from sympy.strategies import rm_id, typed
>>> from sympy import Add, Mul
>>> rm_zeros = rm_id(lambda x: x==0)
>>> rm_ones  = rm_id(lambda x: x==1)
>>> remove_idents = typed({Add: rm_zeros, Mul: rm_ones})
)r   type)	ruletypess    r   typedr   &   s     $	""r   N) r   corer   r   r   traverser   r   r   r   r
   r   r   <module>r       s!     ) ) &
@#r   