Simplify rules by defining local pattern variables.