public static Instances rmCoveredBySuccessives(Instances data,ArrayList<Rule> rules,int index){
  Instances rt=new Instances(data,0);
  for (int i=0; i < data.numInstances(); i++) {
    Instance datum=data.instance(i);
    boolean covered=false;
    for (int j=index + 1; j < rules.size(); j++) {
      Rule rule=rules.get(j);
      if (rule.covers(datum)) {
        covered=true;
        break;
      }
    }
    if (!covered) {
      rt.add(datum);
    }
  }
  return rt;
}

public static Instances rmCoveredBySuccessives ( Instances data , ArrayList < Rule > rules , int index ) { Instances rt = new Instances ( data , 0 ) ; for ( int i = 0 ; i < data . numInstances ( ) ; i ++ ) { Instance datum = data . instance ( i ) ; boolean covered = false ; for ( int j = index + 1 ; j < rules . size ( ) ; j ++ ) { Rule rule = rules . get ( j ) ; if ( rule . covers ( datum ) ) { covered = true ; break ; } } if ( ! covered ) { rt . add ( datum ) ; } } return rt ; }
static utility function to count the data covered by the rules after the given index in the given rules , and then remove them . it returns the data not covered by the successive rules .
