public static Stella_Object evaluateAutomaticInstance(Symbol name) {
    if (((KeyValueList)(Logic.$AUTOMATICINSTANCETABLE$.get())) == Logic.$MISSING_KEY_VALUE_LIST$) {
      { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

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

          try {
            Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
            {
              stream000.nativeStream.println("ERROR: Automatic instance `" + name + "' found outside");
              stream000.nativeStream.println("   the scope of an assertion..");
            }
;
            Logic.helpSignalPropositionError(stream000, Logic.KWD_ERROR);

          } finally {
            Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
          }
        }
        throw ((PropositionError)(PropositionError.newPropositionError(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    { LogicObject instance = ((((KeyValueList)(Logic.$AUTOMATICINSTANCETABLE$.get())) != null) ? ((LogicObject)(((KeyValueList)(Logic.$AUTOMATICINSTANCETABLE$.get())).lookup(name))) : ((LogicObject)(null)));

      if (instance == null) {
        { Surrogate surrogate = Stella.stringToSurrogate(Stella.gensym(Native.string_subsequence(name.symbolName, 1, Stella.NULL_INTEGER)).symbolName);

          instance = ((LogicObject)(Logic.createLogicInstance(surrogate, null)));
          if (((KeyValueList)(Logic.$AUTOMATICINSTANCETABLE$.get())) == null) {
            Native.setSpecial(Logic.$AUTOMATICINSTANCETABLE$, KeyValueList.newKeyValueList());
          }
          ((KeyValueList)(Logic.$AUTOMATICINSTANCETABLE$.get())).insertAt(name, instance);
        }
      }
      return (LogicObject.evaluateLogicObjectTerm(instance));
    }
  }