<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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