adds a defrule macro