define a tracer for a rule function
    for log and statistic purposes

def trace(fun, *a, **k):
    """ define a tracer for a rule function
    for log and statistic purposes """
    @wraps(fun)
    def tracer(*a, **k):
        ret = fun(*a, **k)
        print('trace:fun: %s\n ret=%s\n a=%s\nk%s\n' %
              (str(fun), str(ret), str(a), str(k)))
        return ret
    return tracer