Rewrite inference rules