* @param includeunknownfactsP
   * @param elaborateP
   * @return List
   */
  public static List allFactsOfInstance(Stella_Object self, boolean includeunknownfactsP, boolean elaborateP) {
    { List facts = List.newList();

      { Object old$Context$000 = Stella.$CONTEXT$.get();
        Object old$Module$000 = Stella.$MODULE$.get();

        try {
          Native.setSpecial(Stella.$CONTEXT$, Logic.getQueryContext());
          Native.setSpecial(Stella.$MODULE$, ((Context)(Stella.$CONTEXT$.get())).baseModule);
          if (elaborateP) {
            Logic.elaborateInstance(self);
          }
          Logic.helpCollectFacts(self, facts, HashSet.newHashSet(), includeunknownfactsP);

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