示例#1
0
def make_banned_value_counter(banned_values, bindings):
    p = lambda expr : E.is_v(expr) and (bindings[E.unpack_v(expr)] in banned_values)
    def banned_value_counter(exprs):
        count = [0]
        f = make_counter(count)
        for expr in exprs:
            E.filter_walk(p, f, expr)
        return count[0]
    return banned_value_counter
示例#2
0
def gather_atoms(atoms):
    vs = []
    dos = []
    for atom in atoms:
        (vs if is_v(atom) else dos).append(atom)
    return vs, dos
示例#3
0
 def p(expr):
     return is_v(expr) and unpack_v(expr) in new_labels
示例#4
0
def gather_atoms(atoms):
    vs = []
    dos = []
    for atom in atoms:
        (vs if is_v(atom) else dos).append(atom)
    return vs, dos
示例#5
0
 def p(expr):
     return is_v(expr) and unpack_v(expr) in new_labels