Add an optimizer for simplifying rules