K iHdZddlmZddlmZddlmZmZmZefdZ efdZ y) z) Branching Strategies to Traverse a Tree )product) basic_fns)chainidentitydo_onecBtttfdS)z< Apply a rule down a tree running it on the top nodes first c<tt|SN)salltop_down)exprbrulefnss f/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/strategies/branch/traverse.pyztop_down.. s=d8E3#7=dC)rrr)rrs``rr r s x(C EErcXt|jd\fd}|S)z$ Strategic all - apply rule to args )opnewchildrenleafc3K|r|y|}tt|}|D] }|g|ywr )rmap) rmyopargssargsrrrrrs rall_rlzsall..all_rlsP :Jd8DS78E '$&&& 'sAA)rget)rrrrrrrs` @@@@rr r s.!#''+LMBXt'' MrN) __doc__ itertoolsrsympy.strategies.utilrcorerrrr r rrr%s)/+))"E  r