* @param original
   * @return LogicObject
   */
  public static LogicObject coerceToInstance(Stella_Object self, Stella_Object original) {
    if (original == null) {
      original = self;
    }
    if (self == null) {
      System.out.println("Can't find a logic object `" + original + "'.");
      return (null);
    }
    { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

      if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
        { LogicObject self000 = ((LogicObject)(self));

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

          return (Logic.getDescription(self000));
        }
      }
      else if (Surrogate.subtypeOfSurrogateP(testValue000)) {
        { Surrogate self000 = ((Surrogate)(self));

          { Stella_Object value = self000.surrogateValue;
            ObjectStore store = null;

            if (value == null) {
              store = Logic.homeObjectStore(self000);
              if (store != null) {
                value = store.fetchInstance(self000);
              }
            }
            return (Logic.coerceToInstance(value, original));
          }
        }
      }
      else if (Surrogate.subtypeOfSymbolP(testValue000)) {
        { Symbol self000 = ((Symbol)(self));

          return (Logic.coerceToInstance(Symbol.symbolToSurrogate(self000), original));
        }
      }
      else if (Surrogate.subtypeOfKeywordP(testValue000)) {
        { Keyword self000 = ((Keyword)(self));

          return (Logic.coerceToInstance(Surrogate.lookupSurrogate(self000.symbolName), original));
        }
      }
      else if (Surrogate.subtypeOfStringP(testValue000)) {
        { StringWrapper self000 = ((StringWrapper)(self));

          return (Logic.coerceToInstance(Surrogate.lookupSurrogate(self000.wrapperValue), original));
        }
      }
      else if (testValue000 == Logic.SGT_STELLA_CONS) {
        { Cons self000 = ((Cons)(self));

          return (Logic.coerceToInstance(Logic.evaluateTerm(self000), original));
        }
      }
      else {
        return (Logic.coerceToInstance(null, original));
      }
    }
  }