public static Stella_Object evaluateLogicObjectTerm(LogicObject self) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

      if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
        { PatternVariable self000 = ((PatternVariable)(self));

          return (self000);
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_SKOLEM)) {
        { Skolem self000 = ((Skolem)(self));

          return (self000);
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_DESCRIPTION)) {
        { Description self000 = ((Description)(self));

          if (Logic.descriptionModeP()) {
            { Surrogate name = self000.surrogateValueInverse;

              if (name != null) {
                return (name);
              }
            }
          }
          return (self000);
        }
      }
      else {
        if (Logic.descriptionModeP()) {
          { Surrogate name = self.surrogateValueInverse;

            if (name != null) {
              return (name);
            }
          }
        }
        else {
          return (self);
        }
      }
    }
    { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

      { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();

        try {
          Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
          stream000.nativeStream.println("ERROR: Illegal LOGIC-OBJECT term: `" + self + "'.");
          Logic.helpSignalPropositionError(stream000, Logic.KWD_ERROR);

        } finally {
          Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
        }
      }
      throw ((PropositionError)(PropositionError.newPropositionError(stream000.theStringReader()).fillInStackTrace()));
    }
  }