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

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

          if (((Stella_Object)(Stella_Object.accessInContext(self000.variableValue, self000.homeContext, false))) == null) {
            return (self000);
          }
          else {
            return (Logic.valueOf(((Stella_Object)(Stella_Object.accessInContext(self000.variableValue, self000.homeContext, false)))));
          }
        }
      }
      else if (Surrogate.subtypeOfSurrogateP(testValue000)) {
        { Surrogate self000 = ((Surrogate)(self));

          return (Logic.surrogateDvalueOf(self000));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_RELATION)) {
        { Relation self000 = ((Relation)(self));

          return (Logic.relationDvalueOf(self000));
        }
      }
      else {
        return (self);
      }
    }
  }