public static void printAsKifInternal(Stella_Object self) {
    { OutputStream stream = ((OutputStream)(Logic.$PRINTLOGICALFORMSTREAM$.get()));

      if (self == null) {
        stream.nativeStream.print("NULL");
        return;
      }
      if (self.deletedP()) {
        stream.nativeStream.print("DeLeTeD");
        return;
      }
      { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

        if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
          { Proposition self000 = ((Proposition)(self));

            Proposition.printKifProposition(self000);
          }
        }
        else if (Surrogate.subtypeOfWrapperP(testValue000)) {
          { Wrapper self000 = ((Wrapper)(self));

            Logic.printKifWrapper(((LiteralWrapper)(self000)));
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_DESCRIPTION)) {
          { Description self000 = ((Description)(self));

            Description.printKifDescription(self000);
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
          { PatternVariable self000 = ((PatternVariable)(self));

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

            Skolem.printKifSkolem(self000, false);
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
          { LogicObject self000 = ((LogicObject)(self));

            LogicObject.printKifLogicObject(self000);
          }
        }
        else if (Surrogate.subtypeOfSurrogateP(testValue000)) {
          { Surrogate self000 = ((Surrogate)(self));

            stream.nativeStream.print(Logic.stringifiedSurrogate(self000));
          }
        }
        else if (Surrogate.subtypeOfKeywordP(testValue000)) {
          { Keyword self000 = ((Keyword)(self));

            stream.nativeStream.print(self000);
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_COLLECTION)) {
          { Collection self000 = ((Collection)(self));

            Logic.printKifStellaCollection(self000);
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_THING)) {
          { LogicThing self000 = ((LogicThing)(self));

            stream.nativeStream.print(Logic.generateTerm(self000));
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_THING)) {
          { Thing self000 = ((Thing)(self));

            stream.nativeStream.print(self000);
          }
        }
        else {
          stream.nativeStream.print("|Illegal Logical Form|: " + self);
        }
      }
    }
  }