Assignment rewriting