public static Stella_Object evaluateSurrogateTerm(Surrogate self) {
    if (((Keyword)(Logic.$EVALUATIONMODE$.get())) == Logic.KWD_EXTENSIONAL_ASSERTION) {
      { Stella_Object value = self.surrogateValue;
        ObjectStore store = null;

        if (value != null) {
          if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(value), Logic.SGT_STELLA_RELATION)) {
            { Relation value000 = ((Relation)(value));

              return (Logic.getDescription(self));
            }
          }
          else {
            return (value);
          }
        }
        else {
          self = Logic.coerceToBoundOrLocalSurrogate(self);
          store = Logic.homeObjectStore(self);
          if (store != null) {
            store.fetchInstance(self);
          }
          if (self.surrogateValue == null) {
            Logic.createLogicInstance(self, null);
          }
          return (self.surrogateValue);
        }
      }
    }
    else if (((Keyword)(Logic.$EVALUATIONMODE$.get())) == Logic.KWD_DESCRIPTION) {
      { Stella_Object surrogatevalue = self.surrogateValue;
        ObjectStore store = null;

        if (surrogatevalue == null) {
          self = Logic.coerceToBoundOrLocalSurrogate(self);
          store = Logic.homeObjectStore(self);
          if (store != null) {
            store.fetchInstance(self);
          }
          if (self.surrogateValue == null) {
            Logic.createLogicInstance(self, null);
          }
          return (self);
        }
        else if (Stella_Object.isaP(surrogatevalue, Logic.SGT_STELLA_LITERAL_WRAPPER)) {
          return (surrogatevalue);
        }
        else {
          return (self);
        }
      }
    }
    else if (((Keyword)(Logic.$EVALUATIONMODE$.get())) == Logic.KWD_INTENSIONAL_ASSERTION) {
      { Stella_Object directvalue = self.surrogateValue;
        Skolem intensionalskolem = null;

        if (Logic.skolemP(directvalue)) {
          return (directvalue);
        }
        intensionalskolem = Logic.createSkolem(((directvalue != null) ? Logic.logicalType(Logic.valueOf(directvalue)) : null), null);
        self.surrogateValue = intensionalskolem;
        Skolem.bindSkolemToValue(intensionalskolem, directvalue, false);
        return (intensionalskolem);
      }
    }
    else {
      { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        stream000.nativeStream.print("`" + ((Keyword)(Logic.$EVALUATIONMODE$.get())) + "' is not a valid case option");
        throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
      }
    }
  }