Rewrite logics