public static boolean testIsaP(Stella_Object member, Surrogate type) {
    if (type == Logic.SGT_STELLA_THING) {
      return (true);
    }
    else if ((type == Logic.SGT_PL_KERNEL_KB_CLASS) ||
        ((type == Logic.SGT_PL_KERNEL_KB_RELATION) ||
         ((type == Logic.SGT_PL_KERNEL_KB_FUNCTION) ||
          ((type == Logic.SGT_PL_KERNEL_KB_COLLECTION) ||
           (type == Logic.SGT_PL_KERNEL_KB_SET))))) {
      { MemoizationTable memoTable000 = null;
        Cons memoizedEntry000 = null;
        Stella_Object memoizedValue000 = null;

        if (Stella.$MEMOIZATION_ENABLEDp$) {
          memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F_TEST_ISAp_MEMO_TABLE_000.surrogateValue));
          if (memoTable000 == null) {
            Surrogate.initializeMemoizationTable(Logic.SGT_LOGIC_F_TEST_ISAp_MEMO_TABLE_000, "(:MAX-VALUES 1000 :TIMESTAMPS (:META-KB-UPDATE))");
            memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F_TEST_ISAp_MEMO_TABLE_000.surrogateValue));
          }
          memoizedEntry000 = MruMemoizationTable.lookupMruMemoizedValue(((MruMemoizationTable)(memoTable000)), member, type, ((Context)(Stella.$CONTEXT$.get())), Stella.MEMOIZED_NULL_VALUE, 6);
          memoizedValue000 = memoizedEntry000.value;
        }
        if (memoizedValue000 != null) {
          if (memoizedValue000 == Stella.MEMOIZED_NULL_VALUE) {
            memoizedValue000 = null;
          }
        }
        else {
          memoizedValue000 = (Logic.helpMemoizeTestIsaP(member, type) ? Stella.TRUE_WRAPPER : Stella.FALSE_WRAPPER);
          if (Stella.$MEMOIZATION_ENABLEDp$) {
            memoizedEntry000.value = ((memoizedValue000 == null) ? Stella.MEMOIZED_NULL_VALUE : memoizedValue000);
          }
        }
        { BooleanWrapper value000 = ((BooleanWrapper)(memoizedValue000));

          return (BooleanWrapper.coerceWrappedBooleanToBoolean(value000));
        }
      }
    }
    else {
      { MemoizationTable memoTable001 = null;
        Cons memoizedEntry001 = null;
        Stella_Object memoizedValue001 = null;

        if (Stella.$MEMOIZATION_ENABLEDp$) {
          memoTable001 = ((MemoizationTable)(Logic.SGT_LOGIC_F_TEST_ISAp_MEMO_TABLE_001.surrogateValue));
          if (memoTable001 == null) {
            Surrogate.initializeMemoizationTable(Logic.SGT_LOGIC_F_TEST_ISAp_MEMO_TABLE_001, "(:MAX-VALUES 1000 :TIMESTAMPS (:KB-UPDATE))");
            memoTable001 = ((MemoizationTable)(Logic.SGT_LOGIC_F_TEST_ISAp_MEMO_TABLE_001.surrogateValue));
          }
          memoizedEntry001 = MruMemoizationTable.lookupMruMemoizedValue(((MruMemoizationTable)(memoTable001)), member, type, ((Context)(Stella.$CONTEXT$.get())), Stella.MEMOIZED_NULL_VALUE, 6);
          memoizedValue001 = memoizedEntry001.value;
        }
        if (memoizedValue001 != null) {
          if (memoizedValue001 == Stella.MEMOIZED_NULL_VALUE) {
            memoizedValue001 = null;
          }
        }
        else {
          memoizedValue001 = (Logic.helpMemoizeTestIsaP(member, type) ? Stella.TRUE_WRAPPER : Stella.FALSE_WRAPPER);
          if (Stella.$MEMOIZATION_ENABLEDp$) {
            memoizedEntry001.value = ((memoizedValue001 == null) ? Stella.MEMOIZED_NULL_VALUE : memoizedValue001);
          }
        }
        { BooleanWrapper value001 = ((BooleanWrapper)(memoizedValue001));

          return (BooleanWrapper.coerceWrappedBooleanToBoolean(value001));
        }
      }
    }
  }