public static void finalizeObjectAxioms(Stella_Object self) {
    { Object old$Termsourcebeingparsed$000 = Logic.$TERMSOURCEBEINGPARSED$.get();
      Object old$LogicDialect$000 = Logic.$LOGIC_DIALECT$.get();

      try {
        Native.setSpecial(Logic.$TERMSOURCEBEINGPARSED$, null);
        Native.setSpecial(Logic.$LOGIC_DIALECT$, Logic.KWD_KIF);
        { Object old$Module$000 = Stella.$MODULE$.get();
          Object old$Context$000 = Stella.$CONTEXT$.get();

          try {
            Native.setSpecial(Stella.$MODULE$, self.homeModule());
            Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
            { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

              if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
                { LogicObject self000 = ((LogicObject)(self));

                  Native.setSpecial(Logic.$TERMSOURCEBEINGPARSED$, Logic.stringifiedSource(self000));
                  if (Logic.axioms(self000) == null) {
                    return;
                  }
                  KeyValueList.setDynamicSlotValue(self000.dynamicSlots, Logic.SYM_STELLA_BADp, Stella.TRUE_WRAPPER, null);
                  { Cons theaxioms = Logic.helpFinalizeObjectAxioms(Logic.axioms(self000));

                    if (theaxioms == Stella.NIL) {
                      return;
                    }
                    else {
                      { Proposition p = null;
                        Cons iter000 = theaxioms;

                        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
                          p = ((Proposition)(iter000.value));
                          Logic.linkOriginatedProposition(self000, p);
                        }
                      }
                    }
                  }
                  Logic.axiomsSetter(self000, null);
                  KeyValueList.setDynamicSlotValue(self000.dynamicSlots, Logic.SYM_STELLA_BADp, null, null);
                }
              }
              else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
                { Proposition self000 = ((Proposition)(self));

                  Native.setSpecial(Logic.$TERMSOURCEBEINGPARSED$, Logic.stringifiedSource(self000));
                  if (Logic.axioms(self000) == null) {
                    return;
                  }
                  KeyValueList.setDynamicSlotValue(self000.dynamicSlots, Logic.SYM_STELLA_BADp, Stella.TRUE_WRAPPER, null);
                  { Cons theaxioms = Logic.helpFinalizeObjectAxioms(Logic.axioms(self000));

                    if (theaxioms == Stella.NIL) {
                      return;
                    }
                    else {
                      { Proposition p = null;
                        Cons iter001 = theaxioms;

                        for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
                          p = ((Proposition)(iter001.value));
                          Logic.linkOriginatedProposition(self000, p);
                        }
                      }
                    }
                  }
                  Logic.axiomsSetter(self000, null);
                  KeyValueList.setDynamicSlotValue(self000.dynamicSlots, Logic.SYM_STELLA_BADp, null, null);
                }
              }
              else {
                { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                  stream000.nativeStream.print("`" + testValue000 + "' is not a valid case option");
                  throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
                }
              }
            }

          } finally {
            Stella.$CONTEXT$.set(old$Context$000);
            Stella.$MODULE$.set(old$Module$000);
          }
        }

      } finally {
        Logic.$LOGIC_DIALECT$.set(old$LogicDialect$000);
        Logic.$TERMSOURCEBEINGPARSED$.set(old$Termsourcebeingparsed$000);
      }
    }
  }