public static void computeBackupOpenGoalOrdering(List goalsequence) {
    { Proposition g = null;
      Cons iter000 = goalsequence.theConsList;

      for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
        g = ((Proposition)(iter000.value));
        if ((Proposition.estimateGoalCost(g) == Stella.NULL_FLOAT) &&
            BooleanWrapper.coerceWrappedBooleanToBoolean(g.variableTypeP())) {
          ((QueryIterator)(Logic.$QUERYITERATOR$.get())).residueGoals().insertLast(g);
        }
        else {
          ((QueryIterator)(Logic.$QUERYITERATOR$.get())).bestGoalSequence().push(g);
        }
      }
    }
  }