'The top-level control procedure of the separate-and-conquer
algorithm. For given data and target class (may be None), return
a list of rules which all must strictly adhere to the
requirements of rule finder\'s validators.
To induce decision lists (ordered rules), set target class to
None. Best rule conditions are found and the majority class is
assigned in the rule head.
To induce rule sets (unordered rules), learn rules for each
class individually, in regard to the original learning data.
Parameters
X, Y, W : ndarray
Learning data.
target_class : int
Index of the class to model.
base_rules : list of Rule
An optional list of initial rules to constrain the search.
domain : Orange.data.domain.Domain
Data domain, used to calculate class distributions.
Returns
rule_list : list of Rule
Induced rules.'

def find_rules(self, X, Y, W, target_class, base_rules, domain):

    initial_class_dist = get_dist(Y, W, domain)
    rule_list = []
    while (not self.data_stopping(X, Y, W, target_class)):
        new_rule = self.rule_finder(X, Y, W, target_class, base_rules, domain, initial_class_dist, rule_list)
        if ((new_rule is None) or self.rule_stopping(new_rule)):
            break
        (X, Y, W) = self.cover_and_remove(X, Y, W, new_rule)
        rule_list.append(new_rule)
    return rule_list
