public static void finalizeObject(Stella_Object self) {
    if (self.deletedP() ||
        Logic.finalizedObjectP(self)) {
      return;
    }
    try {
      { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

        if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
          { NamedDescription self000 = ((NamedDescription)(self));

            { boolean testValue001 = false;

              if (BooleanWrapper.coerceWrappedBooleanToBoolean(self000.badP())) {
                testValue001 = true;
              }
              else {
                { boolean foundP000 = false;

                  { Surrogate type = null;
                    Cons iter000 = self000.ioVariableTypes.theConsList;

                    loop000 : for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
                      type = ((Surrogate)(iter000.value));
                      if (type.symbolId == -1) {
                        foundP000 = true;
                        break loop000;
                      }
                    }
                  }
                  testValue001 = foundP000;
                }
              }
              if (testValue001) {
                return;
              }
            }
            Logic.finalizeObjectAxioms(self000);
            NamedDescription.checkDescriptionArgumentTypes(self000);
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
          { LogicObject self000 = ((LogicObject)(self));

            if (BooleanWrapper.coerceWrappedBooleanToBoolean(self000.badP())) {
              return;
            }
            Logic.finalizeObjectAxioms(self000);
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
          { Proposition self000 = ((Proposition)(self));

            if (BooleanWrapper.coerceWrappedBooleanToBoolean(self000.badP())) {
              return;
            }
            Logic.finalizeObjectAxioms(self000);
          }
        }
        else {
        }
      }
    } catch (LogicException e) {
      Stella.STANDARD_ERROR.nativeStream.print(Stella.exceptionMessage(e));
    }
  }