how to find the and generate the rule​