*/
  public static void doClearInstances(Module module) {
    { Context child = null;
      Cons iter000 = module.childContexts.theConsList;

      for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
        child = ((Context)(iter000.value));
        if (Stella_Object.isaP(child, Logic.SGT_STELLA_MODULE)) {
          Logic.doClearInstances(((Module)(child)));
        }
      }
    }
    { Object old$Module$000 = Stella.$MODULE$.get();
      Object old$Context$000 = Stella.$CONTEXT$.get();

      try {
        Native.setSpecial(Stella.$MODULE$, module);
        Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
        Logic.destroyInferenceCaches(module);
        { LogicObject instance = null;
          Iterator iter001 = Logic.allInstances(module, true);

          while (iter001.nextP()) {
            instance = ((LogicObject)(iter001.value));
            Logic.destroyInstance(instance);
          }
        }
        Logic.locallyConceivedPropositions(module).removeDeletedMembers();

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