public static Iterator sqlJoin(Proposition proposition, LogicObject database, Stella_Object arguments) {
    RDBMS.checkForExternalDbUpdates(proposition, database);
    { MemoizationTable memoTable000 = null;
      Cons memoizedEntry000 = null;
      Stella_Object memoizedValue000 = null;

      if (Stella.$MEMOIZATION_ENABLEDp$) {
        memoTable000 = ((MemoizationTable)(RDBMS.SGT_RDBMS_F_SQL_JOIN_MEMO_TABLE_000.surrogateValue));
        if (memoTable000 == null) {
          Surrogate.initializeMemoizationTable(RDBMS.SGT_RDBMS_F_SQL_JOIN_MEMO_TABLE_000, "(:MAX-VALUES 100 :TIMESTAMPS (:META-KB-UPDATE :EXTERNAL-DB-UPDATE))");
          memoTable000 = ((MemoizationTable)(RDBMS.SGT_RDBMS_F_SQL_JOIN_MEMO_TABLE_000.surrogateValue));
        }
        memoizedEntry000 = MruMemoizationTable.lookupMruMemoizedValue(((MruMemoizationTable)(memoTable000)), RDBMS.getQueryPatternMemoizationKey(proposition), ((Context)(Stella.$CONTEXT$.get())), (((Boolean)(Logic.$REVERSEPOLARITYp$.get())).booleanValue() ? Stella.TRUE_WRAPPER : Stella.FALSE_WRAPPER), Stella.MEMOIZED_NULL_VALUE, 6);
        memoizedValue000 = memoizedEntry000.value;
      }
      if (memoizedValue000 != null) {
        if (memoizedValue000 == Stella.MEMOIZED_NULL_VALUE) {
          memoizedValue000 = null;
        }
      }
      else {
        memoizedValue000 = MemoizableIterator.newMemoizableIterator(RDBMS.helpMemoizeSqlJoin(proposition, database, arguments));
        if (Stella.$MEMOIZATION_ENABLEDp$) {
          memoizedEntry000.value = ((memoizedValue000 == null) ? Stella.MEMOIZED_NULL_VALUE : memoizedValue000);
        }
      }
      { Iterator value000 = MemoizableIterator.cloneMemoizedIterator(((MemoizableIterator)(memoizedValue000)));

        return (((Iterator)(value000)));
      }
    }
  }