public static Cons learnOneRuleBottomUpFromSignatures(List positive, List negative, List covered, Vector consProps) {
    { List tempPositive = positive.copy();
      int max = 0;
      int cover = 0;
      int index1 = 0;
      int index2 = 0;
      int vecSize = ((TrainingExample)(negative.first())).input.length();
      List indices = null;
      List bestIndices = List.newList();
      Vector lgg = null;
      Vector sig1 = null;
      Vector sig2 = null;
      boolean stop = false;
      Cons result = Stella.NIL;
      int score = 0;
      int numLggs = 0;

      while ((max > 0) ||
          (lgg == null)) {
        cover = cover + max;
        System.out.println("   Current rule covers " + cover + " positive examples");
        if (lgg != null) {
          { TrainingExample example = null;
            Cons iter000 = Logic.removeSignatureCoveredExamples(bestIndices, tempPositive).theConsList;

            for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
              example = ((TrainingExample)(iter000.value));
              covered.push(example);
            }
          }
        }
        numLggs = tempPositive.length() * 1;
        max = 0;
        { int i = Stella.NULL_INTEGER;
          int iter001 = 1;
          int upperBound000 = numLggs;
          boolean unboundedP000 = upperBound000 == Stella.NULL_INTEGER;

          for (;unboundedP000 ||
                    (iter001 <= upperBound000); iter001 = iter001 + 1) {
            i = iter001;
            i = i;
            index1 = Stella.random(tempPositive.length());
            sig1 = ((TrainingExample)(tempPositive.nth(index1))).input;
            if (lgg == null) {
              {
                index2 = Stella.random(tempPositive.length());
                while (index1 == index2) {
                  index2 = Stella.random(tempPositive.length());
                }
                sig2 = ((TrainingExample)(tempPositive.nth(index2))).input;
              }
            }
            else {
              sig2 = lgg;
            }
            indices = Logic.intersectSignatures(sig1, sig2);
            if (!Logic.signatureIndicesCoverAnyExampleP(indices, negative)) {
              score = Logic.numSignatureIndicesCovered(indices, tempPositive);
              if (score > max) {
                System.out.println("    New best: " + score + " examples");
                bestIndices = indices;
                max = score;
              }
            }
          }
        }
        lgg = Vector.newVector(vecSize);
        { int i = Stella.NULL_INTEGER;
          int iter002 = 0;
          int upperBound001 = vecSize - 1;

          for (;iter002 <= upperBound001; iter002 = iter002 + 1) {
            i = iter002;
            (lgg.theArray)[i] = (IntegerWrapper.wrapInteger(2));
          }
        }
        { IntegerWrapper index = null;
          Cons iter003 = bestIndices.theConsList;

          for (;!(iter003 == Stella.NIL); iter003 = iter003.rest) {
            index = ((IntegerWrapper)(iter003.value));
            if (index.wrapperValue > 0) {
              (lgg.theArray)[(index.wrapperValue - 1)] = (IntegerWrapper.wrapInteger(1));
            }
            else {
              (lgg.theArray)[((0 - index.wrapperValue) - 1)] = (IntegerWrapper.wrapInteger(0));
            }
          }
        }
      }
      while (stop) {
        stop = true;
        { IntegerWrapper index = null;
          Cons iter004 = bestIndices.copy().theConsList;

          loop007 : for (;!(iter004 == Stella.NIL); iter004 = iter004.rest) {
            index = ((IntegerWrapper)(iter004.value));
            if (!Logic.signatureIndicesCoverAnyExampleP(((List)(bestIndices.copy().remove(index))), negative)) {
              System.out.println("     Removing clause");
              bestIndices = ((List)(bestIndices.remove(index)));
              stop = false;
              break loop007;
            }
          }
        }
      }
      { IntegerWrapper index = null;
        Cons iter005 = bestIndices.theConsList;

        for (;!(iter005 == Stella.NIL); iter005 = iter005.rest) {
          index = ((IntegerWrapper)(iter005.value));
          if (index.wrapperValue > 0) {
            result = Cons.cons(((Cons)((consProps.theArray)[(index.wrapperValue - 1)])), result);
          }
          else {
            result = Cons.cons(Cons.list$(Cons.cons(Logic.SYM_LOGIC_FAIL, Cons.cons(((Cons)((consProps.theArray)[((0 - index.wrapperValue) - 1)])), Cons.cons(Stella.NIL, Stella.NIL)))), result);
          }
        }
      }
      return (result);
    }
  }