public static Cons generateDescriptionsAsRule(Description head, Description tail, Proposition rule, boolean reversepolarityP) {
    { boolean forwardarrowP = ((BooleanWrapper)(KeyValueList.dynamicSlotValue(rule.dynamicSlots, Logic.SYM_LOGIC_FORWARD_ONLYp, Stella.FALSE_WRAPPER))).wrapperValue &&
          (!reversepolarityP);
      boolean reverseargumentsP = forwardarrowP ||
          reversepolarityP;
      Symbol arrow = Surrogate.symbolize(Proposition.chooseImplicationOperator(rule, forwardarrowP));
      boolean mapheadvariablesP = Description.namedDescriptionP(head);
      Stella_Object headprop = null;
      Stella_Object tailprop = null;
      Cons universals = Stella.NIL;

      if (reverseargumentsP) {
        { Description temp = head;

          head = tail;
          tail = temp;
        }
        mapheadvariablesP = !mapheadvariablesP;
      }
      { PatternVariable var = null;
        Vector vector000 = (mapheadvariablesP ? tail.ioVariables : head.ioVariables);
        int index000 = 0;
        int length000 = vector000.length();
        Cons collect000 = null;

        for (;index000 < length000; index000 = index000 + 1) {
          var = ((PatternVariable)((vector000.theArray)[index000]));
          if (collect000 == null) {
            {
              collect000 = Cons.cons(PatternVariable.generateOneVariable(var, true), Stella.NIL);
              if (universals == Stella.NIL) {
                universals = collect000;
              }
              else {
                Cons.addConsToEndOfConsList(universals, collect000);
              }
            }
          }
          else {
            {
              collect000.rest = Cons.cons(PatternVariable.generateOneVariable(var, true), Stella.NIL);
              collect000 = collect000.rest;
            }
          }
        }
      }
      { Object old$Skolemnamemappingtable$000 = Logic.$SKOLEMNAMEMAPPINGTABLE$.get();

        try {
          Native.setSpecial(Logic.$SKOLEMNAMEMAPPINGTABLE$, (mapheadvariablesP ? ((KeyValueMap)(Logic.createSkolemMappingTable(head.ioVariables, tail.ioVariables))) : null));
          headprop = Description.generateDescriptionProposition(head, reversepolarityP);

        } finally {
          Logic.$SKOLEMNAMEMAPPINGTABLE$.set(old$Skolemnamemappingtable$000);
        }
      }
      { Object old$Skolemnamemappingtable$001 = Logic.$SKOLEMNAMEMAPPINGTABLE$.get();

        try {
          Native.setSpecial(Logic.$SKOLEMNAMEMAPPINGTABLE$, ((!mapheadvariablesP) ? ((KeyValueMap)(Logic.createSkolemMappingTable(tail.ioVariables, head.ioVariables))) : null));
          tailprop = Description.generateDescriptionProposition(tail, reversepolarityP);

        } finally {
          Logic.$SKOLEMNAMEMAPPINGTABLE$.set(old$Skolemnamemappingtable$001);
        }
      }
      return (Cons.list$(Cons.cons(Logic.SYM_STELLA_FORALL, Cons.cons(universals, Cons.cons(Cons.cons(Cons.cons(arrow, Cons.cons(headprop, Cons.cons(tailprop, Stella.NIL))), Stella.NIL), Stella.NIL)))));
    }
  }