public static PLSurrogate makeLogicSurrogate(LogicObject obj) {
    { PLSurrogate result = PLSurrogate.new_PLSurrogate();

      if (Logic.skolemP(obj)) {
        { OutputStringStream resultstream = OutputStringStream.newOutputStringStream();
          org.powerloom.PrintableStringWriter nativestream = resultstream.nativeStream;
          String printname = null;

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

            try {
              Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
              Native.setBooleanSpecial(Stella.$PRINTPRETTYp$, true);
              printname = GuiServer.xmlifyString(resultstream.theStringReader());

            } finally {
              Stella.$PRINTPRETTYp$.set(old$PrintprettyP$000);
              Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
            }
          }
          result.id = printname;
          return (result);
        }
      }
      result.id = GuiServer.xmlifyString(GuiServer.plObjectToGuiName(obj));
      return (result);
    }
  }