示例#1
0
 def all_rl(expr):
     if is_leaf(expr):
         return expr
     else:
         args = map(rule, expr.args)
         return new(type(expr), *args)
示例#2
0
 def top_down_rl(expr):
     newexpr = rule(expr)
     if is_leaf(newexpr):
         return newexpr
     return new(type(newexpr), *map(top_down_rl, newexpr.args))
示例#3
0
 def bottom_up_rl(expr):
     if is_leaf(expr):
         return rule(expr)
     else:
         return rule(new(type(expr), *map(bottom_up_rl, expr.args)))
示例#4
0
 def top_down_rl(expr):
     newexpr = rule(expr)
     if is_leaf(newexpr):
         return newexpr
     return new(type(newexpr), *map(top_down_rl, newexpr.args))
示例#5
0
 def bottom_up_rl(expr):
     if is_leaf(expr):
         return rule(expr)
     else:
         return rule(new(type(expr), *map(bottom_up_rl, expr.args)))
示例#6
0
文件: traverse.py 项目: Tyf0n/sympy
 def all_rl(expr):
     if is_leaf(expr):
         return expr
     else:
         args = map(rule, expr.args)
         return new(type(expr), *args)