def canon(*rules, **kwargs):
 return exhaust(top_down(exhaust(do_one(*rules)), **kwargs))

def canon ( * rules , ** kwargs ) : return exhaust ( top_down ( exhaust ( do_one ( * rules ) ) , ** kwargs ) )
strategy for canonicalization apply each rule in a bottom_up fashion through the tree .