public static Keyword logicObjectDefinitionType(Symbol name, Stella_Object oldobject, Stella_Object newobject) {
    if (oldobject == null) {
      return (Logic.KWD_DEFINITION);
    }
    { String oldkind = Logic.nameObjectMetaclass(oldobject);
      String newkind = Logic.nameObjectMetaclass(newobject);

      { Surrogate testValue000 = Stella_Object.safePrimaryType(oldobject);

        if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
          { NamedDescription oldobject000 = ((NamedDescription)(oldobject));

            if (!(Stella.stringEqlP(oldkind, newkind))) {
              { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

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

                  try {
                    Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
                    {
                      stream000.nativeStream.println("ERROR: Can't redefine `" + oldkind + "' `" + name + "' with a `" + newkind + "'.");
                      stream000.nativeStream.println("   Explicitly destroy the old object first before you redefine it.");
                    }
;
                    Logic.helpSignalPropositionError(stream000, Logic.KWD_ERROR);

                  } finally {
                    Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
                  }
                }
                throw ((PropositionError)(PropositionError.newPropositionError(stream000.theStringReader()).fillInStackTrace()));
              }
            }
            if (!((oldobject000.arity() == ((NamedDescription)(newobject)).arity()) ||
                ((Logic.stringifiedSource(newobject) != null) &&
                 (Native.stringSearch(Logic.stringifiedSource(newobject), "VARIABLE-ARITY", 0) != Stella.NULL_INTEGER)))) {
              { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

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

                  try {
                    Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
                    {
                      stream001.nativeStream.println("ERROR: Can't redefine `" + oldkind + "' `" + name + "' with a different arity.");
                      stream001.nativeStream.println("   Explicitly destroy the old object first before you redefine it.");
                    }
;
                    Logic.helpSignalPropositionError(stream001, Logic.KWD_ERROR);

                  } finally {
                    Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$001);
                  }
                }
                throw ((PropositionError)(PropositionError.newPropositionError(stream001.theStringReader()).fillInStackTrace()));
              }
            }
            return (Logic.KWD_REDEFINITION);
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
          { LogicObject oldobject000 = ((LogicObject)(oldobject));

            { Surrogate testValue001 = Stella_Object.safePrimaryType(newobject);

              if (Surrogate.subtypeOfP(testValue001, Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
                { NamedDescription newobject000 = ((NamedDescription)(newobject));

                  return (Logic.KWD_PROPER_DEFINITION);
                }
              }
              else if (Surrogate.subtypeOfP(testValue001, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
                { LogicObject newobject000 = ((LogicObject)(newobject));

                  return (Logic.KWD_REDEFINITION);
                }
              }
              else {
              }
            }
          }
        }
        else {
          if (oldobject.primaryType() == newobject.primaryType()) {
            return (Logic.KWD_REDEFINITION);
          }
        }
      }
      { OutputStringStream stream002 = OutputStringStream.newOutputStringStream();

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

          try {
            Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
            {
              stream002.nativeStream.println("ERROR: Can't redefine `" + oldkind + "' `" + name + "' with a `" + newkind + "'.");
              stream002.nativeStream.println("   Explicitly destroy the old object first before you redefine it.");
            }
;
            Logic.helpSignalPropositionError(stream002, Logic.KWD_ERROR);

          } finally {
            Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$002);
          }
        }
        throw ((PropositionError)(PropositionError.newPropositionError(stream002.theStringReader()).fillInStackTrace()));
      }
    }
  }