apply rewrite rules on side-conditions of rules