public static void filterAntecedent(List antecedent, String ruleName) {
    { ListIterator clause = ((ListIterator)(antecedent.allocateIterator()));

      while (clause.nextP()) {
        if (Logic.stringArgumentP(((Cons)(clause.value)))) {
          clause.valueSetter(null);
        }
      }
    }
    antecedent.remove(null);
    { List ruleAnt = ((List)(Logic.$CASE_ANTECEDENT_TABLE$.lookup(ruleName)));
      List generatedVariables = List.list(Cons.cons(Logic.internLogicSymbol("?Y"), Stella.NIL));
      int index = 0;

      if (Logic.$LOG_ANTECEDENT_CONSTRUCTION$) {
        System.out.println("New clauses: " + antecedent);
      }
      if (ruleAnt == null) {
        return;
      }
      { int i = Stella.NULL_INTEGER;
        int iter000 = 1;
        int upperBound000 = antecedent.length();

        for (;iter000 <= upperBound000; iter000 = iter000 + 1) {
          i = iter000;
          i = i;
          { Cons clause = ((Cons)(antecedent.nth(index)));
            Cons vars = Logic.findMatchingCaseVars(clause, ruleAnt, generatedVariables);

            if (!(vars == Stella.NIL)) {
              {
                antecedent = ((List)(antecedent.remove(clause)));
                { Cons sub = null;
                  Cons iter001 = vars;

                  for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
                    sub = ((Cons)(iter001.value));
                    if (Stella_Object.symbolP(sub.rest.value)) {
                      Logic.$DELETED_CASE_VARIABLES$.push(((Symbol)(sub.rest.value)));
                      if (!Stella_Object.eqlP(sub.value, sub.rest.value)) {
                        { Cons ant = null;
                          Cons iter002 = antecedent.theConsList;

                          for (;!(iter002 == Stella.NIL); iter002 = iter002.rest) {
                            ant = ((Cons)(iter002.value));
                            Stella_Object.substituteConsTree(ant, sub.value, sub.rest.value);
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
            else {
              index = index + 1;
            }
          }
        }
      }
      if (Logic.$LOG_ANTECEDENT_CONSTRUCTION$) {
        System.out.println("Clauses added to antecedent: " + antecedent);
      }
      return;
    }
  }