* @return Justification
   */
  public static Justification getWhyJustification(String label) {
    { QueryIterator query = Logic.$MOST_RECENT_QUERY$;
      boolean partialqueryP = false;
      Justification justification = null;

      if (query == null) {
        throw ((ExplainNoQueryException)(ExplainNoQueryException.newExplainNoQueryException("There is nothing to explain.").fillInStackTrace()));
      }
      partialqueryP = Logic.$MOST_RECENT_QUERY$.partialMatchStrategy != null;
      justification = ((Justification)(KeyValueList.dynamicSlotValue(query.baseControlFrame.dynamicSlots, Logic.SYM_LOGIC_JUSTIFICATION, null)));
      if (justification == null) {
        if (query.solutions.nonEmptyP()) {
          if (query.exhaustedP) {
            { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              {
                stream000.nativeStream.println("There were either no more solutions, or you used the `all' keyword.");
                stream000.nativeStream.println("   The query must generate only a single answer for explanation");
                stream000.nativeStream.print("   to be possible, thus don't use the `all' keyword to `retrieve'.");
              }
;
              throw ((ExplainNoSolutionException)(ExplainNoSolutionException.newExplainNoSolutionException(stream000.theStringReader()).fillInStackTrace()));
            }
          }
          else {
            { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

              {
                stream001.nativeStream.println("No justifications available.  You have to enable justifications");
                stream001.nativeStream.println("   with `(set-feature justifications)' and rerun the query in");
                stream001.nativeStream.print("   order to enable the explanation of results.");
              }
;
              throw ((ExplainNotEnabledException)(ExplainNotEnabledException.newExplainNotEnabledException(stream001.theStringReader()).fillInStackTrace()));
            }
          }
        }
        else if (query.exhaustedP) {
          throw ((ExplainNoSolutionException)(ExplainNoSolutionException.newExplainNoSolutionException("There was no solution.").fillInStackTrace()));
        }
        else {
          throw ((ExplainNoSolutionException)(ExplainNoSolutionException.newExplainNoSolutionException("There is no solution yet.").fillInStackTrace()));
        }
      }
      else if (query.exhaustedP &&
          (!partialqueryP)) {
        throw ((ExplainNoMoreSolutionsException)(ExplainNoMoreSolutionsException.newExplainNoMoreSolutionsException("There were no more solutions.").fillInStackTrace()));
      }
      else {
        if (label != null) {
          if (((KeyValueList)(Logic.$MOST_RECENT_EXPLANATION_MAPPING$.get())) != null) {
            justification = Logic.lookupJustification(((KeyValueList)(Logic.$MOST_RECENT_EXPLANATION_MAPPING$.get())), label);
          }
          if (justification == null) {
            { OutputStringStream stream002 = OutputStringStream.newOutputStringStream();

              stream002.nativeStream.print("Label `" + label + "' does not exists in the current explanation.");
              throw ((ExplainNoSuchLabelException)(ExplainNoSuchLabelException.newExplainNoSuchLabelException(stream002.theStringReader()).fillInStackTrace()));
            }
          }
        }
        else {
          Native.setSpecial(Logic.$MOST_RECENT_EXPLANATION_MAPPING$, null);
        }
        return (justification);
      }
    }
  }