public int numberOfFailedSubgoals() {
    { WhynotPartialMatch self = this;

      { Justification proof = ((Justification)(KeyValueList.dynamicSlotValue(self.controlFrame.dynamicSlots, Logic.SYM_LOGIC_JUSTIFICATION, null)));

        { MemoizationTable memoTable000 = null;
          Cons memoizedEntry000 = null;
          Stella_Object memoizedValue000 = null;

          if (Stella.$MEMOIZATION_ENABLEDp$) {
            memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_M_WHYNOT_PARTIAL_MATCHdNUMBER_OF_FAILED_SUBGOALS_MEMO_TABLE_000.surrogateValue));
            if (memoTable000 == null) {
              Surrogate.initializeMemoizationTable(Logic.SGT_LOGIC_M_WHYNOT_PARTIAL_MATCHdNUMBER_OF_FAILED_SUBGOALS_MEMO_TABLE_000, "(:MAX-VALUES 500)");
              memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_M_WHYNOT_PARTIAL_MATCHdNUMBER_OF_FAILED_SUBGOALS_MEMO_TABLE_000.surrogateValue));
            }
            memoizedEntry000 = MruMemoizationTable.lookupMruMemoizedValue(((MruMemoizationTable)(memoTable000)), proof, Stella.MEMOIZED_NULL_VALUE, null, null, -1);
            memoizedValue000 = memoizedEntry000.value;
          }
          if (memoizedValue000 != null) {
            if (memoizedValue000 == Stella.MEMOIZED_NULL_VALUE) {
              memoizedValue000 = null;
            }
          }
          else {
            memoizedValue000 = IntegerWrapper.wrapInteger(Justification.computeNumberOfFailedSubgoals(proof));
            if (Stella.$MEMOIZATION_ENABLEDp$) {
              memoizedEntry000.value = ((memoizedValue000 == null) ? Stella.MEMOIZED_NULL_VALUE : memoizedValue000);
            }
          }
          { IntegerWrapper value000 = ((IntegerWrapper)(memoizedValue000));

            return (value000.wrapperValue);
          }
        }
      }
    }
  }