public static void destroyTerm(LogicObject self) {
    if ((self == null) ||
        self.deletedP()) {
      return;
    }
    Logic.destroyLogicInstance(self);
    if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(self), Logic.SGT_LOGIC_DESCRIPTION)) {
      { Description self000 = ((Description)(self));

        if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(self000), Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
          { NamedDescription self001 = ((NamedDescription)(self000));

            { Relation nativerelation = self001.nativeRelation();

              self001.nativeRelationSetter(null);
              if (nativerelation != null) {
                KeyValueList.setDynamicSlotValue(nativerelation.dynamicSlots, Logic.SYM_LOGIC_DESCRIPTION, null, null);
              }
              if (self001.extension != null) {
                self001.extension = null;
              }
            }
          }
        }
        else {
        }
        { Description complement = ((Description)(KeyValueList.dynamicSlotValue(self000.dynamicSlots, Logic.SYM_LOGIC_COMPLEMENT_DESCRIPTION, null)));

          if (complement != null) {
            KeyValueList.setDynamicSlotValue(complement.dynamicSlots, Logic.SYM_LOGIC_COMPLEMENT_DESCRIPTION, null, null);
            KeyValueList.setDynamicSlotValue(self000.dynamicSlots, Logic.SYM_LOGIC_COMPLEMENT_DESCRIPTION, null, null);
          }
        }
        LogicObject.removeAllDependentPropositionLinks(self000);
        self000.ioVariables = null;
        self000.internalVariables = null;
        self000.proposition = null;
        self000.homeContext = null;
      }
    }
    else {
    }
    self.dynamicSlots.clear();
    self.deletedPSetter(true);
  }