rewrite_semantics